From 9b7c1e4393b1d1f6af95a650b4e162dfcf3f0899 Mon Sep 17 00:00:00 2001 From: Dan Willemsen Date: Mon, 5 Nov 2018 10:40:45 -0800 Subject: [PATCH] Fix pre-extracted PDKs The PDK unzip logic does not place all the files in the same directory it would place a zipfile, but instead inside a directory of the same name: a/b/platform.zip!pdk.mk turns into: a/b/platform/pdk.mk So fix the PDK_FUISON_PLATFORM_DIR autodetection to take this into account. Also don't create touch rules for the pre-extracted java files. Bug: 118776469 Test: try building the PDK with PDK_FUSION_PLATFORM_ZIP set, and files extracted Change-Id: Ib27d12aba773a5e6bd41fcbe8945a0bc31b8c281 --- core/config.mk | 4 ++-- core/pdk_fusion_modules.mk | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/core/config.mk b/core/config.mk index 0e38dbe20e..c1ea5a869e 100644 --- a/core/config.mk +++ b/core/config.mk @@ -532,8 +532,8 @@ endif # pdk or fusion ifdef PDK_FUSION_PLATFORM_ZIP TARGET_BUILD_PDK := true ifeq (,$(wildcard $(PDK_FUSION_PLATFORM_ZIP))) - ifneq (,$(wildcard $(dir $(PDK_FUSION_PLATFORM_ZIP))/pdk.mk)) - PDK_FUSION_PLATFORM_DIR := $(dir $(PDK_FUSION_PLATFORM_ZIP)) + ifneq (,$(wildcard $(patsubst %.zip,%,$(PDK_FUSION_PLATFORM_ZIP))/pdk.mk)) + PDK_FUSION_PLATFORM_DIR := $(patsubst %.zip,%,$(PDK_FUSION_PLATFORM_ZIP)) PDK_FUSION_PLATFORM_ZIP := else $(error Cannot find file $(PDK_FUSION_PLATFORM_ZIP).) diff --git a/core/pdk_fusion_modules.mk b/core/pdk_fusion_modules.mk index 9aabd0f156..235acf9378 100644 --- a/core/pdk_fusion_modules.mk +++ b/core/pdk_fusion_modules.mk @@ -37,12 +37,14 @@ include $(BUILD_PREBUILT) # The source prebuilts are extracted in the rule of _pdk_fusion_stamp. # Use a touch rule to establish the dependency. +ifndef PDK_FUSION_PLATFORM_DIR $(3) $(11) : $(_pdk_fusion_stamp) $(hide) if [ ! -f $$@ ]; then \ echo 'Error: $$@ does not exist. Check your platform.zip.' 1>&2; \ exit 1; \ fi $(hide) touch $$@ +endif endef # We don't have a LOCAL_PATH for the auto-generated modules, so let it be the $(BUILD_SYSTEM).