Ying Wang | 82b836f | 2012-03-30 18:08:07 -0700 | [diff] [blame] | 1 | # This file defines the rule to fuse the platform.zip into the current PDK build. |
Colin Cross | c451a37 | 2013-12-18 19:36:44 -0800 | [diff] [blame] | 2 | PDK_PLATFORM_JAVA_ZIP_JAVA_TARGET_LIB_DIR := |
| 3 | PDK_PLATFORM_JAVA_ZIP_JAVA_HOST_LIB_DIR := \ |
| 4 | host/common/obj/JAVA_LIBRARIES/bouncycastle-host_intermediates |
| 5 | PDK_PLATFORM_JAVA_ZIP_CONTENTS := |
| 6 | |
Keun young Park | f4d1438 | 2012-06-18 12:46:46 -0700 | [diff] [blame] | 7 | ifneq (,$(filter platform-java, $(MAKECMDGOALS))$(PDK_FUSION_PLATFORM_ZIP)) |
Keun young Park | 816b9fd | 2012-05-16 10:32:41 -0700 | [diff] [blame] | 8 | # additional items to add to platform.zip for platform-java build |
| 9 | # For these dirs, add classes.jar and javalib.jar from the dir to platform.zip |
| 10 | # all paths under out dir |
Colin Cross | c451a37 | 2013-12-18 19:36:44 -0800 | [diff] [blame] | 11 | PDK_PLATFORM_JAVA_ZIP_JAVA_TARGET_LIB_DIR += \ |
Nicholas Sauer | 1b2637e | 2015-03-27 09:26:27 -0700 | [diff] [blame] | 12 | target/common/obj/JAVA_LIBRARIES/android.test.runner_intermediates \ |
| 13 | target/common/obj/JAVA_LIBRARIES/android-common_intermediates \ |
| 14 | target/common/obj/JAVA_LIBRARIES/android-ex-camera2_intermediates \ |
| 15 | target/common/obj/JAVA_LIBRARIES/android_stubs_current_intermediates \ |
| 16 | target/common/obj/JAVA_LIBRARIES/bouncycastle_intermediates \ |
| 17 | target/common/obj/JAVA_LIBRARIES/conscrypt_intermediates \ |
Piotr Jastrzebski | 052a00f | 2015-02-17 16:55:52 +0000 | [diff] [blame] | 18 | target/common/obj/JAVA_LIBRARIES/core-oj_intermediates \ |
Nicholas Sauer | 1b2637e | 2015-03-27 09:26:27 -0700 | [diff] [blame] | 19 | target/common/obj/JAVA_LIBRARIES/core-libart_intermediates \ |
| 20 | target/common/obj/JAVA_LIBRARIES/core-junit_intermediates \ |
| 21 | target/common/obj/JAVA_LIBRARIES/ext_intermediates \ |
| 22 | target/common/obj/JAVA_LIBRARIES/framework_intermediates \ |
| 23 | target/common/obj/JAVA_LIBRARIES/ims-common_intermediates \ |
| 24 | target/common/obj/JAVA_LIBRARIES/okhttp_intermediates \ |
| 25 | target/common/obj/JAVA_LIBRARIES/telephony-common_intermediates \ |
| 26 | target/common/obj/JAVA_LIBRARIES/voip-common_intermediates \ |
Colin Cross | 4b76499 | 2014-01-29 10:01:37 -0800 | [diff] [blame] | 27 | |
Colin Cross | c451a37 | 2013-12-18 19:36:44 -0800 | [diff] [blame] | 28 | # not java libraries |
| 29 | PDK_PLATFORM_JAVA_ZIP_CONTENTS += \ |
| 30 | target/common/obj/APPS/framework-res_intermediates/package-export.apk \ |
| 31 | target/common/obj/APPS/framework-res_intermediates/src/R.stamp |
| 32 | endif # platform-java or FUSION build |
| 33 | |
Colin Cross | 074d838 | 2013-12-17 12:06:59 -0800 | [diff] [blame] | 34 | PDK_PLATFORM_JAVA_ZIP_JAVA_LIB_DIR := \ |
| 35 | $(PDK_PLATFORM_JAVA_ZIP_JAVA_TARGET_LIB_DIR) \ |
| 36 | $(PDK_PLATFORM_JAVA_ZIP_JAVA_HOST_LIB_DIR) |
Colin Cross | c451a37 | 2013-12-18 19:36:44 -0800 | [diff] [blame] | 37 | |
Keun young Park | 816b9fd | 2012-05-16 10:32:41 -0700 | [diff] [blame] | 38 | PDK_PLATFORM_JAVA_ZIP_CONTENTS += $(foreach lib_dir,$(PDK_PLATFORM_JAVA_ZIP_JAVA_LIB_DIR),\ |
Nicholas Sauer | c2400c3 | 2015-03-26 13:36:13 -0700 | [diff] [blame] | 39 | $(lib_dir)/classes.jack $(lib_dir)/classes.jar $(lib_dir)/javalib.jar) |
Keun young Park | 816b9fd | 2012-05-16 10:32:41 -0700 | [diff] [blame] | 40 | |
Keun young Park | efe02ce | 2012-06-06 17:19:29 -0700 | [diff] [blame] | 41 | # check and override java support level |
Keun young Park | f4d1438 | 2012-06-18 12:46:46 -0700 | [diff] [blame] | 42 | ifneq ($(TARGET_BUILD_PDK)$(PDK_FUSION_PLATFORM_ZIP),) |
Keun young Park | efe02ce | 2012-06-06 17:19:29 -0700 | [diff] [blame] | 43 | ifneq ($(wildcard external/proguard),) |
| 44 | TARGET_BUILD_JAVA_SUPPORT_LEVEL := sdk |
| 45 | else # no proguard |
| 46 | TARGET_BUILD_JAVA_SUPPORT_LEVEL := |
| 47 | endif |
| 48 | # platform supprot is set after checking platform.zip |
| 49 | endif # PDK |
Keun young Park | 816b9fd | 2012-05-16 10:32:41 -0700 | [diff] [blame] | 50 | |
Ying Wang | 82b836f | 2012-03-30 18:08:07 -0700 | [diff] [blame] | 51 | ifdef PDK_FUSION_PLATFORM_ZIP |
Ying Wang | 82b836f | 2012-03-30 18:08:07 -0700 | [diff] [blame] | 52 | _pdk_fusion_intermediates := $(call intermediates-dir-for, PACKAGING, pdk_fusion) |
| 53 | _pdk_fusion_stamp := $(_pdk_fusion_intermediates)/pdk_fusion.stamp |
| 54 | |
Keun young Park | 816b9fd | 2012-05-16 10:32:41 -0700 | [diff] [blame] | 55 | _pdk_fusion_file_list := $(shell unzip -Z -1 $(PDK_FUSION_PLATFORM_ZIP) \ |
| 56 | '*[^/]' -x 'target/common/*' 2>/dev/null) |
| 57 | _pdk_fusion_java_file_list := \ |
| 58 | $(shell unzip -Z -1 $(PDK_FUSION_PLATFORM_ZIP) 'target/common/*' 2>/dev/null) |
| 59 | _pdk_fusion_files := $(addprefix $(_pdk_fusion_intermediates)/,\ |
| 60 | $(_pdk_fusion_file_list) $(_pdk_fusion_java_file_list)) |
Keun young Park | efe02ce | 2012-06-06 17:19:29 -0700 | [diff] [blame] | 61 | |
Keun young Park | 816b9fd | 2012-05-16 10:32:41 -0700 | [diff] [blame] | 62 | ifneq ($(_pdk_fusion_java_file_list),) |
Keun young Park | efe02ce | 2012-06-06 17:19:29 -0700 | [diff] [blame] | 63 | # This represents whether java build can use platform API or not |
| 64 | # This should not be used in Android.mk |
| 65 | TARGET_BUILD_PDK_JAVA_PLATFORM := true |
| 66 | ifneq ($(TARGET_BUILD_JAVA_SUPPORT_LEVEL),) |
| 67 | TARGET_BUILD_JAVA_SUPPORT_LEVEL := platform |
| 68 | endif |
Keun young Park | 816b9fd | 2012-05-16 10:32:41 -0700 | [diff] [blame] | 69 | endif |
| 70 | |
Ying Wang | 82b836f | 2012-03-30 18:08:07 -0700 | [diff] [blame] | 71 | $(_pdk_fusion_stamp) : $(PDK_FUSION_PLATFORM_ZIP) |
| 72 | @echo "Unzip $(dir $@) <- $<" |
| 73 | $(hide) rm -rf $(dir $@) && mkdir -p $(dir $@) |
| 74 | $(hide) unzip -qo $< -d $(dir $@) |
Keun young Park | d8de82f | 2012-05-25 10:52:44 -0700 | [diff] [blame] | 75 | $(call split-long-arguments,-touch,$(_pdk_fusion_files)) |
Keun young Park | 816b9fd | 2012-05-16 10:32:41 -0700 | [diff] [blame] | 76 | $(hide) touch $@ |
Ying Wang | 82b836f | 2012-03-30 18:08:07 -0700 | [diff] [blame] | 77 | |
Keun young Park | 816b9fd | 2012-05-16 10:32:41 -0700 | [diff] [blame] | 78 | |
Ying Wang | 82b836f | 2012-03-30 18:08:07 -0700 | [diff] [blame] | 79 | $(_pdk_fusion_files) : $(_pdk_fusion_stamp) |
| 80 | |
Keun young Park | 816b9fd | 2012-05-16 10:32:41 -0700 | [diff] [blame] | 81 | |
Ying Wang | 82b836f | 2012-03-30 18:08:07 -0700 | [diff] [blame] | 82 | # Implicit pattern rules to copy the fusion files to the system image directory. |
| 83 | # Note that if there is already explicit rule in the build system to generate a file, |
| 84 | # the pattern rule will be just ignored by make. |
| 85 | # That's desired by us: we want only absent files from the platform zip package. |
| 86 | # Copy with the last-modified time preserved, never follow symbolic links. |
Colin Cross | 2bea2e6 | 2012-04-23 18:49:04 -0700 | [diff] [blame] | 87 | $(PRODUCT_OUT)/% : $(_pdk_fusion_intermediates)/% $(_pdk_fusion_stamp) |
Ying Wang | 82b836f | 2012-03-30 18:08:07 -0700 | [diff] [blame] | 88 | @mkdir -p $(dir $@) |
Sungmin Choi | 79d5109 | 2013-02-04 00:54:03 +0900 | [diff] [blame] | 89 | $(hide) rm -rf $@ |
Ying Wang | 82b836f | 2012-03-30 18:08:07 -0700 | [diff] [blame] | 90 | $(hide) cp -fpPR $< $@ |
| 91 | |
Colin Cross | c451a37 | 2013-12-18 19:36:44 -0800 | [diff] [blame] | 92 | # implicit rules for host java files |
| 93 | $(HOST_COMMON_OUT_ROOT)/% : $(_pdk_fusion_intermediates)/host/common/% $(_pdk_fusion_stamp) |
| 94 | @mkdir -p $(dir $@) |
| 95 | $(hide) cp -fpPR $< $@ |
| 96 | |
Keun young Park | efe02ce | 2012-06-06 17:19:29 -0700 | [diff] [blame] | 97 | ifeq (true,$(TARGET_BUILD_PDK_JAVA_PLATFORM)) |
Ying Wang | 82b836f | 2012-03-30 18:08:07 -0700 | [diff] [blame] | 98 | |
keunyoung | a219bdc | 2013-07-25 18:20:09 -0700 | [diff] [blame] | 99 | PDK_FUSION_OUT_DIR := $(OUT_DIR) |
Tom Cherry | 6076762 | 2012-06-14 17:33:38 -0700 | [diff] [blame] | 100 | ifeq (debug,$(TARGET_BUILD_TYPE)) |
| 101 | PDK_FUSION_OUT_DIR := $(DEBUG_OUT_DIR) |
Tom Cherry | 6076762 | 2012-06-14 17:33:38 -0700 | [diff] [blame] | 102 | endif |
keunyoung | a219bdc | 2013-07-25 18:20:09 -0700 | [diff] [blame] | 103 | |
| 104 | define JAVA_dependency_template |
Tom Cherry | 6076762 | 2012-06-14 17:33:38 -0700 | [diff] [blame] | 105 | $(PDK_FUSION_OUT_DIR)/$(strip $(1)): $(_pdk_fusion_intermediates)/$(strip $(1)) \ |
keunyoung | a219bdc | 2013-07-25 18:20:09 -0700 | [diff] [blame] | 106 | $(PDK_FUSION_OUT_DIR)/$(strip $(2)) $(_pdk_fusion_stamp) |
Keun young Park | 816b9fd | 2012-05-16 10:32:41 -0700 | [diff] [blame] | 107 | @mkdir -p $$(dir $$@) |
| 108 | $(hide) cp -fpPR $$< $$@ |
| 109 | endef |
| 110 | |
| 111 | # needs explicit dependency as package-export.apk is not explicitly pulled |
| 112 | $(eval $(call JAVA_dependency_template,\ |
| 113 | target/common/obj/APPS/framework-res_intermediates/src/R.stamp,\ |
| 114 | target/common/obj/APPS/framework-res_intermediates/package-export.apk)) |
| 115 | |
| 116 | # javalib.jar should pull classes.jar as classes.jar is not explicitly pulled. |
Colin Cross | 074d838 | 2013-12-17 12:06:59 -0800 | [diff] [blame] | 117 | $(foreach lib_dir,$(PDK_PLATFORM_JAVA_ZIP_JAVA_TARGET_LIB_DIR),\ |
Keun young Park | 816b9fd | 2012-05-16 10:32:41 -0700 | [diff] [blame] | 118 | $(eval $(call JAVA_dependency_template,$(lib_dir)/javalib.jar,\ |
| 119 | $(lib_dir)/classes.jar))) |
| 120 | |
Colin Cross | 074d838 | 2013-12-17 12:06:59 -0800 | [diff] [blame] | 121 | # implicit rules for all other target files |
Keun young Park | 816b9fd | 2012-05-16 10:32:41 -0700 | [diff] [blame] | 122 | $(TARGET_COMMON_OUT_ROOT)/% : $(_pdk_fusion_intermediates)/target/common/% $(_pdk_fusion_stamp) |
| 123 | @mkdir -p $(dir $@) |
| 124 | $(hide) cp -fpPR $< $@ |
Ying Wang | 82b836f | 2012-03-30 18:08:07 -0700 | [diff] [blame] | 125 | endif |
Keun young Park | ebb351e | 2012-04-19 15:36:18 -0700 | [diff] [blame] | 126 | |
Keun young Park | 816b9fd | 2012-05-16 10:32:41 -0700 | [diff] [blame] | 127 | ALL_PDK_FUSION_FILES := $(addprefix $(PRODUCT_OUT)/, $(_pdk_fusion_file_list)) |
| 128 | |
| 129 | endif # PDK_FUSION_PLATFORM_ZIP |
| 130 | |
Keun young Park | ebb351e | 2012-04-19 15:36:18 -0700 | [diff] [blame] | 131 | ifeq ($(TARGET_BUILD_PDK),true) |
Keun young Park | f4d1438 | 2012-06-18 12:46:46 -0700 | [diff] [blame] | 132 | $(info PDK TARGET_BUILD_JAVA_SUPPORT_LEVEL $(TARGET_BUILD_JAVA_SUPPORT_LEVEL)) |
Keun young Park | efe02ce | 2012-06-06 17:19:29 -0700 | [diff] [blame] | 133 | ifeq ($(TARGET_BUILD_PDK_JAVA_PLATFORM),) |
Keun young Park | 816b9fd | 2012-05-16 10:32:41 -0700 | [diff] [blame] | 134 | |
Keun young Park | ebb351e | 2012-04-19 15:36:18 -0700 | [diff] [blame] | 135 | # SDK used for Java build under PDK |
| 136 | PDK_BUILD_SDK_VERSION := $(lastword $(TARGET_AVAILABLE_SDK_VERSIONS)) |
| 137 | $(info PDK Build uses SDK $(PDK_BUILD_SDK_VERSION)) |
| 138 | |
Keun young Park | 816b9fd | 2012-05-16 10:32:41 -0700 | [diff] [blame] | 139 | else # PDK_JAVA |
| 140 | |
| 141 | $(info PDK Build uses the current platform API) |
| 142 | |
| 143 | endif # PDK_JAVA |
| 144 | |
Keun young Park | ebb351e | 2012-04-19 15:36:18 -0700 | [diff] [blame] | 145 | endif # BUILD_PDK |
Keun young Park | 7222669 | 2012-07-31 17:13:20 -0700 | [diff] [blame] | 146 | |
| 147 | ifneq (,$(filter platform platform-java, $(MAKECMDGOALS))$(filter true,$(TARGET_BUILD_PDK))) |
| 148 | # files under $(PRODUCT_OUT)/symbols to help debugging. |
| 149 | # Source not included to PDK due to dependency issue, so provide symbols instead. |
Ying Wang | 788c778 | 2014-05-15 10:54:32 -0700 | [diff] [blame] | 150 | |
Ying Wang | 00b8341 | 2014-05-15 16:13:15 -0700 | [diff] [blame] | 151 | # We may not be building all of them. |
| 152 | # The platform.zip just silently ignores the nonexistent ones. |
Keun young Park | 7222669 | 2012-07-31 17:13:20 -0700 | [diff] [blame] | 153 | PDK_SYMBOL_FILES_LIST := \ |
Ying Wang | 00b8341 | 2014-05-15 16:13:15 -0700 | [diff] [blame] | 154 | system/bin/app_process32 \ |
| 155 | system/bin/app_process64 |
Keun young Park | 7222669 | 2012-07-31 17:13:20 -0700 | [diff] [blame] | 156 | |
| 157 | ifdef PDK_FUSION_PLATFORM_ZIP |
| 158 | # symbols should be explicitly pulled for fusion build |
Ying Wang | 00b8341 | 2014-05-15 16:13:15 -0700 | [diff] [blame] | 159 | $(foreach f,$(filter $(PDK_SYMBOL_FILES_LIST), $(_pdk_fusion_file_list)),\ |
Keun young Park | 7222669 | 2012-07-31 17:13:20 -0700 | [diff] [blame] | 160 | $(eval $(call add-dependency,$(PRODUCT_OUT)/$(f),$(PRODUCT_OUT)/symbols/$(f)))) |
| 161 | endif # PLATFORM_ZIP |
| 162 | endif # platform.zip build or PDK |