Support a pre-extracted PDK zip
Pre-extracting the zip files are more sustainable for git, so that
objects can be shared if unchanged, rather than the 900MB zip file
changing on every build.
This also has the advantage that we could put an Android.bp file inside
the PDK, and Soong would just pick it up.
Bug: 68767391
Test: Build mini_arm64 PDK with platform.zip
Test: Build mini_arm64 PDK with extracted zip file
Change-Id: I16db030a731aea55b69c1d6e2260dbd70b167544
Merged-In: I16db030a731aea55b69c1d6e2260dbd70b167544
(cherry picked from commit 0663f685c2
)
This commit is contained in:
parent
0c7a14ab3c
commit
389bbe45a2
5 changed files with 158 additions and 95 deletions
|
@ -1458,7 +1458,8 @@ INTERNAL_SYSTEMIMAGE_FILES := $(filter $(TARGET_OUT)/%, \
|
||||||
$(ALL_GENERATED_SOURCES) \
|
$(ALL_GENERATED_SOURCES) \
|
||||||
$(ALL_DEFAULT_INSTALLED_MODULES) \
|
$(ALL_DEFAULT_INSTALLED_MODULES) \
|
||||||
$(PDK_FUSION_SYSIMG_FILES) \
|
$(PDK_FUSION_SYSIMG_FILES) \
|
||||||
$(RECOVERY_RESOURCE_ZIP))
|
$(RECOVERY_RESOURCE_ZIP)) \
|
||||||
|
$(PDK_FUSION_SYMLINK_STAMP)
|
||||||
|
|
||||||
FULL_SYSTEMIMAGE_DEPS := $(INTERNAL_SYSTEMIMAGE_FILES) $(INTERNAL_USERIMAGES_DEPS)
|
FULL_SYSTEMIMAGE_DEPS := $(INTERNAL_SYSTEMIMAGE_FILES) $(INTERNAL_USERIMAGES_DEPS)
|
||||||
|
|
||||||
|
@ -1695,7 +1696,8 @@ ifneq ($(PDK_PLATFORM_ZIP_PRODUCT_BINARIES),)
|
||||||
endif
|
endif
|
||||||
@# Add dex-preopt files and config.
|
@# Add dex-preopt files and config.
|
||||||
$(if $(PRIVATE_DEX_FILES),$(hide) cd $(OUT_DIR) && zip -qryX $(patsubst $(OUT_DIR)/%,%,$@ $(PRIVATE_DEX_FILES)))
|
$(if $(PRIVATE_DEX_FILES),$(hide) cd $(OUT_DIR) && zip -qryX $(patsubst $(OUT_DIR)/%,%,$@ $(PRIVATE_DEX_FILES)))
|
||||||
$(hide) zip -qryXj $@ $(PRIVATE_ODEX_CONFIG)
|
$(hide) touch $(PRODUCT_OUT)/pdk.mk
|
||||||
|
$(hide) zip -qryXj $@ $(PRIVATE_ODEX_CONFIG) $(PRODUCT_OUT)/pdk.mk
|
||||||
|
|
||||||
.PHONY: platform
|
.PHONY: platform
|
||||||
platform: $(INSTALLED_PLATFORM_ZIP)
|
platform: $(INSTALLED_PLATFORM_ZIP)
|
||||||
|
@ -1902,7 +1904,8 @@ ifdef BOARD_USES_SYSTEM_OTHER
|
||||||
INTERNAL_SYSTEMOTHERIMAGE_FILES := \
|
INTERNAL_SYSTEMOTHERIMAGE_FILES := \
|
||||||
$(filter $(TARGET_OUT_SYSTEM_OTHER)/%,\
|
$(filter $(TARGET_OUT_SYSTEM_OTHER)/%,\
|
||||||
$(ALL_DEFAULT_INSTALLED_MODULES)\
|
$(ALL_DEFAULT_INSTALLED_MODULES)\
|
||||||
$(ALL_PDK_FUSION_FILES))
|
$(ALL_PDK_FUSION_FILES)) \
|
||||||
|
$(PDK_FUSION_SYMLINK_STAMP)
|
||||||
|
|
||||||
INSTALLED_FILES_FILE_SYSTEMOTHER := $(PRODUCT_OUT)/installed-files-system-other.txt
|
INSTALLED_FILES_FILE_SYSTEMOTHER := $(PRODUCT_OUT)/installed-files-system-other.txt
|
||||||
$(INSTALLED_FILES_FILE_SYSTEMOTHER) : $(INTERNAL_SYSTEMOTHERIMAGE_FILES) $(FILESLIST)
|
$(INSTALLED_FILES_FILE_SYSTEMOTHER) : $(INTERNAL_SYSTEMOTHERIMAGE_FILES) $(FILESLIST)
|
||||||
|
@ -1949,7 +1952,8 @@ ifdef BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE
|
||||||
INTERNAL_VENDORIMAGE_FILES := \
|
INTERNAL_VENDORIMAGE_FILES := \
|
||||||
$(filter $(TARGET_OUT_VENDOR)/%,\
|
$(filter $(TARGET_OUT_VENDOR)/%,\
|
||||||
$(ALL_DEFAULT_INSTALLED_MODULES)\
|
$(ALL_DEFAULT_INSTALLED_MODULES)\
|
||||||
$(ALL_PDK_FUSION_FILES))
|
$(ALL_PDK_FUSION_FILES)) \
|
||||||
|
$(PDK_FUSION_SYMLINK_STAMP)
|
||||||
|
|
||||||
# platform.zip depends on $(INTERNAL_VENDORIMAGE_FILES).
|
# platform.zip depends on $(INTERNAL_VENDORIMAGE_FILES).
|
||||||
$(INSTALLED_PLATFORM_ZIP) : $(INTERNAL_VENDORIMAGE_FILES)
|
$(INSTALLED_PLATFORM_ZIP) : $(INTERNAL_VENDORIMAGE_FILES)
|
||||||
|
@ -2000,7 +2004,8 @@ ifdef BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE
|
||||||
INTERNAL_PRODUCTIMAGE_FILES := \
|
INTERNAL_PRODUCTIMAGE_FILES := \
|
||||||
$(filter $(TARGET_OUT_PRODUCT)/%,\
|
$(filter $(TARGET_OUT_PRODUCT)/%,\
|
||||||
$(ALL_DEFAULT_INSTALLED_MODULES)\
|
$(ALL_DEFAULT_INSTALLED_MODULES)\
|
||||||
$(ALL_PDK_FUSION_FILES))
|
$(ALL_PDK_FUSION_FILES)) \
|
||||||
|
$(PDK_FUSION_SYMLINK_STAMP)
|
||||||
|
|
||||||
# platform.zip depends on $(INTERNAL_PRODUCTIMAGE_FILES).
|
# platform.zip depends on $(INTERNAL_PRODUCTIMAGE_FILES).
|
||||||
$(INSTALLED_PLATFORM_ZIP) : $(INTERNAL_PRODUCTIMAGE_FILES)
|
$(INSTALLED_PLATFORM_ZIP) : $(INTERNAL_PRODUCTIMAGE_FILES)
|
||||||
|
|
|
@ -448,9 +448,9 @@ pdk fusion: $(DEFAULT_GOAL)
|
||||||
|
|
||||||
# What to build:
|
# What to build:
|
||||||
# pdk fusion if:
|
# pdk fusion if:
|
||||||
# 1) PDK_FUSION_PLATFORM_ZIP is passed in from the environment
|
# 1) PDK_FUSION_PLATFORM_ZIP / PDK_FUSION_PLATFORM_DIR is passed in from the environment
|
||||||
# or
|
# or
|
||||||
# 2) the platform.zip exists in the default location
|
# 2) the platform.zip / pdk.mk exists in the default location
|
||||||
# or
|
# or
|
||||||
# 3) fusion is a command line build goal,
|
# 3) fusion is a command line build goal,
|
||||||
# PDK_FUSION_PLATFORM_ZIP is needed anyway, then do we need the 'fusion' goal?
|
# PDK_FUSION_PLATFORM_ZIP is needed anyway, then do we need the 'fusion' goal?
|
||||||
|
@ -459,27 +459,44 @@ pdk fusion: $(DEFAULT_GOAL)
|
||||||
# or
|
# or
|
||||||
# 2) TARGET_BUILD_PDK is passed in from the environment
|
# 2) TARGET_BUILD_PDK is passed in from the environment
|
||||||
|
|
||||||
# if PDK_FUSION_PLATFORM_ZIP is specified, do not override.
|
# if PDK_FUSION_PLATFORM_ZIP or PDK_FUSION_PLATFORM_DIR is specified, do not override.
|
||||||
ifndef PDK_FUSION_PLATFORM_ZIP
|
ifeq (,$(strip $(PDK_FUSION_PLATFORM_ZIP)$(PDK_FUSION_PLATFORM_DIR)))
|
||||||
# Most PDK project paths should be using vendor/pdk/TARGET_DEVICE
|
# Most PDK project paths should be using vendor/pdk/TARGET_DEVICE
|
||||||
# but some legacy ones (e.g. mini_armv7a_neon generic PDK) were setup
|
# but some legacy ones (e.g. mini_armv7a_neon generic PDK) were setup
|
||||||
# with vendor/pdk/TARGET_PRODUCT.
|
# with vendor/pdk/TARGET_PRODUCT.
|
||||||
_pdk_fusion_default_platform_zip = $(strip \
|
# Others are set up with vendor/pdk/TARGET_DEVICE/TARGET_DEVICE-userdebug
|
||||||
$(wildcard vendor/pdk/$(TARGET_DEVICE)/$(TARGET_PRODUCT)-$(TARGET_BUILD_VARIANT)/platform/platform.zip) \
|
_pdk_fusion_search_paths := \
|
||||||
$(wildcard vendor/pdk/$(TARGET_DEVICE)/$(patsubst aosp_%,full_%,$(TARGET_PRODUCT))-$(TARGET_BUILD_VARIANT)/platform/platform.zip) \
|
vendor/pdk/$(TARGET_DEVICE)/$(TARGET_DEVICE)-$(TARGET_BUILD_VARIANT)/platform \
|
||||||
$(wildcard vendor/pdk/$(TARGET_PRODUCT)/$(TARGET_PRODUCT)-$(TARGET_BUILD_VARIANT)/platform/platform.zip) \
|
vendor/pdk/$(TARGET_DEVICE)/$(TARGET_PRODUCT)-$(TARGET_BUILD_VARIANT)/platform \
|
||||||
$(wildcard vendor/pdk/$(TARGET_PRODUCT)/$(patsubst aosp_%,full_%,$(TARGET_PRODUCT))-$(TARGET_BUILD_VARIANT)/platform/platform.zip))
|
vendor/pdk/$(TARGET_DEVICE)/$(patsubst aosp_%,full_%,$(TARGET_PRODUCT))-$(TARGET_BUILD_VARIANT)/platform \
|
||||||
ifneq (,$(_pdk_fusion_default_platform_zip))
|
vendor/pdk/$(TARGET_PRODUCT)/$(TARGET_PRODUCT)-$(TARGET_BUILD_VARIANT)/platform \
|
||||||
PDK_FUSION_PLATFORM_ZIP := $(word 1, $(_pdk_fusion_default_platform_zip))
|
vendor/pdk/$(TARGET_PRODUCT)/$(patsubst aosp_%,full_%,$(TARGET_PRODUCT))-$(TARGET_BUILD_VARIANT)/platform
|
||||||
TARGET_BUILD_PDK := true
|
|
||||||
endif # _pdk_fusion_default_platform_zip
|
_pdk_fusion_default_platform_zip := $(strip $(foreach p,$(_pdk_fusion_search_paths),$(wildcard $(p)/platform.zip)))
|
||||||
endif # !PDK_FUSION_PLATFORM_ZIP
|
ifneq (,$(_pdk_fusion_default_platform_zip))
|
||||||
|
PDK_FUSION_PLATFORM_ZIP := $(word 1, $(_pdk_fusion_default_platform_zip))
|
||||||
|
_pdk_fusion_default_platform_zip :=
|
||||||
|
else
|
||||||
|
_pdk_fusion_default_platform_mk := $(strip $(foreach p,$(_pdk_fusion_search_paths),$(wildcard $(p)/pdk.mk)))
|
||||||
|
ifneq (,$(_pdk_fusion_default_platform_mk))
|
||||||
|
PDK_FUSION_PLATFORM_DIR := $(dir $(word 1,$(_pdk_fusion_default_platform_mk)))
|
||||||
|
_pdk_fusion_default_platform_mk :=
|
||||||
|
endif
|
||||||
|
endif # _pdk_fusion_default_platform_zip
|
||||||
|
_pdk_fusion_search_paths :=
|
||||||
|
endif # !PDK_FUSION_PLATFORM_ZIP && !PDK_FUSION_PLATFORM_DIR
|
||||||
|
|
||||||
|
ifneq (,$(PDK_FUSION_PLATFORM_ZIP))
|
||||||
|
ifneq (,$(PDK_FUSION_PLATFORM_DIR))
|
||||||
|
$(error Only one of PDK_FUSION_PLATFORM_ZIP or PDK_FUSION_PLATFORM_DIR may be specified)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
ifneq (,$(filter pdk fusion, $(MAKECMDGOALS)))
|
ifneq (,$(filter pdk fusion, $(MAKECMDGOALS)))
|
||||||
TARGET_BUILD_PDK := true
|
TARGET_BUILD_PDK := true
|
||||||
ifneq (,$(filter fusion, $(MAKECMDGOALS)))
|
ifneq (,$(filter fusion, $(MAKECMDGOALS)))
|
||||||
ifndef PDK_FUSION_PLATFORM_ZIP
|
ifeq (,$(strip $(PDK_FUSION_PLATFORM_ZIP)$(PDK_FUSION_PLATFORM_DIR)))
|
||||||
$(error Specify PDK_FUSION_PLATFORM_ZIP to do a PDK fusion.)
|
$(error Specify PDK_FUSION_PLATFORM_ZIP or PDK_FUSION_PLATFORM_DIR to do a PDK fusion.)
|
||||||
endif
|
endif
|
||||||
endif # fusion
|
endif # fusion
|
||||||
endif # pdk or fusion
|
endif # pdk or fusion
|
||||||
|
@ -487,7 +504,19 @@ endif # pdk or fusion
|
||||||
ifdef PDK_FUSION_PLATFORM_ZIP
|
ifdef PDK_FUSION_PLATFORM_ZIP
|
||||||
TARGET_BUILD_PDK := true
|
TARGET_BUILD_PDK := true
|
||||||
ifeq (,$(wildcard $(PDK_FUSION_PLATFORM_ZIP)))
|
ifeq (,$(wildcard $(PDK_FUSION_PLATFORM_ZIP)))
|
||||||
$(error Cannot find file $(PDK_FUSION_PLATFORM_ZIP).)
|
ifneq (,$(wildcard $(dir $(PDK_FUSION_PLATFORM_ZIP))/pdk.mk))
|
||||||
|
PDK_FUSION_PLATFORM_DIR := $(dir $(PDK_FUSION_PLATFORM_ZIP))
|
||||||
|
PDK_FUSION_PLATFORM_ZIP :=
|
||||||
|
else
|
||||||
|
$(error Cannot find file $(PDK_FUSION_PLATFORM_ZIP).)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifdef PDK_FUSION_PLATFORM_DIR
|
||||||
|
TARGET_BUILD_PDK := true
|
||||||
|
ifeq (,$(wildcard $(PDK_FUSION_PLATFORM_DIR)/pdk.mk))
|
||||||
|
$(error Cannot find file $(PDK_FUSION_PLATFORM_DIR)/pdk.mk.)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
|
@ -449,10 +449,10 @@ subdir_makefiles_total := $(words $(subdir_makefiles))
|
||||||
|
|
||||||
$(foreach mk,$(subdir_makefiles),$(info [$(call inc_and_print,subdir_makefiles_inc)/$(subdir_makefiles_total)] including $(mk) ...)$(eval include $(mk)))
|
$(foreach mk,$(subdir_makefiles),$(info [$(call inc_and_print,subdir_makefiles_inc)/$(subdir_makefiles_total)] including $(mk) ...)$(eval include $(mk)))
|
||||||
|
|
||||||
ifdef PDK_FUSION_PLATFORM_ZIP
|
ifneq (,$(PDK_FUSION_PLATFORM_ZIP)$(PDK_FUSION_PLATFORM_DIR))
|
||||||
# Bring in the PDK platform.zip modules.
|
# Bring in the PDK platform.zip modules.
|
||||||
include $(BUILD_SYSTEM)/pdk_fusion_modules.mk
|
include $(BUILD_SYSTEM)/pdk_fusion_modules.mk
|
||||||
endif # PDK_FUSION_PLATFORM_ZIP
|
endif # PDK_FUSION_PLATFORM_ZIP || PDK_FUSION_PLATFORM_DIR
|
||||||
|
|
||||||
droid_targets : blueprint_tools
|
droid_targets : blueprint_tools
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ PDK_PLATFORM_JAVA_ZIP_JAVA_HOST_LIB_DIR := \
|
||||||
host/common/obj/JAVA_LIBRARIES/hosttestlib_intermediates
|
host/common/obj/JAVA_LIBRARIES/hosttestlib_intermediates
|
||||||
PDK_PLATFORM_JAVA_ZIP_CONTENTS :=
|
PDK_PLATFORM_JAVA_ZIP_CONTENTS :=
|
||||||
|
|
||||||
ifneq (,$(filter platform-java, $(MAKECMDGOALS))$(PDK_FUSION_PLATFORM_ZIP))
|
ifneq (,$(filter platform-java, $(MAKECMDGOALS))$(PDK_FUSION_PLATFORM_ZIP)$(PDK_FUSION_PLATFORM_DIR))
|
||||||
# additional items to add to platform.zip for platform-java build
|
# additional items to add to platform.zip for platform-java build
|
||||||
# For these dirs, add classes.jar and javalib.jar from the dir to platform.zip
|
# For these dirs, add classes.jar and javalib.jar from the dir to platform.zip
|
||||||
# all paths under out dir
|
# all paths under out dir
|
||||||
|
@ -48,34 +48,55 @@ PDK_PLATFORM_JAVA_ZIP_CONTENTS += $(foreach lib_dir,$(PDK_PLATFORM_JAVA_ZIP_JAVA
|
||||||
$(lib_dir)/classes.dex.toc )
|
$(lib_dir)/classes.dex.toc )
|
||||||
|
|
||||||
# check and override java support level
|
# check and override java support level
|
||||||
ifneq ($(TARGET_BUILD_PDK)$(PDK_FUSION_PLATFORM_ZIP),)
|
ifneq ($(TARGET_BUILD_PDK)$(PDK_FUSION_PLATFORM_ZIP)$(PDK_FUSION_PLATFORM_DIR),)
|
||||||
ifneq ($(wildcard external/proguard),)
|
ifneq ($(wildcard external/proguard),)
|
||||||
TARGET_BUILD_JAVA_SUPPORT_LEVEL := sdk
|
TARGET_BUILD_JAVA_SUPPORT_LEVEL := sdk
|
||||||
else # no proguard
|
else # no proguard
|
||||||
TARGET_BUILD_JAVA_SUPPORT_LEVEL :=
|
TARGET_BUILD_JAVA_SUPPORT_LEVEL :=
|
||||||
endif
|
endif
|
||||||
# platform supprot is set after checking platform.zip
|
# platform support is set after checking platform.zip
|
||||||
endif # PDK
|
endif # PDK
|
||||||
|
|
||||||
|
ifneq (,$(PDK_FUSION_PLATFORM_DIR)$(PDK_FUSION_PLATFORM_ZIP))
|
||||||
|
|
||||||
|
_pdk_fusion_intermediates :=
|
||||||
|
_pdk_fusion_stamp :=
|
||||||
|
_pdk_fusion_file_list :=
|
||||||
|
_pdk_fusion_java_file_list :=
|
||||||
|
PDK_FUSION_SYMLINK_STAMP :=
|
||||||
|
|
||||||
|
ifdef PDK_FUSION_PLATFORM_DIR
|
||||||
|
_pdk_fusion_intermediates := $(PDK_FUSION_PLATFORM_DIR)
|
||||||
|
_pdk_fusion_file_list := $(sort \
|
||||||
|
$(shell cd $(PDK_FUSION_PLATFORM_DIR); find * -type f))
|
||||||
|
_pdk_fusion_java_file_list := $(filter target/common/%,$(_pdk_fusion_file_list))
|
||||||
|
_pdk_fusion_file_list := $(filter-out target/common/%,$(_pdk_fusion_file_list))
|
||||||
|
|
||||||
|
PDK_FUSION_SYMLINK_STAMP := $(call intermediates-dir-for, PACKAGING, pdk_fusion)/pdk_symlinks.stamp
|
||||||
|
|
||||||
|
symlink_list := $(sort \
|
||||||
|
$(shell cd $(PDK_FUSION_PLATFORM_DIR); find * -type l))
|
||||||
|
$(PDK_FUSION_SYMLINK_STAMP): PRIVATE_SYMLINKS := $(foreach s,$(symlink_list),\
|
||||||
|
$(s):$(shell readlink $(PDK_FUSION_PLATFORM_DIR)/$(s)))
|
||||||
|
$(PDK_FUSION_SYMLINK_STAMP):
|
||||||
|
$(foreach s,$(PRIVATE_SYMLINKS),\
|
||||||
|
mkdir -p $(PRODUCT_OUT)/$(dir $(call word-colon,1,$(s))) && \
|
||||||
|
ln -sf $(call word-colon,2,$(s)) $(PRODUCT_OUT)/$(call word-colon,1,$(s)) &&) true
|
||||||
|
touch $@
|
||||||
|
|
||||||
|
symlink_list :=
|
||||||
|
endif # PDK_FUSION_PLATFORM_DIR
|
||||||
|
|
||||||
ifdef PDK_FUSION_PLATFORM_ZIP
|
ifdef PDK_FUSION_PLATFORM_ZIP
|
||||||
_pdk_fusion_intermediates := $(call intermediates-dir-for, PACKAGING, pdk_fusion)
|
_pdk_fusion_intermediates := $(call intermediates-dir-for, PACKAGING, pdk_fusion)
|
||||||
_pdk_fusion_stamp := $(_pdk_fusion_intermediates)/pdk_fusion.stamp
|
_pdk_fusion_stamp := $(_pdk_fusion_intermediates)/pdk_fusion.stamp
|
||||||
|
|
||||||
_pdk_fusion_file_list := $(shell unzip -Z -1 $(PDK_FUSION_PLATFORM_ZIP) \
|
_pdk_fusion_file_list := $(shell unzip -Z -1 $(PDK_FUSION_PLATFORM_ZIP) \
|
||||||
'*[^/]' -x 'target/common/*' 2>/dev/null)
|
'*[^/]' -x 'target/common/*' 2>/dev/null)
|
||||||
_pdk_fusion_java_file_list := \
|
_pdk_fusion_java_file_list := \
|
||||||
$(shell unzip -Z -1 $(PDK_FUSION_PLATFORM_ZIP) 'target/common/*' 2>/dev/null)
|
$(shell unzip -Z -1 $(PDK_FUSION_PLATFORM_ZIP) 'target/common/*' 2>/dev/null)
|
||||||
_pdk_fusion_files := $(addprefix $(_pdk_fusion_intermediates)/,\
|
_pdk_fusion_files := $(addprefix $(_pdk_fusion_intermediates)/,\
|
||||||
$(_pdk_fusion_file_list) $(_pdk_fusion_java_file_list))
|
$(_pdk_fusion_file_list) $(_pdk_fusion_java_file_list))
|
||||||
|
|
||||||
ifneq ($(_pdk_fusion_java_file_list),)
|
|
||||||
# This represents whether java build can use platform API or not
|
|
||||||
# This should not be used in Android.mk
|
|
||||||
TARGET_BUILD_PDK_JAVA_PLATFORM := true
|
|
||||||
ifneq ($(TARGET_BUILD_JAVA_SUPPORT_LEVEL),)
|
|
||||||
TARGET_BUILD_JAVA_SUPPORT_LEVEL := platform
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
$(_pdk_fusion_stamp) : $(PDK_FUSION_PLATFORM_ZIP)
|
$(_pdk_fusion_stamp) : $(PDK_FUSION_PLATFORM_ZIP)
|
||||||
@echo "Unzip $(dir $@) <- $<"
|
@echo "Unzip $(dir $@) <- $<"
|
||||||
|
@ -84,9 +105,17 @@ $(_pdk_fusion_stamp) : $(PDK_FUSION_PLATFORM_ZIP)
|
||||||
$(call split-long-arguments,-touch,$(_pdk_fusion_files))
|
$(call split-long-arguments,-touch,$(_pdk_fusion_files))
|
||||||
$(hide) touch $@
|
$(hide) touch $@
|
||||||
|
|
||||||
|
|
||||||
$(_pdk_fusion_files) : $(_pdk_fusion_stamp)
|
$(_pdk_fusion_files) : $(_pdk_fusion_stamp)
|
||||||
|
endif # PDK_FUSION_PLATFORM_ZIP
|
||||||
|
|
||||||
|
ifneq ($(_pdk_fusion_java_file_list),)
|
||||||
|
# This represents whether java build can use platform API or not
|
||||||
|
# This should not be used in Android.mk
|
||||||
|
TARGET_BUILD_PDK_JAVA_PLATFORM := true
|
||||||
|
ifneq ($(TARGET_BUILD_JAVA_SUPPORT_LEVEL),)
|
||||||
|
TARGET_BUILD_JAVA_SUPPORT_LEVEL := platform
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
# Implicit pattern rules to copy the fusion files to the system image directory.
|
# Implicit pattern rules to copy the fusion files to the system image directory.
|
||||||
# Note that if there is already explicit rule in the build system to generate a file,
|
# Note that if there is already explicit rule in the build system to generate a file,
|
||||||
|
@ -104,63 +133,57 @@ $(HOST_COMMON_OUT_ROOT)/% : $(_pdk_fusion_intermediates)/host/common/% $(_pdk_fu
|
||||||
$(hide) cp -fpPR $< $@
|
$(hide) cp -fpPR $< $@
|
||||||
|
|
||||||
ifeq (true,$(TARGET_BUILD_PDK_JAVA_PLATFORM))
|
ifeq (true,$(TARGET_BUILD_PDK_JAVA_PLATFORM))
|
||||||
|
PDK_FUSION_OUT_DIR := $(OUT_DIR)
|
||||||
|
|
||||||
PDK_FUSION_OUT_DIR := $(OUT_DIR)
|
define JAVA_dependency_template
|
||||||
|
$(call add-dependency,$(PDK_FUSION_OUT_DIR)/$(strip $(1)),\
|
||||||
|
$(foreach d,$(filter $(2),$(_pdk_fusion_java_file_list)),$(PDK_FUSION_OUT_DIR)/$(d)))
|
||||||
|
endef
|
||||||
|
|
||||||
define JAVA_dependency_template
|
# needs explicit dependency as package-export.apk is not explicitly pulled
|
||||||
$(call add-dependency,$(PDK_FUSION_OUT_DIR)/$(strip $(1)),\
|
$(eval $(call JAVA_dependency_template,\
|
||||||
$(foreach d,$(filter $(2),$(_pdk_fusion_java_file_list)),$(PDK_FUSION_OUT_DIR)/$(d)))
|
target/common/obj/APPS/framework-res_intermediates/src/R.stamp,\
|
||||||
endef
|
target/common/obj/APPS/framework-res_intermediates/package-export.apk))
|
||||||
|
|
||||||
# needs explicit dependency as package-export.apk is not explicitly pulled
|
# javalib.jar should pull classes.jar as classes.jar is not explicitly pulled.
|
||||||
$(eval $(call JAVA_dependency_template,\
|
$(foreach lib_dir,$(PDK_PLATFORM_JAVA_ZIP_JAVA_TARGET_LIB_DIR),\
|
||||||
target/common/obj/APPS/framework-res_intermediates/src/R.stamp,\
|
$(eval $(call JAVA_dependency_template,$(lib_dir)/javalib.jar,\
|
||||||
target/common/obj/APPS/framework-res_intermediates/package-export.apk))
|
$(lib_dir)/classes.jar)))
|
||||||
|
|
||||||
# javalib.jar should pull classes.jar as classes.jar is not explicitly pulled.
|
|
||||||
$(foreach lib_dir,$(PDK_PLATFORM_JAVA_ZIP_JAVA_TARGET_LIB_DIR),\
|
|
||||||
$(eval $(call JAVA_dependency_template,$(lib_dir)/javalib.jar,\
|
|
||||||
$(lib_dir)/classes.jar)))
|
|
||||||
|
|
||||||
# implicit rules for all other target files
|
# implicit rules for all other target files
|
||||||
$(TARGET_COMMON_OUT_ROOT)/% : $(_pdk_fusion_intermediates)/target/common/% $(_pdk_fusion_stamp)
|
$(TARGET_COMMON_OUT_ROOT)/% : $(_pdk_fusion_intermediates)/target/common/% $(_pdk_fusion_stamp)
|
||||||
@mkdir -p $(dir $@)
|
@mkdir -p $(dir $@)
|
||||||
$(hide) cp -fpPR $< $@
|
$(hide) cp -fpPR $< $@
|
||||||
endif
|
endif # TARGET_BUILD_PDK_JAVA_PLATFORM
|
||||||
|
|
||||||
ALL_PDK_FUSION_FILES := $(addprefix $(PRODUCT_OUT)/, $(_pdk_fusion_file_list))
|
ALL_PDK_FUSION_FILES := $(addprefix $(PRODUCT_OUT)/, $(_pdk_fusion_file_list))
|
||||||
|
|
||||||
endif # PDK_FUSION_PLATFORM_ZIP
|
endif # PDK_FUSION_PLATFORM_ZIP || PDK_FUSION_PLATFORM_DIR
|
||||||
|
|
||||||
ifeq ($(TARGET_BUILD_PDK),true)
|
ifeq ($(TARGET_BUILD_PDK),true)
|
||||||
$(info PDK TARGET_BUILD_JAVA_SUPPORT_LEVEL $(TARGET_BUILD_JAVA_SUPPORT_LEVEL))
|
$(info PDK TARGET_BUILD_JAVA_SUPPORT_LEVEL $(TARGET_BUILD_JAVA_SUPPORT_LEVEL))
|
||||||
ifeq ($(TARGET_BUILD_PDK_JAVA_PLATFORM),)
|
ifeq ($(TARGET_BUILD_PDK_JAVA_PLATFORM),)
|
||||||
|
# SDK used for Java build under PDK
|
||||||
# SDK used for Java build under PDK
|
PDK_BUILD_SDK_VERSION := $(lastword $(TARGET_AVAILABLE_SDK_VERSIONS))
|
||||||
PDK_BUILD_SDK_VERSION := $(lastword $(TARGET_AVAILABLE_SDK_VERSIONS))
|
$(info PDK Build uses SDK $(PDK_BUILD_SDK_VERSION))
|
||||||
$(info PDK Build uses SDK $(PDK_BUILD_SDK_VERSION))
|
else # PDK_JAVA
|
||||||
|
$(info PDK Build uses the current platform API)
|
||||||
else # PDK_JAVA
|
endif # PDK_JAVA
|
||||||
|
|
||||||
$(info PDK Build uses the current platform API)
|
|
||||||
|
|
||||||
endif # PDK_JAVA
|
|
||||||
|
|
||||||
endif # BUILD_PDK
|
endif # BUILD_PDK
|
||||||
|
|
||||||
ifneq (,$(filter platform platform-java, $(MAKECMDGOALS))$(filter true,$(TARGET_BUILD_PDK)))
|
ifneq (,$(filter platform platform-java, $(MAKECMDGOALS))$(filter true,$(TARGET_BUILD_PDK)))
|
||||||
# files under $(PRODUCT_OUT)/symbols to help debugging.
|
# files under $(PRODUCT_OUT)/symbols to help debugging.
|
||||||
# Source not included to PDK due to dependency issue, so provide symbols instead.
|
# Source not included to PDK due to dependency issue, so provide symbols instead.
|
||||||
|
|
||||||
# We may not be building all of them.
|
# We may not be building all of them.
|
||||||
# The platform.zip just silently ignores the nonexistent ones.
|
# The platform.zip just silently ignores the nonexistent ones.
|
||||||
PDK_SYMBOL_FILES_LIST := \
|
PDK_SYMBOL_FILES_LIST := \
|
||||||
system/bin/app_process32 \
|
system/bin/app_process32 \
|
||||||
system/bin/app_process64
|
system/bin/app_process64
|
||||||
|
|
||||||
ifdef PDK_FUSION_PLATFORM_ZIP
|
ifneq (,$(PDK_FUSION_PLATFORM_ZIP)$(PDK_FUSION_PLATFORM_DIR))
|
||||||
# symbols should be explicitly pulled for fusion build
|
# symbols should be explicitly pulled for fusion build
|
||||||
$(foreach f,$(filter $(PDK_SYMBOL_FILES_LIST), $(_pdk_fusion_file_list)),\
|
$(foreach f,$(filter $(PDK_SYMBOL_FILES_LIST), $(_pdk_fusion_file_list)),\
|
||||||
$(eval $(call add-dependency,$(PRODUCT_OUT)/$(f),$(PRODUCT_OUT)/symbols/$(f))))
|
$(eval $(call add-dependency,$(PRODUCT_OUT)/$(f),$(PRODUCT_OUT)/symbols/$(f))))
|
||||||
endif # PLATFORM_ZIP
|
endif # PLATFORM_ZIP || PLATFORM_DIR
|
||||||
endif # platform.zip build or PDK
|
endif # platform.zip/dir build or PDK
|
||||||
|
|
|
@ -2,10 +2,16 @@
|
||||||
# We use these rules to rebuild .odex files of the .jar/.apk inside the platform.zip.
|
# We use these rules to rebuild .odex files of the .jar/.apk inside the platform.zip.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
ifdef PDK_FUSION_PLATFORM_ZIP
|
||||||
pdk_dexpreopt_config_mk := $(TARGET_OUT_INTERMEDIATES)/pdk_dexpreopt_config.mk
|
pdk_dexpreopt_config_mk := $(TARGET_OUT_INTERMEDIATES)/pdk_dexpreopt_config.mk
|
||||||
|
|
||||||
$(shell rm -f $(pdk_dexpreopt_config_mk) && mkdir -p $(dir $(pdk_dexpreopt_config_mk)) && \
|
$(shell rm -f $(pdk_dexpreopt_config_mk) && mkdir -p $(dir $(pdk_dexpreopt_config_mk)) && \
|
||||||
unzip -qo $(PDK_FUSION_PLATFORM_ZIP) -d $(dir $(pdk_dexpreopt_config_mk)) pdk_dexpreopt_config.mk 2>/dev/null)
|
unzip -qo $(PDK_FUSION_PLATFORM_ZIP) -d $(dir $(pdk_dexpreopt_config_mk)) pdk_dexpreopt_config.mk 2>/dev/null)
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifdef PDK_FUSION_PLATFORM_DIR
|
||||||
|
pdk_dexpreopt_config_mk := $(PDK_FUSION_PLATFORM_DIR)/pdk_dexpreopt_config.mk
|
||||||
|
endif
|
||||||
|
|
||||||
-include $(pdk_dexpreopt_config_mk)
|
-include $(pdk_dexpreopt_config_mk)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue