The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1 | # Put some miscellaneous rules here |
| 2 | |
| 3 | # Pick a reasonable string to use to identify files. |
| 4 | ifneq "" "$(filter eng.%,$(BUILD_NUMBER))" |
| 5 | # BUILD_NUMBER has a timestamp in it, which means that |
| 6 | # it will change every time. Pick a stable value. |
| 7 | FILE_NAME_TAG := eng.$(USER) |
| 8 | else |
| 9 | FILE_NAME_TAG := $(BUILD_NUMBER) |
| 10 | endif |
| 11 | |
| 12 | # ----------------------------------------------------------------- |
| 13 | # Define rules to copy PRODUCT_COPY_FILES defined by the product. |
| 14 | # PRODUCT_COPY_FILES contains words like <source file>:<dest file>. |
| 15 | # <dest file> is relative to $(PRODUCT_OUT), so it should look like, |
| 16 | # e.g., "system/etc/file.xml". |
Jean-Baptiste Queru | 518ce57 | 2010-03-01 16:18:59 -0800 | [diff] [blame] | 17 | # The filter part means "only eval the copy-one-file rule if this |
Ying Wang | 462d26b | 2010-11-02 21:31:47 -0700 | [diff] [blame] | 18 | # src:dest pair is the first one to match the same dest" |
Ying Wang | 6886410 | 2011-09-29 13:23:25 -0700 | [diff] [blame] | 19 | #$(1): the src:dest pair |
| 20 | define check-product-copy-files |
| 21 | $(if $(filter %.apk, $(1)),$(error \ |
| 22 | Prebuilt apk found in PRODUCT_COPY_FILES: $(1), use BUILD_PREBUILT instead!)) |
| 23 | endef |
Ying Wang | 7e8d442 | 2011-06-17 17:05:35 -0700 | [diff] [blame] | 24 | unique_product_copy_files_destinations := |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 25 | $(foreach cf,$(PRODUCT_COPY_FILES), \ |
Ying Wang | 462d26b | 2010-11-02 21:31:47 -0700 | [diff] [blame] | 26 | $(eval _src := $(call word-colon,1,$(cf))) \ |
| 27 | $(eval _dest := $(call word-colon,2,$(cf))) \ |
Ying Wang | 6886410 | 2011-09-29 13:23:25 -0700 | [diff] [blame] | 28 | $(call check-product-copy-files,$(cf)) \ |
Ying Wang | 7e8d442 | 2011-06-17 17:05:35 -0700 | [diff] [blame] | 29 | $(if $(filter $(unique_product_copy_files_destinations),$(_dest)),, \ |
Ying Wang | 462d26b | 2010-11-02 21:31:47 -0700 | [diff] [blame] | 30 | $(eval _fulldest := $(call append-path,$(PRODUCT_OUT),$(_dest))) \ |
| 31 | $(eval $(call copy-one-file,$(_src),$(_fulldest))) \ |
| 32 | $(eval ALL_DEFAULT_INSTALLED_MODULES += $(_fulldest)) \ |
Ying Wang | 7e8d442 | 2011-06-17 17:05:35 -0700 | [diff] [blame] | 33 | $(eval unique_product_copy_files_destinations += $(_dest)))) |
| 34 | unique_product_copy_files_destinations := |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 35 | |
| 36 | # ----------------------------------------------------------------- |
| 37 | # docs/index.html |
| 38 | gen := $(OUT_DOCS)/index.html |
| 39 | ALL_DOCS += $(gen) |
| 40 | $(gen): frameworks/base/docs/docs-redirect-index.html |
| 41 | @mkdir -p $(dir $@) |
| 42 | @cp -f $< $@ |
| 43 | |
| 44 | # ----------------------------------------------------------------- |
| 45 | # default.prop |
| 46 | INSTALLED_DEFAULT_PROP_TARGET := $(TARGET_ROOT_OUT)/default.prop |
| 47 | ALL_DEFAULT_INSTALLED_MODULES += $(INSTALLED_DEFAULT_PROP_TARGET) |
| 48 | ADDITIONAL_DEFAULT_PROPERTIES := \ |
Ying Wang | 7e8d442 | 2011-06-17 17:05:35 -0700 | [diff] [blame] | 49 | $(call collapse-pairs, $(ADDITIONAL_DEFAULT_PROPERTIES)) |
Mike Lockwood | 0d23fec | 2011-06-09 14:54:40 -0700 | [diff] [blame] | 50 | ADDITIONAL_DEFAULT_PROPERTIES += \ |
Ying Wang | 7e8d442 | 2011-06-17 17:05:35 -0700 | [diff] [blame] | 51 | $(call collapse-pairs, $(PRODUCT_DEFAULT_PROPERTY_OVERRIDES)) |
| 52 | ADDITIONAL_DEFAULT_PROPERTIES := $(call uniq-pairs-by-first-component, \ |
| 53 | $(ADDITIONAL_DEFAULT_PROPERTIES),=) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 54 | |
| 55 | $(INSTALLED_DEFAULT_PROP_TARGET): |
| 56 | @echo Target buildinfo: $@ |
| 57 | @mkdir -p $(dir $@) |
| 58 | $(hide) echo "#" > $@; \ |
| 59 | echo "# ADDITIONAL_DEFAULT_PROPERTIES" >> $@; \ |
| 60 | echo "#" >> $@; |
Jean-Baptiste Queru | 0545c91 | 2010-09-07 10:51:12 -0700 | [diff] [blame] | 61 | $(hide) $(foreach line,$(ADDITIONAL_DEFAULT_PROPERTIES), \ |
| 62 | echo "$(line)" >> $@;) |
Joe Onorato | 9197a48 | 2011-06-08 16:04:14 -0700 | [diff] [blame] | 63 | build/tools/post_process_props.py $@ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 64 | |
| 65 | # ----------------------------------------------------------------- |
| 66 | # build.prop |
| 67 | INSTALLED_BUILD_PROP_TARGET := $(TARGET_OUT)/build.prop |
| 68 | ALL_DEFAULT_INSTALLED_MODULES += $(INSTALLED_BUILD_PROP_TARGET) |
| 69 | ADDITIONAL_BUILD_PROPERTIES := \ |
Ying Wang | 7e8d442 | 2011-06-17 17:05:35 -0700 | [diff] [blame] | 70 | $(call collapse-pairs, $(ADDITIONAL_BUILD_PROPERTIES)) |
| 71 | ADDITIONAL_BUILD_PROPERTIES := $(call uniq-pairs-by-first-component, \ |
| 72 | $(ADDITIONAL_BUILD_PROPERTIES),=) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 73 | |
| 74 | # A list of arbitrary tags describing the build configuration. |
| 75 | # Force ":=" so we can use += |
| 76 | BUILD_VERSION_TAGS := $(BUILD_VERSION_TAGS) |
| 77 | ifeq ($(TARGET_BUILD_TYPE),debug) |
| 78 | BUILD_VERSION_TAGS += debug |
| 79 | endif |
Doug Zongker | 49c6a2b | 2011-10-05 12:41:56 -0700 | [diff] [blame] | 80 | # The "test-keys" tag marks builds signed with the old test keys, |
| 81 | # which are available in the SDK. "dev-keys" marks builds signed with |
| 82 | # non-default dev keys (usually private keys from a vendor directory). |
| 83 | # Both of these tags will be removed and replaced with "release-keys" |
| 84 | # when the target-files is signed in a post-build step. |
| 85 | ifeq ($(DEFAULT_SYSTEM_DEV_CERTIFICATE),build/target/product/security/testkey) |
| 86 | BUILD_VERSION_TAGS += test-keys |
| 87 | else |
Ying Wang | 3c21fe5 | 2011-10-04 10:50:08 -0700 | [diff] [blame] | 88 | BUILD_VERSION_TAGS += dev-keys |
Doug Zongker | 49c6a2b | 2011-10-05 12:41:56 -0700 | [diff] [blame] | 89 | endif |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 90 | BUILD_VERSION_TAGS := $(subst $(space),$(comma),$(sort $(BUILD_VERSION_TAGS))) |
| 91 | |
| 92 | # A human-readable string that descibes this build in detail. |
| 93 | build_desc := $(TARGET_PRODUCT)-$(TARGET_BUILD_VARIANT) $(PLATFORM_VERSION) $(BUILD_ID) $(BUILD_NUMBER) $(BUILD_VERSION_TAGS) |
| 94 | $(INSTALLED_BUILD_PROP_TARGET): PRIVATE_BUILD_DESC := $(build_desc) |
| 95 | |
| 96 | # The string used to uniquely identify this build; used by the OTA server. |
| 97 | ifeq (,$(strip $(BUILD_FINGERPRINT))) |
Doug Zongker | 135a120 | 2010-09-15 13:02:12 -0700 | [diff] [blame] | 98 | BUILD_FINGERPRINT := $(PRODUCT_BRAND)/$(TARGET_PRODUCT)/$(TARGET_DEVICE):$(PLATFORM_VERSION)/$(BUILD_ID)/$(BUILD_NUMBER):$(TARGET_BUILD_VARIANT)/$(BUILD_VERSION_TAGS) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 99 | endif |
| 100 | ifneq ($(words $(BUILD_FINGERPRINT)),1) |
| 101 | $(error BUILD_FINGERPRINT cannot contain spaces: "$(BUILD_FINGERPRINT)") |
| 102 | endif |
| 103 | |
Sriram Raman | 7b64124 | 2009-03-24 22:40:59 -0700 | [diff] [blame] | 104 | # Display parameters shown under Settings -> About Phone |
| 105 | ifeq ($(TARGET_BUILD_VARIANT),user) |
| 106 | # User builds should show: |
| 107 | # release build number or branch.buld_number non-release builds |
| 108 | |
| 109 | # Dev. branches should have DISPLAY_BUILD_NUMBER set |
| 110 | ifeq "true" "$(DISPLAY_BUILD_NUMBER)" |
| 111 | BUILD_DISPLAY_ID := $(BUILD_ID).$(BUILD_NUMBER) |
| 112 | else |
| 113 | BUILD_DISPLAY_ID := $(BUILD_ID) |
| 114 | endif |
| 115 | else |
| 116 | # Non-user builds should show detailed build information |
| 117 | BUILD_DISPLAY_ID := $(build_desc) |
| 118 | endif |
| 119 | |
Ying Wang | 77c882f | 2010-04-27 15:45:35 -0700 | [diff] [blame] | 120 | # Whether there is default locale set in PRODUCT_PROPERTY_OVERRIDES |
Ying Wang | 38d7f02 | 2010-07-21 14:58:42 -0700 | [diff] [blame] | 121 | product_property_override_locale_language := $(strip \ |
| 122 | $(patsubst ro.product.locale.language=%,%,\ |
Ying Wang | 77c882f | 2010-04-27 15:45:35 -0700 | [diff] [blame] | 123 | $(filter ro.product.locale.language=%,$(PRODUCT_PROPERTY_OVERRIDES)))) |
Ying Wang | 38d7f02 | 2010-07-21 14:58:42 -0700 | [diff] [blame] | 124 | product_property_overrides_locale_region := $(strip \ |
| 125 | $(patsubst ro.product.locale.region=%,%,\ |
Ying Wang | 77c882f | 2010-04-27 15:45:35 -0700 | [diff] [blame] | 126 | $(filter ro.product.locale.region=%,$(PRODUCT_PROPERTY_OVERRIDES)))) |
| 127 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 128 | # Selects the first locale in the list given as the argument, |
| 129 | # and splits it into language and region, which each may be |
| 130 | # empty. |
| 131 | define default-locale |
| 132 | $(subst _, , $(firstword $(1))) |
| 133 | endef |
| 134 | |
| 135 | # Selects the first locale in the list given as the argument |
Ying Wang | 77c882f | 2010-04-27 15:45:35 -0700 | [diff] [blame] | 136 | # and returns the language (or the region), if it's not set in PRODUCT_PROPERTY_OVERRIDES; |
| 137 | # Return empty string if it's already set in PRODUCT_PROPERTY_OVERRIDES. |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 138 | define default-locale-language |
Ying Wang | 38d7f02 | 2010-07-21 14:58:42 -0700 | [diff] [blame] | 139 | $(if $(product_property_override_locale_language),,$(word 1, $(call default-locale, $(1)))) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 140 | endef |
| 141 | define default-locale-region |
Ying Wang | 38d7f02 | 2010-07-21 14:58:42 -0700 | [diff] [blame] | 142 | $(if $(product_property_overrides_locale_region),,$(word 2, $(call default-locale, $(1)))) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 143 | endef |
| 144 | |
| 145 | BUILDINFO_SH := build/tools/buildinfo.sh |
Chih-Wei Huang | 75947ef | 2010-11-03 18:33:46 +0800 | [diff] [blame] | 146 | $(INSTALLED_BUILD_PROP_TARGET): $(BUILDINFO_SH) $(INTERNAL_BUILD_ID_MAKEFILE) $(BUILD_SYSTEM)/version_defaults.mk $(wildcard $(TARGET_DEVICE_DIR)/system.prop) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 147 | @echo Target buildinfo: $@ |
| 148 | @mkdir -p $(dir $@) |
| 149 | $(hide) TARGET_BUILD_TYPE="$(TARGET_BUILD_VARIANT)" \ |
| 150 | TARGET_DEVICE="$(TARGET_DEVICE)" \ |
| 151 | PRODUCT_NAME="$(TARGET_PRODUCT)" \ |
| 152 | PRODUCT_BRAND="$(PRODUCT_BRAND)" \ |
| 153 | PRODUCT_DEFAULT_LANGUAGE="$(call default-locale-language,$(PRODUCT_LOCALES))" \ |
| 154 | PRODUCT_DEFAULT_REGION="$(call default-locale-region,$(PRODUCT_LOCALES))" \ |
Robert Greenwalt | fbd10d9 | 2009-05-20 13:37:35 -0700 | [diff] [blame] | 155 | PRODUCT_DEFAULT_WIFI_CHANNELS="$(PRODUCT_DEFAULT_WIFI_CHANNELS)" \ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 156 | PRODUCT_MODEL="$(PRODUCT_MODEL)" \ |
| 157 | PRODUCT_MANUFACTURER="$(PRODUCT_MANUFACTURER)" \ |
| 158 | PRIVATE_BUILD_DESC="$(PRIVATE_BUILD_DESC)" \ |
| 159 | BUILD_ID="$(BUILD_ID)" \ |
| 160 | BUILD_DISPLAY_ID="$(BUILD_DISPLAY_ID)" \ |
| 161 | BUILD_NUMBER="$(BUILD_NUMBER)" \ |
| 162 | PLATFORM_VERSION="$(PLATFORM_VERSION)" \ |
| 163 | PLATFORM_SDK_VERSION="$(PLATFORM_SDK_VERSION)" \ |
Dianne Hackborn | 9537884 | 2009-05-08 12:06:17 -0700 | [diff] [blame] | 164 | PLATFORM_VERSION_CODENAME="$(PLATFORM_VERSION_CODENAME)" \ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 165 | BUILD_VERSION_TAGS="$(BUILD_VERSION_TAGS)" \ |
| 166 | TARGET_BOOTLOADER_BOARD_NAME="$(TARGET_BOOTLOADER_BOARD_NAME)" \ |
| 167 | BUILD_FINGERPRINT="$(BUILD_FINGERPRINT)" \ |
| 168 | TARGET_BOARD_PLATFORM="$(TARGET_BOARD_PLATFORM)" \ |
Dianne Hackborn | ecc70d7 | 2009-05-21 15:45:30 -0700 | [diff] [blame] | 169 | TARGET_CPU_ABI="$(TARGET_CPU_ABI)" \ |
David 'Digit' Turner | 2edfb71 | 2009-11-06 15:12:00 -0800 | [diff] [blame] | 170 | TARGET_CPU_ABI2="$(TARGET_CPU_ABI2)" \ |
Joe Onorato | 25939e2 | 2010-11-09 08:53:01 -0800 | [diff] [blame] | 171 | TARGET_AAPT_CHARACTERISTICS="$(TARGET_AAPT_CHARACTERISTICS)" \ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 172 | bash $(BUILDINFO_SH) > $@ |
| 173 | $(hide) if [ -f $(TARGET_DEVICE_DIR)/system.prop ]; then \ |
| 174 | cat $(TARGET_DEVICE_DIR)/system.prop >> $@; \ |
| 175 | fi |
| 176 | $(if $(ADDITIONAL_BUILD_PROPERTIES), \ |
| 177 | $(hide) echo >> $@; \ |
| 178 | echo "#" >> $@; \ |
| 179 | echo "# ADDITIONAL_BUILD_PROPERTIES" >> $@; \ |
| 180 | echo "#" >> $@; ) |
Jean-Baptiste Queru | 0545c91 | 2010-09-07 10:51:12 -0700 | [diff] [blame] | 181 | $(hide) $(foreach line,$(ADDITIONAL_BUILD_PROPERTIES), \ |
| 182 | echo "$(line)" >> $@;) |
Joe Onorato | 9197a48 | 2011-06-08 16:04:14 -0700 | [diff] [blame] | 183 | $(hide) build/tools/post_process_props.py $@ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 184 | |
| 185 | build_desc := |
| 186 | |
| 187 | # ----------------------------------------------------------------- |
| 188 | # sdk-build.prop |
| 189 | # |
| 190 | # There are certain things in build.prop that we don't want to |
| 191 | # ship with the sdk; remove them. |
| 192 | |
| 193 | # This must be a list of entire property keys followed by |
| 194 | # "=" characters, without any internal spaces. |
| 195 | sdk_build_prop_remove := \ |
| 196 | ro.build.user= \ |
| 197 | ro.build.host= \ |
| 198 | ro.product.brand= \ |
| 199 | ro.product.manufacturer= \ |
| 200 | ro.product.device= |
| 201 | # TODO: Remove this soon-to-be obsolete property |
| 202 | sdk_build_prop_remove += ro.build.product= |
| 203 | INSTALLED_SDK_BUILD_PROP_TARGET := $(PRODUCT_OUT)/sdk/sdk-build.prop |
| 204 | $(INSTALLED_SDK_BUILD_PROP_TARGET): $(INSTALLED_BUILD_PROP_TARGET) |
| 205 | @echo SDK buildinfo: $@ |
| 206 | @mkdir -p $(dir $@) |
| 207 | $(hide) grep -v "$(subst $(space),\|,$(strip \ |
| 208 | $(sdk_build_prop_remove)))" $< > $@.tmp |
| 209 | $(hide) for x in $(sdk_build_prop_remove); do \ |
| 210 | echo "$$x"generic >> $@.tmp; done |
| 211 | $(hide) mv $@.tmp $@ |
| 212 | |
| 213 | # ----------------------------------------------------------------- |
| 214 | # package stats |
| 215 | PACKAGE_STATS_FILE := $(PRODUCT_OUT)/package-stats.txt |
| 216 | PACKAGES_TO_STAT := \ |
| 217 | $(sort $(filter $(TARGET_OUT)/% $(TARGET_OUT_DATA)/%, \ |
| 218 | $(filter %.jar %.apk, $(ALL_DEFAULT_INSTALLED_MODULES)))) |
| 219 | $(PACKAGE_STATS_FILE): $(PACKAGES_TO_STAT) |
| 220 | @echo Package stats: $@ |
| 221 | @mkdir -p $(dir $@) |
| 222 | $(hide) rm -f $@ |
| 223 | $(hide) build/tools/dump-package-stats $^ > $@ |
| 224 | |
| 225 | .PHONY: package-stats |
| 226 | package-stats: $(PACKAGE_STATS_FILE) |
| 227 | |
| 228 | # ----------------------------------------------------------------- |
| 229 | # Cert-to-package mapping. Used by the post-build signing tools. |
| 230 | name := $(TARGET_PRODUCT) |
| 231 | ifeq ($(TARGET_BUILD_TYPE),debug) |
| 232 | name := $(name)_debug |
| 233 | endif |
| 234 | name := $(name)-apkcerts-$(FILE_NAME_TAG) |
| 235 | intermediates := \ |
| 236 | $(call intermediates-dir-for,PACKAGING,apkcerts) |
| 237 | APKCERTS_FILE := $(intermediates)/$(name).txt |
Ying Wang | 15e487a | 2011-02-15 10:56:18 -0800 | [diff] [blame] | 238 | # We don't need to really build all the modules. |
| 239 | # TODO: rebuild APKCERTS_FILE if any app change its cert. |
Ying Wang | efb2168 | 2010-07-23 16:42:13 -0700 | [diff] [blame] | 240 | $(APKCERTS_FILE): |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 241 | @echo APK certs list: $@ |
| 242 | @mkdir -p $(dir $@) |
| 243 | @rm -f $@ |
| 244 | $(hide) $(foreach p,$(PACKAGES),\ |
Doug Zongker | f6a53aa | 2009-12-15 15:06:55 -0800 | [diff] [blame] | 245 | $(if $(PACKAGES.$(p).EXTERNAL_KEY),\ |
| 246 | echo 'name="$(p).apk" certificate="EXTERNAL" \ |
| 247 | private_key=""' >> $@;,\ |
| 248 | echo 'name="$(p).apk" certificate="$(PACKAGES.$(p).CERTIFICATE)" \ |
| 249 | private_key="$(PACKAGES.$(p).PRIVATE_KEY)"' >> $@;)) |
Ying Wang | f272cd6 | 2011-09-26 12:05:06 -0700 | [diff] [blame] | 250 | # In case $(PACKAGES) is empty. |
| 251 | $(hide) touch $@ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 252 | |
| 253 | .PHONY: apkcerts-list |
| 254 | apkcerts-list: $(APKCERTS_FILE) |
| 255 | |
Ying Wang | 15e487a | 2011-02-15 10:56:18 -0800 | [diff] [blame] | 256 | ifneq (,$(TARGET_BUILD_APPS)) |
| 257 | $(call dist-for-goals, apps_only, $(APKCERTS_FILE):apkcerts.txt) |
| 258 | endif |
Ying Wang | efb2168 | 2010-07-23 16:42:13 -0700 | [diff] [blame] | 259 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 260 | # ----------------------------------------------------------------- |
| 261 | # module info file |
| 262 | ifdef CREATE_MODULE_INFO_FILE |
| 263 | MODULE_INFO_FILE := $(PRODUCT_OUT)/module-info.txt |
| 264 | $(info Generating $(MODULE_INFO_FILE)...) |
| 265 | $(shell rm -f $(MODULE_INFO_FILE)) |
| 266 | $(foreach m,$(ALL_MODULES), \ |
| 267 | $(shell echo "NAME=\"$(m)\"" \ |
| 268 | "PATH=\"$(strip $(ALL_MODULES.$(m).PATH))\"" \ |
| 269 | "TAGS=\"$(strip $(filter-out _%,$(ALL_MODULES.$(m).TAGS)))\"" \ |
| 270 | "BUILT=\"$(strip $(ALL_MODULES.$(m).BUILT))\"" \ |
| 271 | "INSTALLED=\"$(strip $(ALL_MODULES.$(m).INSTALLED))\"" >> $(MODULE_INFO_FILE))) |
| 272 | endif |
| 273 | |
Doug Zongker | 8678df4 | 2009-06-15 14:30:14 -0700 | [diff] [blame] | 274 | # ----------------------------------------------------------------- |
| 275 | |
Ying Wang | 3c21fe5 | 2011-10-04 10:50:08 -0700 | [diff] [blame] | 276 | # The dev key is used to sign this package, and as the key required |
Doug Zongker | 8678df4 | 2009-06-15 14:30:14 -0700 | [diff] [blame] | 277 | # for future OTA packages installed by this system. Actual product |
| 278 | # deliverables will be re-signed by hand. We expect this file to |
| 279 | # exist with the suffixes ".x509.pem" and ".pk8". |
Ying Wang | 3c21fe5 | 2011-10-04 10:50:08 -0700 | [diff] [blame] | 280 | DEFAULT_KEY_CERT_PAIR := $(DEFAULT_SYSTEM_DEV_CERTIFICATE) |
Doug Zongker | 8678df4 | 2009-06-15 14:30:14 -0700 | [diff] [blame] | 281 | |
| 282 | |
Jeff Brown | e33ba4c | 2011-07-11 22:11:46 -0700 | [diff] [blame] | 283 | # Rules that need to be present for the all targets, even |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 284 | # if they don't do anything. |
| 285 | .PHONY: systemimage |
| 286 | systemimage: |
| 287 | |
Doug Zongker | 7e2f13b | 2010-02-16 16:01:43 -0800 | [diff] [blame] | 288 | # ----------------------------------------------------------------- |
| 289 | |
| 290 | .PHONY: event-log-tags |
| 291 | |
Joe Onorato | b751053 | 2010-07-14 10:22:54 -0700 | [diff] [blame] | 292 | # Produce an event logs tag file for everything we know about, in order |
| 293 | # to properly allocate numbers. Then produce a file that's filtered |
| 294 | # for what's going to be installed. |
| 295 | |
| 296 | all_event_log_tags_file := $(TARGET_OUT_COMMON_INTERMEDIATES)/all-event-log-tags.txt |
| 297 | |
| 298 | # Include tags from all packages that we know about |
| 299 | all_event_log_tags_src := \ |
| 300 | $(sort $(foreach m, $(ALL_MODULES), $(ALL_MODULES.$(m).EVENT_LOG_TAGS))) |
| 301 | |
| 302 | $(all_event_log_tags_file): PRIVATE_SRC_FILES := $(all_event_log_tags_src) |
| 303 | $(all_event_log_tags_file): $(all_event_log_tags_src) |
| 304 | $(hide) mkdir -p $(dir $@) |
| 305 | $(hide) build/tools/merge-event-log-tags.py -o $@ $(PRIVATE_SRC_FILES) |
| 306 | |
| 307 | |
Doug Zongker | 7e2f13b | 2010-02-16 16:01:43 -0800 | [diff] [blame] | 308 | event_log_tags_file := $(TARGET_OUT)/etc/event-log-tags |
Doug Zongker | 7e2f13b | 2010-02-16 16:01:43 -0800 | [diff] [blame] | 309 | |
Doug Zongker | a34fa95 | 2011-02-23 12:17:29 -0800 | [diff] [blame] | 310 | # Include tags from all packages included in this product, plus all |
| 311 | # tags that are part of the system (ie, not in a vendor/ or device/ |
| 312 | # directory). |
Doug Zongker | 7e2f13b | 2010-02-16 16:01:43 -0800 | [diff] [blame] | 313 | event_log_tags_src := \ |
| 314 | $(sort $(foreach m,\ |
| 315 | $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES) \ |
| 316 | $(call module-names-for-tag-list,user), \ |
Doug Zongker | a34fa95 | 2011-02-23 12:17:29 -0800 | [diff] [blame] | 317 | $(ALL_MODULES.$(m).EVENT_LOG_TAGS)) \ |
| 318 | $(filter-out vendor/% device/% out/%,$(all_event_log_tags_src))) |
Doug Zongker | 7e2f13b | 2010-02-16 16:01:43 -0800 | [diff] [blame] | 319 | |
| 320 | $(event_log_tags_file): PRIVATE_SRC_FILES := $(event_log_tags_src) |
Joe Onorato | b751053 | 2010-07-14 10:22:54 -0700 | [diff] [blame] | 321 | $(event_log_tags_file): PRIVATE_MERGED_FILE := $(all_event_log_tags_file) |
| 322 | $(event_log_tags_file): $(event_log_tags_src) $(all_event_log_tags_file) |
Doug Zongker | 7e2f13b | 2010-02-16 16:01:43 -0800 | [diff] [blame] | 323 | $(hide) mkdir -p $(dir $@) |
Joe Onorato | b751053 | 2010-07-14 10:22:54 -0700 | [diff] [blame] | 324 | $(hide) build/tools/merge-event-log-tags.py -o $@ -m $(PRIVATE_MERGED_FILE) $(PRIVATE_SRC_FILES) |
Doug Zongker | 7e2f13b | 2010-02-16 16:01:43 -0800 | [diff] [blame] | 325 | |
| 326 | event-log-tags: $(event_log_tags_file) |
| 327 | |
| 328 | ALL_DEFAULT_INSTALLED_MODULES += $(event_log_tags_file) |
| 329 | |
Joe Onorato | b751053 | 2010-07-14 10:22:54 -0700 | [diff] [blame] | 330 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 331 | # ################################################################# |
| 332 | # Targets for boot/OS images |
| 333 | # ################################################################# |
| 334 | |
| 335 | # ----------------------------------------------------------------- |
| 336 | # the ramdisk |
| 337 | INTERNAL_RAMDISK_FILES := $(filter $(TARGET_ROOT_OUT)/%, \ |
| 338 | $(ALL_PREBUILT) \ |
| 339 | $(ALL_COPIED_HEADERS) \ |
| 340 | $(ALL_GENERATED_SOURCES) \ |
| 341 | $(ALL_DEFAULT_INSTALLED_MODULES)) |
| 342 | |
Joe Onorato | 64d85d0 | 2009-04-09 19:31:12 -0700 | [diff] [blame] | 343 | BUILT_RAMDISK_TARGET := $(PRODUCT_OUT)/ramdisk.img |
| 344 | |
| 345 | # We just build this directly to the install location. |
| 346 | INSTALLED_RAMDISK_TARGET := $(BUILT_RAMDISK_TARGET) |
Doug Zongker | 8b70e8c | 2009-05-27 09:14:25 -0700 | [diff] [blame] | 347 | $(INSTALLED_RAMDISK_TARGET): $(MKBOOTFS) $(INTERNAL_RAMDISK_FILES) | $(MINIGZIP) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 348 | $(call pretty,"Target ram disk: $@") |
Doug Zongker | 8b70e8c | 2009-05-27 09:14:25 -0700 | [diff] [blame] | 349 | $(hide) $(MKBOOTFS) $(TARGET_ROOT_OUT) | $(MINIGZIP) > $@ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 350 | |
| 351 | |
| 352 | ifneq ($(strip $(TARGET_NO_KERNEL)),true) |
| 353 | |
| 354 | # ----------------------------------------------------------------- |
| 355 | # the boot image, which is a collection of other images. |
| 356 | INTERNAL_BOOTIMAGE_ARGS := \ |
| 357 | $(addprefix --second ,$(INSTALLED_2NDBOOTLOADER_TARGET)) \ |
| 358 | --kernel $(INSTALLED_KERNEL_TARGET) \ |
| 359 | --ramdisk $(INSTALLED_RAMDISK_TARGET) |
| 360 | |
| 361 | INTERNAL_BOOTIMAGE_FILES := $(filter-out --%,$(INTERNAL_BOOTIMAGE_ARGS)) |
| 362 | |
| 363 | BOARD_KERNEL_CMDLINE := $(strip $(BOARD_KERNEL_CMDLINE)) |
| 364 | ifdef BOARD_KERNEL_CMDLINE |
| 365 | INTERNAL_BOOTIMAGE_ARGS += --cmdline "$(BOARD_KERNEL_CMDLINE)" |
| 366 | endif |
| 367 | |
Dima Zavin | 1e0847c | 2009-05-07 19:43:08 -0700 | [diff] [blame] | 368 | BOARD_KERNEL_BASE := $(strip $(BOARD_KERNEL_BASE)) |
| 369 | ifdef BOARD_KERNEL_BASE |
| 370 | INTERNAL_BOOTIMAGE_ARGS += --base $(BOARD_KERNEL_BASE) |
| 371 | endif |
| 372 | |
Ying Wang | ffff002 | 2010-08-23 12:56:25 -0700 | [diff] [blame] | 373 | BOARD_KERNEL_PAGESIZE := $(strip $(BOARD_KERNEL_PAGESIZE)) |
| 374 | ifdef BOARD_KERNEL_PAGESIZE |
| 375 | INTERNAL_BOOTIMAGE_ARGS += --pagesize $(BOARD_KERNEL_PAGESIZE) |
| 376 | endif |
| 377 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 378 | INSTALLED_BOOTIMAGE_TARGET := $(PRODUCT_OUT)/boot.img |
| 379 | |
| 380 | ifeq ($(TARGET_BOOTIMAGE_USE_EXT2),true) |
| 381 | tmp_dir_for_image := $(call intermediates-dir-for,EXECUTABLES,boot_img)/bootimg |
| 382 | INTERNAL_BOOTIMAGE_ARGS += --tmpdir $(tmp_dir_for_image) |
| 383 | INTERNAL_BOOTIMAGE_ARGS += --genext2fs $(MKEXT2IMG) |
| 384 | $(INSTALLED_BOOTIMAGE_TARGET): $(MKEXT2IMG) $(INTERNAL_BOOTIMAGE_FILES) |
| 385 | $(call pretty,"Target boot image: $@") |
| 386 | $(hide) $(MKEXT2BOOTIMG) $(INTERNAL_BOOTIMAGE_ARGS) --output $@ |
| 387 | |
| 388 | else # TARGET_BOOTIMAGE_USE_EXT2 != true |
| 389 | |
| 390 | $(INSTALLED_BOOTIMAGE_TARGET): $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_FILES) |
| 391 | $(call pretty,"Target boot image: $@") |
| 392 | $(hide) $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_ARGS) --output $@ |
Doug Zongker | ed96e88 | 2009-08-26 09:37:07 -0700 | [diff] [blame] | 393 | $(hide) $(call assert-max-image-size,$@,$(BOARD_BOOTIMAGE_PARTITION_SIZE),raw) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 394 | endif # TARGET_BOOTIMAGE_USE_EXT2 |
| 395 | |
| 396 | else # TARGET_NO_KERNEL |
| 397 | # HACK: The top-level targets depend on the bootimage. Not all targets |
| 398 | # can produce a bootimage, though, and emulator targets need the ramdisk |
| 399 | # instead. Fake it out by calling the ramdisk the bootimage. |
| 400 | # TODO: make the emulator use bootimages, and make mkbootimg accept |
| 401 | # kernel-less inputs. |
| 402 | INSTALLED_BOOTIMAGE_TARGET := $(INSTALLED_RAMDISK_TARGET) |
| 403 | endif |
| 404 | |
| 405 | # ----------------------------------------------------------------- |
| 406 | # NOTICE files |
| 407 | # |
| 408 | # This needs to be before the systemimage rules, because it adds to |
| 409 | # ALL_DEFAULT_INSTALLED_MODULES, which those use to pick which files |
| 410 | # go into the systemimage. |
| 411 | |
| 412 | .PHONY: notice_files |
| 413 | |
| 414 | # Create the rule to combine the files into text and html forms |
| 415 | # $(1) - Plain text output file |
| 416 | # $(2) - HTML output file |
| 417 | # $(3) - File title |
| 418 | # $(4) - Directory to use. Notice files are all $(4)/src. Other |
| 419 | # directories in there will be used for scratch |
| 420 | # $(5) - Dependencies for the output files |
| 421 | # |
| 422 | # The algorithm here is that we go collect a hash for each of the notice |
| 423 | # files and write the names of the files that match that hash. Then |
| 424 | # to generate the real files, we go print out all of the files and their |
| 425 | # hashes. |
| 426 | # |
| 427 | # These rules are fairly complex, so they depend on this makefile so if |
| 428 | # it changes, they'll run again. |
| 429 | # |
| 430 | # TODO: We could clean this up so that we just record the locations of the |
| 431 | # original notice files instead of making rules to copy them somwehere. |
| 432 | # Then we could traverse that without quite as much bash drama. |
| 433 | define combine-notice-files |
| 434 | $(1) $(2): PRIVATE_MESSAGE := $(3) |
| 435 | $(1) $(2) $(4)/hash-timestamp: PRIVATE_DIR := $(4) |
| 436 | $(4)/hash-timestamp: $(5) $(BUILD_SYSTEM)/Makefile |
| 437 | @echo Finding NOTICE files: $$@ |
| 438 | $$(hide) rm -rf $$@ $$(PRIVATE_DIR)/hash |
| 439 | $$(hide) mkdir -p $$(PRIVATE_DIR)/hash |
| 440 | $$(hide) for file in $$$$(find $$(PRIVATE_DIR)/src -type f); do \ |
| 441 | hash=$$$$($(MD5SUM) $$$$file | sed -e "s/ .*//"); \ |
| 442 | hashfile=$$(PRIVATE_DIR)/hash/$$$$hash; \ |
| 443 | echo $$$$file >> $$$$hashfile; \ |
| 444 | done |
| 445 | $$(hide) touch $$@ |
| 446 | $(1): $(4)/hash-timestamp |
| 447 | @echo Combining NOTICE files: $$@ |
| 448 | $$(hide) mkdir -p $$(dir $$@) |
| 449 | $$(hide) echo $$(PRIVATE_MESSAGE) > $$@ |
| 450 | $$(hide) find $$(PRIVATE_DIR)/hash -type f | xargs cat | sort | \ |
| 451 | sed -e "s:$$(PRIVATE_DIR)/src\(.*\)\.txt: \1:" >> $$@ |
| 452 | $$(hide) echo >> $$@ |
| 453 | $$(hide) echo >> $$@ |
| 454 | $$(hide) echo >> $$@ |
| 455 | $$(hide) for hashfile in $$$$(find $$(PRIVATE_DIR)/hash -type f); do \ |
| 456 | echo "============================================================"\ |
| 457 | >> $$@; \ |
| 458 | echo "Notices for file(s):" >> $$@; \ |
| 459 | cat $$$$hashfile | sort | \ |
| 460 | sed -e "s:$$(PRIVATE_DIR)/src\(.*\)\.txt: \1:" >> \ |
| 461 | $$@; \ |
| 462 | echo "------------------------------------------------------------"\ |
| 463 | >> $$@; \ |
| 464 | echo >> $$@; \ |
| 465 | orig=$$$$(head -n 1 $$$$hashfile); \ |
| 466 | cat $$$$orig >> $$@; \ |
| 467 | echo >> $$@; \ |
| 468 | echo >> $$@; \ |
| 469 | echo >> $$@; \ |
| 470 | done |
| 471 | $(2): $(4)/hash-timestamp |
| 472 | @echo Combining NOTICE files: $$@ |
| 473 | $$(hide) mkdir -p $$(dir $$@) |
| 474 | $$(hide) echo "<html><head>" > $$@ |
| 475 | $$(hide) echo "<style type=\"text/css\">" >> $$@ |
| 476 | $$(hide) echo "body { padding: 0; font-family: sans-serif; }" >> $$@ |
| 477 | $$(hide) echo ".same-license { background-color: #eeeeee; border-top: 20px solid white; padding: 10px; }" >> $$@ |
| 478 | $$(hide) echo ".label { font-weight: bold; }" >> $$@ |
| 479 | $$(hide) echo ".file-list { margin-left: 1em; font-color: blue; }" >> $$@ |
| 480 | $$(hide) echo "</style>" >> $$@ |
| 481 | $$(hide) echo "</head><body topmargin=\"0\" leftmargin=\"0\" rightmargin=\"0\" bottommargin=\"0\">" >> $$@ |
| 482 | $$(hide) echo "<table cellpading=\"0\" cellspacing=\"0\" border=\"0\">" \ |
| 483 | >> $$@ |
| 484 | $$(hide) for hashfile in $$$$(find $$(PRIVATE_DIR)/hash -type f); do \ |
| 485 | cat $$$$hashfile | sort | \ |
| 486 | sed -e "s:$$(PRIVATE_DIR)/src\(.*\)\.txt: <a name=\"\1\"></a>:" >> \ |
| 487 | $$@; \ |
| 488 | echo "<tr><td class=\"same-license\">" >> $$@; \ |
| 489 | echo "<div class=\"label\">Notices for file(s):</div>" >> $$@; \ |
| 490 | echo "<div class=\"file-list\">" >> $$@; \ |
| 491 | cat $$$$hashfile | sort | \ |
| 492 | sed -e "s:$$(PRIVATE_DIR)/src\(.*\)\.txt: \1<br/>:" >> $$@; \ |
| 493 | echo "</div><!-- file-list -->" >> $$@; \ |
| 494 | echo >> $$@; \ |
| 495 | orig=$$$$(head -n 1 $$$$hashfile); \ |
| 496 | echo "<pre class=\"license-text\">" >> $$@; \ |
| 497 | cat $$$$orig | sed -e "s/\&/\&/g" | sed -e "s/</\</g" \ |
| 498 | | sed -e "s/>/\>/g" >> $$@; \ |
| 499 | echo "</pre><!-- license-text -->" >> $$@; \ |
| 500 | echo "</td></tr><!-- same-license -->" >> $$@; \ |
| 501 | echo >> $$@; \ |
| 502 | echo >> $$@; \ |
| 503 | echo >> $$@; \ |
| 504 | done |
| 505 | $$(hide) echo "</table>" >> $$@ |
| 506 | $$(hide) echo "</body></html>" >> $$@ |
| 507 | notice_files: $(1) $(2) |
| 508 | endef |
| 509 | |
| 510 | # TODO These intermediate NOTICE.txt/NOTICE.html files should go into |
| 511 | # TARGET_OUT_NOTICE_FILES now that the notice files are gathered from |
| 512 | # the src subdirectory. |
| 513 | |
| 514 | target_notice_file_txt := $(TARGET_OUT_INTERMEDIATES)/NOTICE.txt |
| 515 | target_notice_file_html := $(TARGET_OUT_INTERMEDIATES)/NOTICE.html |
| 516 | target_notice_file_html_gz := $(TARGET_OUT_INTERMEDIATES)/NOTICE.html.gz |
| 517 | tools_notice_file_txt := $(HOST_OUT_INTERMEDIATES)/NOTICE.txt |
| 518 | tools_notice_file_html := $(HOST_OUT_INTERMEDIATES)/NOTICE.html |
| 519 | |
| 520 | kernel_notice_file := $(TARGET_OUT_NOTICE_FILES)/src/kernel.txt |
| 521 | |
| 522 | $(eval $(call combine-notice-files, \ |
| 523 | $(target_notice_file_txt), \ |
| 524 | $(target_notice_file_html), \ |
| 525 | "Notices for files contained in the filesystem images in this directory:", \ |
| 526 | $(TARGET_OUT_NOTICE_FILES), \ |
| 527 | $(ALL_DEFAULT_INSTALLED_MODULES) $(kernel_notice_file))) |
| 528 | |
| 529 | $(eval $(call combine-notice-files, \ |
| 530 | $(tools_notice_file_txt), \ |
| 531 | $(tools_notice_file_html), \ |
| 532 | "Notices for files contained in the tools directory:", \ |
| 533 | $(HOST_OUT_NOTICE_FILES), \ |
| 534 | $(ALL_DEFAULT_INSTALLED_MODULES))) |
| 535 | |
| 536 | # Install the html file at /system/etc/NOTICE.html.gz. |
| 537 | # This is not ideal, but this is very late in the game, after a lot of |
| 538 | # the module processing has already been done -- in fact, we used the |
| 539 | # fact that all that has been done to get the list of modules that we |
| 540 | # need notice files for. |
Doug Zongker | 8b70e8c | 2009-05-27 09:14:25 -0700 | [diff] [blame] | 541 | $(target_notice_file_html_gz): $(target_notice_file_html) | $(MINIGZIP) |
Doug Zongker | 8678df4 | 2009-06-15 14:30:14 -0700 | [diff] [blame] | 542 | $(hide) $(MINIGZIP) -9 < $< > $@ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 543 | installed_notice_html_gz := $(TARGET_OUT)/etc/NOTICE.html.gz |
| 544 | $(installed_notice_html_gz): $(target_notice_file_html_gz) | $(ACP) |
| 545 | $(copy-file-to-target) |
Joe Onorato | 7b2845a | 2009-04-30 13:52:50 -0700 | [diff] [blame] | 546 | |
| 547 | # if we've been run my mm, mmm, etc, don't reinstall this every time |
| 548 | ifeq ($(ONE_SHOT_MAKEFILE),) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 549 | ALL_DEFAULT_INSTALLED_MODULES += $(installed_notice_html_gz) |
Joe Onorato | 7b2845a | 2009-04-30 13:52:50 -0700 | [diff] [blame] | 550 | endif |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 551 | |
| 552 | # The kernel isn't really a module, so to get its module file in there, we |
| 553 | # make the target NOTICE files depend on this particular file too, which will |
| 554 | # then be in the right directory for the find in combine-notice-files to work. |
| 555 | $(kernel_notice_file): \ |
| 556 | prebuilt/$(TARGET_PREBUILT_TAG)/kernel/LINUX_KERNEL_COPYING \ |
| 557 | | $(ACP) |
| 558 | @echo Copying: $@ |
| 559 | $(hide) mkdir -p $(dir $@) |
| 560 | $(hide) $(ACP) $< $@ |
| 561 | |
| 562 | |
Doug Zongker | 8678df4 | 2009-06-15 14:30:14 -0700 | [diff] [blame] | 563 | # ----------------------------------------------------------------- |
| 564 | # Build a keystore with the authorized keys in it, used to verify the |
| 565 | # authenticity of downloaded OTA packages. |
| 566 | # |
| 567 | # This rule adds to ALL_DEFAULT_INSTALLED_MODULES, so it needs to come |
| 568 | # before the rules that use that variable to build the image. |
| 569 | ALL_DEFAULT_INSTALLED_MODULES += $(TARGET_OUT_ETC)/security/otacerts.zip |
| 570 | $(TARGET_OUT_ETC)/security/otacerts.zip: KEY_CERT_PAIR := $(DEFAULT_KEY_CERT_PAIR) |
Doug Zongker | 37c0e27 | 2009-06-15 15:36:16 -0700 | [diff] [blame] | 571 | $(TARGET_OUT_ETC)/security/otacerts.zip: $(addsuffix .x509.pem,$(DEFAULT_KEY_CERT_PAIR)) |
Doug Zongker | 8678df4 | 2009-06-15 14:30:14 -0700 | [diff] [blame] | 572 | $(hide) rm -f $@ |
| 573 | $(hide) mkdir -p $(dir $@) |
Doug Zongker | 37c0e27 | 2009-06-15 15:36:16 -0700 | [diff] [blame] | 574 | $(hide) zip -qj $@ $< |
Doug Zongker | 8678df4 | 2009-06-15 14:30:14 -0700 | [diff] [blame] | 575 | |
| 576 | .PHONY: otacerts |
| 577 | otacerts: $(TARGET_OUT_ETC)/security/otacerts.zip |
| 578 | |
| 579 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 580 | # ################################################################# |
| 581 | # Targets for user images |
| 582 | # ################################################################# |
| 583 | |
Ying Wang | 933abf1 | 2010-06-16 14:31:34 -0700 | [diff] [blame] | 584 | INTERNAL_USERIMAGES_EXT_VARIANT := |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 585 | ifeq ($(TARGET_USERIMAGES_USE_EXT2),true) |
Colin Cross | 0a7b2c5 | 2010-05-07 02:23:59 -0700 | [diff] [blame] | 586 | INTERNAL_USERIMAGES_USE_EXT := true |
| 587 | INTERNAL_USERIMAGES_EXT_VARIANT := ext2 |
| 588 | else |
| 589 | ifeq ($(TARGET_USERIMAGES_USE_EXT3),true) |
| 590 | INTERNAL_USERIMAGES_USE_EXT := true |
| 591 | INTERNAL_USERIMAGES_EXT_VARIANT := ext3 |
| 592 | else |
| 593 | ifeq ($(TARGET_USERIMAGES_USE_EXT4),true) |
| 594 | INTERNAL_USERIMAGES_USE_EXT := true |
| 595 | INTERNAL_USERIMAGES_EXT_VARIANT := ext4 |
| 596 | endif |
| 597 | endif |
| 598 | endif |
| 599 | |
Ying Wang | 542903a | 2010-11-17 15:40:38 -0800 | [diff] [blame] | 600 | ifneq (true,$(TARGET_USERIMAGES_SPARSE_EXT_DISABLED)) |
| 601 | INTERNAL_USERIMAGES_SPARSE_EXT_FLAG := -s |
| 602 | endif |
| 603 | |
Colin Cross | 0a7b2c5 | 2010-05-07 02:23:59 -0700 | [diff] [blame] | 604 | ifeq ($(INTERNAL_USERIMAGES_USE_EXT),true) |
Ying Wang | 542903a | 2010-11-17 15:40:38 -0800 | [diff] [blame] | 605 | INTERNAL_USERIMAGES_DEPS := $(MKEXTUSERIMG) $(MAKE_EXT4FS) |
Ying Wang | 933abf1 | 2010-06-16 14:31:34 -0700 | [diff] [blame] | 606 | INTERNAL_USERIMAGES_BINARY_PATHS := $(sort $(dir $(INTERNAL_USERIMAGES_DEPS))) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 607 | else |
Colin Cross | 144b028 | 2010-05-10 13:04:47 -0700 | [diff] [blame] | 608 | INTERNAL_USERIMAGES_DEPS := $(MKYAFFS2) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 609 | endif |
| 610 | |
Ying Wang | bd93d42 | 2011-10-28 17:02:30 -0700 | [diff] [blame^] | 611 | # $(1): the path of the output dictionary file |
| 612 | define generate-userimage-prop-dictionary |
| 613 | $(if $(INTERNAL_USERIMAGES_EXT_VARIANT),$(hide) echo "fs_type=$(INTERNAL_USERIMAGES_EXT_VARIANT)" >> $(1)) |
| 614 | $(if $(BOARD_SYSTEMIMAGE_PARTITION_SIZE),$(hide) echo "system_size=$(BOARD_SYSTEMIMAGE_PARTITION_SIZE)" >> $(1)) |
| 615 | $(if $(BOARD_USERDATAIMAGE_PARTITION_SIZE),$(hide) echo "userdata_size=$(BOARD_USERDATAIMAGE_PARTITION_SIZE)" >> $(1)) |
| 616 | $(if $(INTERNAL_USERIMAGES_SPARSE_EXT_FLAG),$(hide) echo "extfs_sparse_flag=$(INTERNAL_USERIMAGES_SPARSE_EXT_FLAG)" >> $(1)) |
| 617 | $(if $(mkyaffs2_extra_flags),$(hide) echo "mkyaffs2_extra_flags=$(mkyaffs2_extra_flags)" >> $(1)) |
| 618 | endef |
| 619 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 620 | # ----------------------------------------------------------------- |
Doug Zongker | 4647f12 | 2009-07-02 09:00:54 -0700 | [diff] [blame] | 621 | # Recovery image |
Doug Zongker | 8cebf1f | 2009-07-07 17:14:25 -0700 | [diff] [blame] | 622 | |
| 623 | # If neither TARGET_NO_KERNEL nor TARGET_NO_RECOVERY are true |
Brian Swetland | 630b7d3 | 2009-08-07 18:09:44 -0700 | [diff] [blame] | 624 | ifeq (,$(filter true, $(TARGET_NO_KERNEL) $(TARGET_NO_RECOVERY) $(BUILD_TINY_ANDROID))) |
Doug Zongker | 8cebf1f | 2009-07-07 17:14:25 -0700 | [diff] [blame] | 625 | |
Doug Zongker | 4647f12 | 2009-07-02 09:00:54 -0700 | [diff] [blame] | 626 | INSTALLED_RECOVERYIMAGE_TARGET := $(PRODUCT_OUT)/recovery.img |
| 627 | |
| 628 | recovery_initrc := $(call include-path-for, recovery)/etc/init.rc |
| 629 | recovery_kernel := $(INSTALLED_KERNEL_TARGET) # same as a non-recovery system |
| 630 | recovery_ramdisk := $(PRODUCT_OUT)/ramdisk-recovery.img |
| 631 | recovery_build_prop := $(INSTALLED_BUILD_PROP_TARGET) |
| 632 | recovery_binary := $(call intermediates-dir-for,EXECUTABLES,recovery)/recovery |
| 633 | recovery_resources_common := $(call include-path-for, recovery)/res |
| 634 | recovery_resources_private := $(strip $(wildcard $(TARGET_DEVICE_DIR)/recovery/res)) |
| 635 | recovery_resource_deps := $(shell find $(recovery_resources_common) \ |
| 636 | $(recovery_resources_private) -type f) |
Doug Zongker | 9ce0fb6 | 2010-09-20 18:04:41 -0700 | [diff] [blame] | 637 | recovery_fstab := $(strip $(wildcard $(TARGET_DEVICE_DIR)/recovery.fstab)) |
Doug Zongker | 4647f12 | 2009-07-02 09:00:54 -0700 | [diff] [blame] | 638 | |
| 639 | ifeq ($(recovery_resources_private),) |
| 640 | $(info No private recovery resources for TARGET_DEVICE $(TARGET_DEVICE)) |
| 641 | endif |
| 642 | |
Doug Zongker | 9ce0fb6 | 2010-09-20 18:04:41 -0700 | [diff] [blame] | 643 | ifeq ($(recovery_fstab),) |
| 644 | $(info No recovery.fstab for TARGET_DEVICE $(TARGET_DEVICE)) |
| 645 | endif |
| 646 | |
Doug Zongker | 4647f12 | 2009-07-02 09:00:54 -0700 | [diff] [blame] | 647 | INTERNAL_RECOVERYIMAGE_ARGS := \ |
| 648 | $(addprefix --second ,$(INSTALLED_2NDBOOTLOADER_TARGET)) \ |
| 649 | --kernel $(recovery_kernel) \ |
| 650 | --ramdisk $(recovery_ramdisk) |
| 651 | |
| 652 | # Assumes this has already been stripped |
| 653 | ifdef BOARD_KERNEL_CMDLINE |
| 654 | INTERNAL_RECOVERYIMAGE_ARGS += --cmdline "$(BOARD_KERNEL_CMDLINE)" |
| 655 | endif |
| 656 | ifdef BOARD_KERNEL_BASE |
| 657 | INTERNAL_RECOVERYIMAGE_ARGS += --base $(BOARD_KERNEL_BASE) |
| 658 | endif |
Ying Wang | 4de6b5b | 2010-08-25 14:29:34 -0700 | [diff] [blame] | 659 | BOARD_KERNEL_PAGESIZE := $(strip $(BOARD_KERNEL_PAGESIZE)) |
| 660 | ifdef BOARD_KERNEL_PAGESIZE |
| 661 | INTERNAL_RECOVERYIMAGE_ARGS += --pagesize $(BOARD_KERNEL_PAGESIZE) |
| 662 | endif |
Doug Zongker | 4647f12 | 2009-07-02 09:00:54 -0700 | [diff] [blame] | 663 | |
| 664 | # Keys authorized to sign OTA packages this build will accept. The |
Ying Wang | 3c21fe5 | 2011-10-04 10:50:08 -0700 | [diff] [blame] | 665 | # build always uses dev-keys for this; release packaging tools will |
Doug Zongker | 4647f12 | 2009-07-02 09:00:54 -0700 | [diff] [blame] | 666 | # substitute other keys for this one. |
Ying Wang | 3c21fe5 | 2011-10-04 10:50:08 -0700 | [diff] [blame] | 667 | OTA_PUBLIC_KEYS := $(DEFAULT_SYSTEM_DEV_CERTIFICATE).x509.pem |
Doug Zongker | 4647f12 | 2009-07-02 09:00:54 -0700 | [diff] [blame] | 668 | |
| 669 | # Generate a file containing the keys that will be read by the |
| 670 | # recovery binary. |
| 671 | RECOVERY_INSTALL_OTA_KEYS := \ |
| 672 | $(call intermediates-dir-for,PACKAGING,ota_keys)/keys |
| 673 | DUMPKEY_JAR := $(HOST_OUT_JAVA_LIBRARIES)/dumpkey.jar |
| 674 | $(RECOVERY_INSTALL_OTA_KEYS): PRIVATE_OTA_PUBLIC_KEYS := $(OTA_PUBLIC_KEYS) |
Doug Zongker | 5d4808d | 2011-03-16 07:49:13 -0700 | [diff] [blame] | 675 | $(RECOVERY_INSTALL_OTA_KEYS): extra_keys := $(patsubst %,%.x509.pem,$(PRODUCT_EXTRA_RECOVERY_KEYS)) |
Doug Zongker | e121d6a | 2011-02-01 14:13:52 -0800 | [diff] [blame] | 676 | $(RECOVERY_INSTALL_OTA_KEYS): $(OTA_PUBLIC_KEYS) $(DUMPKEY_JAR) $(extra_keys) |
| 677 | @echo "DumpPublicKey: $@ <= $(PRIVATE_OTA_PUBLIC_KEYS) $(extra_keys)" |
Doug Zongker | 4647f12 | 2009-07-02 09:00:54 -0700 | [diff] [blame] | 678 | @rm -rf $@ |
| 679 | @mkdir -p $(dir $@) |
Doug Zongker | e121d6a | 2011-02-01 14:13:52 -0800 | [diff] [blame] | 680 | java -jar $(DUMPKEY_JAR) $(PRIVATE_OTA_PUBLIC_KEYS) $(extra_keys) > $@ |
Doug Zongker | 4647f12 | 2009-07-02 09:00:54 -0700 | [diff] [blame] | 681 | |
| 682 | $(INSTALLED_RECOVERYIMAGE_TARGET): $(MKBOOTFS) $(MKBOOTIMG) $(MINIGZIP) \ |
| 683 | $(INSTALLED_RAMDISK_TARGET) \ |
| 684 | $(INSTALLED_BOOTIMAGE_TARGET) \ |
| 685 | $(recovery_binary) \ |
| 686 | $(recovery_initrc) $(recovery_kernel) \ |
| 687 | $(INSTALLED_2NDBOOTLOADER_TARGET) \ |
| 688 | $(recovery_build_prop) $(recovery_resource_deps) \ |
Doug Zongker | 9ce0fb6 | 2010-09-20 18:04:41 -0700 | [diff] [blame] | 689 | $(recovery_fstab) \ |
Doug Zongker | 4647f12 | 2009-07-02 09:00:54 -0700 | [diff] [blame] | 690 | $(RECOVERY_INSTALL_OTA_KEYS) |
| 691 | @echo ----- Making recovery image ------ |
| 692 | rm -rf $(TARGET_RECOVERY_OUT) |
| 693 | mkdir -p $(TARGET_RECOVERY_OUT) |
| 694 | mkdir -p $(TARGET_RECOVERY_ROOT_OUT) |
| 695 | mkdir -p $(TARGET_RECOVERY_ROOT_OUT)/etc |
| 696 | mkdir -p $(TARGET_RECOVERY_ROOT_OUT)/tmp |
| 697 | echo Copying baseline ramdisk... |
| 698 | cp -R $(TARGET_ROOT_OUT) $(TARGET_RECOVERY_OUT) |
Doug Zongker | b4c7d32 | 2010-07-01 15:30:11 -0700 | [diff] [blame] | 699 | rm $(TARGET_RECOVERY_ROOT_OUT)/init*.rc |
Doug Zongker | 4647f12 | 2009-07-02 09:00:54 -0700 | [diff] [blame] | 700 | echo Modifying ramdisk contents... |
| 701 | cp -f $(recovery_initrc) $(TARGET_RECOVERY_ROOT_OUT)/ |
| 702 | cp -f $(recovery_binary) $(TARGET_RECOVERY_ROOT_OUT)/sbin/ |
| 703 | cp -rf $(recovery_resources_common) $(TARGET_RECOVERY_ROOT_OUT)/ |
| 704 | $(foreach item,$(recovery_resources_private), \ |
| 705 | cp -rf $(item) $(TARGET_RECOVERY_ROOT_OUT)/) |
Doug Zongker | 9ce0fb6 | 2010-09-20 18:04:41 -0700 | [diff] [blame] | 706 | $(foreach item,$(recovery_fstab), \ |
| 707 | cp -f $(item) $(TARGET_RECOVERY_ROOT_OUT)/etc/recovery.fstab) |
Doug Zongker | 4647f12 | 2009-07-02 09:00:54 -0700 | [diff] [blame] | 708 | cp $(RECOVERY_INSTALL_OTA_KEYS) $(TARGET_RECOVERY_ROOT_OUT)/res/keys |
| 709 | cat $(INSTALLED_DEFAULT_PROP_TARGET) $(recovery_build_prop) \ |
| 710 | > $(TARGET_RECOVERY_ROOT_OUT)/default.prop |
| 711 | $(MKBOOTFS) $(TARGET_RECOVERY_ROOT_OUT) | $(MINIGZIP) > $(recovery_ramdisk) |
| 712 | $(MKBOOTIMG) $(INTERNAL_RECOVERYIMAGE_ARGS) --output $@ |
| 713 | @echo ----- Made recovery image -------- $@ |
Doug Zongker | ed96e88 | 2009-08-26 09:37:07 -0700 | [diff] [blame] | 714 | $(hide) $(call assert-max-image-size,$@,$(BOARD_RECOVERYIMAGE_PARTITION_SIZE),raw) |
Doug Zongker | 4647f12 | 2009-07-02 09:00:54 -0700 | [diff] [blame] | 715 | |
| 716 | else |
| 717 | INSTALLED_RECOVERYIMAGE_TARGET := |
| 718 | endif |
| 719 | |
| 720 | .PHONY: recoveryimage |
| 721 | recoveryimage: $(INSTALLED_RECOVERYIMAGE_TARGET) |
| 722 | |
Dima Zavin | 1181898 | 2010-02-05 13:34:34 -0800 | [diff] [blame] | 723 | ifneq ($(BOARD_NAND_PAGE_SIZE),) |
| 724 | mkyaffs2_extra_flags := -c $(BOARD_NAND_PAGE_SIZE) |
| 725 | else |
| 726 | mkyaffs2_extra_flags := |
Lars Svensson | 9cb8c28 | 2010-12-06 15:24:58 +0100 | [diff] [blame] | 727 | BOARD_NAND_PAGE_SIZE := 2048 |
Dima Zavin | 1181898 | 2010-02-05 13:34:34 -0800 | [diff] [blame] | 728 | endif |
| 729 | |
Naseer Ahmed | 5387188 | 2010-08-06 12:19:29 -0700 | [diff] [blame] | 730 | ifneq ($(BOARD_NAND_SPARE_SIZE),) |
| 731 | mkyaffs2_extra_flags += -s $(BOARD_NAND_SPARE_SIZE) |
Lars Svensson | 9cb8c28 | 2010-12-06 15:24:58 +0100 | [diff] [blame] | 732 | else |
| 733 | BOARD_NAND_SPARE_SIZE := 64 |
Naseer Ahmed | 5387188 | 2010-08-06 12:19:29 -0700 | [diff] [blame] | 734 | endif |
| 735 | |
Doug Zongker | 4647f12 | 2009-07-02 09:00:54 -0700 | [diff] [blame] | 736 | # ----------------------------------------------------------------- |
Ying Wang | 0235237 | 2010-09-27 10:37:25 -0700 | [diff] [blame] | 737 | # system image |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 738 | # |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 739 | |
| 740 | INTERNAL_SYSTEMIMAGE_FILES := $(filter $(TARGET_OUT)/%, \ |
| 741 | $(ALL_PREBUILT) \ |
| 742 | $(ALL_COPIED_HEADERS) \ |
| 743 | $(ALL_GENERATED_SOURCES) \ |
| 744 | $(ALL_DEFAULT_INSTALLED_MODULES)) |
| 745 | |
Ying Wang | e5e8c5f | 2011-09-09 16:35:53 -0700 | [diff] [blame] | 746 | FULL_SYSTEMIMAGE_DEPS := $(INTERNAL_SYSTEMIMAGE_FILES) $(INTERNAL_USERIMAGES_DEPS) |
| 747 | # ----------------------------------------------------------------- |
| 748 | # installed file list |
| 749 | # Depending on anything that $(BUILT_SYSTEMIMAGE) depends on. |
| 750 | # We put installed-files.txt ahead of image itself in the dependency graph |
| 751 | # so that we can get the size stat even if the build fails due to too large |
| 752 | # system image. |
| 753 | INSTALLED_FILES_FILE := $(PRODUCT_OUT)/installed-files.txt |
| 754 | $(INSTALLED_FILES_FILE): $(FULL_SYSTEMIMAGE_DEPS) |
| 755 | @echo Installed file list: $@ |
| 756 | @mkdir -p $(dir $@) |
| 757 | @rm -f $@ |
| 758 | $(hide) build/tools/fileslist.py $(TARGET_OUT) > $@ |
| 759 | |
| 760 | .PHONY: installed-file-list |
| 761 | installed-file-list: $(INSTALLED_FILES_FILE) |
| 762 | ifneq ($(filter sdk win_sdk,$(MAKECMDGOALS)),) |
| 763 | $(call dist-for-goals, sdk win_sdk, $(INSTALLED_FILES_FILE)) |
| 764 | endif |
| 765 | ifneq ($(filter sdk_addon,$(MAKECMDGOALS)),) |
| 766 | $(call dist-for-goals, sdk_addon, $(INSTALLED_FILES_FILE)) |
| 767 | endif |
| 768 | |
| 769 | systemimage_intermediates := \ |
| 770 | $(call intermediates-dir-for,PACKAGING,systemimage) |
| 771 | BUILT_SYSTEMIMAGE := $(systemimage_intermediates)/system.img |
| 772 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 773 | # $(1): output file |
| 774 | define build-systemimage-target |
Ying Wang | bd93d42 | 2011-10-28 17:02:30 -0700 | [diff] [blame^] | 775 | @echo "Target system fs image: $(1)" |
| 776 | @mkdir -p $(dir $(1)) $(systemimage_intermediates) && rm -rf $(systemimage_intermediates)/system_image_info.txt |
| 777 | $(call generate-userimage-prop-dictionary, $(systemimage_intermediates)/system_image_info.txt) |
| 778 | $(hide) PATH=$(foreach p,$(INTERNAL_USERIMAGES_BINARY_PATHS),$(p):)$$PATH \ |
| 779 | ./build/tools/releasetools/build_image.py \ |
| 780 | $(TARGET_OUT) $(systemimage_intermediates)/system_image_info.txt $(1) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 781 | endef |
| 782 | |
Ying Wang | e5e8c5f | 2011-09-09 16:35:53 -0700 | [diff] [blame] | 783 | $(BUILT_SYSTEMIMAGE): $(FULL_SYSTEMIMAGE_DEPS) $(INSTALLED_FILES_FILE) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 784 | $(call build-systemimage-target,$@) |
| 785 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 786 | INSTALLED_SYSTEMIMAGE := $(PRODUCT_OUT)/system.img |
Ying Wang | 0235237 | 2010-09-27 10:37:25 -0700 | [diff] [blame] | 787 | SYSTEMIMAGE_SOURCE_DIR := $(TARGET_OUT) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 788 | |
Doug Zongker | 73ef825 | 2009-07-23 15:12:53 -0700 | [diff] [blame] | 789 | # The system partition needs room for the recovery image as well. We |
| 790 | # now store the recovery image as a binary patch using the boot image |
| 791 | # as the source (since they are very similar). Generate the patch so |
| 792 | # we can see how big it's going to be, and include that in the system |
| 793 | # image size check calculation. |
Sriram Raman | 1e96ac8 | 2009-07-24 13:52:32 -0700 | [diff] [blame] | 794 | ifneq ($(INSTALLED_RECOVERYIMAGE_TARGET),) |
Doug Zongker | 73ef825 | 2009-07-23 15:12:53 -0700 | [diff] [blame] | 795 | intermediates := $(call intermediates-dir-for,PACKAGING,recovery_patch) |
| 796 | RECOVERY_FROM_BOOT_PATCH := $(intermediates)/recovery_from_boot.p |
| 797 | $(RECOVERY_FROM_BOOT_PATCH): $(INSTALLED_RECOVERYIMAGE_TARGET) \ |
| 798 | $(INSTALLED_BOOTIMAGE_TARGET) \ |
Doug Zongker | 22bc517 | 2009-07-23 18:27:43 -0700 | [diff] [blame] | 799 | $(HOST_OUT_EXECUTABLES)/imgdiff \ |
| 800 | $(HOST_OUT_EXECUTABLES)/bsdiff |
Doug Zongker | 73ef825 | 2009-07-23 15:12:53 -0700 | [diff] [blame] | 801 | @echo "Construct recovery from boot" |
| 802 | mkdir -p $(dir $@) |
Doug Zongker | b003d89 | 2009-07-23 18:48:38 -0700 | [diff] [blame] | 803 | PATH=$(HOST_OUT_EXECUTABLES):$$PATH $(HOST_OUT_EXECUTABLES)/imgdiff $(INSTALLED_BOOTIMAGE_TARGET) $(INSTALLED_RECOVERYIMAGE_TARGET) $@ |
Sriram Raman | 1e96ac8 | 2009-07-24 13:52:32 -0700 | [diff] [blame] | 804 | endif |
| 805 | |
Doug Zongker | 73ef825 | 2009-07-23 15:12:53 -0700 | [diff] [blame] | 806 | |
| 807 | $(INSTALLED_SYSTEMIMAGE): $(BUILT_SYSTEMIMAGE) $(RECOVERY_FROM_BOOT_PATCH) | $(ACP) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 808 | @echo "Install system fs image: $@" |
| 809 | $(copy-file-to-target) |
Doug Zongker | ed96e88 | 2009-08-26 09:37:07 -0700 | [diff] [blame] | 810 | $(hide) $(call assert-max-image-size,$@ $(RECOVERY_FROM_BOOT_PATCH),$(BOARD_SYSTEMIMAGE_PARTITION_SIZE),yaffs) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 811 | |
| 812 | systemimage: $(INSTALLED_SYSTEMIMAGE) |
| 813 | |
| 814 | .PHONY: systemimage-nodeps snod |
| 815 | systemimage-nodeps snod: $(filter-out systemimage-nodeps snod,$(MAKECMDGOALS)) \ |
Colin Cross | 144b028 | 2010-05-10 13:04:47 -0700 | [diff] [blame] | 816 | | $(INTERNAL_USERIMAGES_DEPS) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 817 | @echo "make $@: ignoring dependencies" |
| 818 | $(call build-systemimage-target,$(INSTALLED_SYSTEMIMAGE)) |
Doug Zongker | ed96e88 | 2009-08-26 09:37:07 -0700 | [diff] [blame] | 819 | $(hide) $(call assert-max-image-size,$(INSTALLED_SYSTEMIMAGE),$(BOARD_SYSTEMIMAGE_PARTITION_SIZE),yaffs) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 820 | |
| 821 | ####### |
| 822 | ## system tarball |
| 823 | define build-systemtarball-target |
| 824 | $(call pretty,"Target system fs tarball: $(INSTALLED_SYSTEMTARBALL_TARGET)") |
| 825 | $(MKTARBALL) $(FS_GET_STATS) \ |
| 826 | $(PRODUCT_OUT) system $(PRIVATE_SYSTEM_TAR) \ |
| 827 | $(INSTALLED_SYSTEMTARBALL_TARGET) |
| 828 | endef |
| 829 | |
Bruce Beare | 69ef5ce | 2010-06-11 12:05:57 -0700 | [diff] [blame] | 830 | ifndef SYSTEM_TARBALL_FORMAT |
| 831 | SYSTEM_TARBALL_FORMAT := bz2 |
| 832 | endif |
| 833 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 834 | system_tar := $(PRODUCT_OUT)/system.tar |
Bruce Beare | 69ef5ce | 2010-06-11 12:05:57 -0700 | [diff] [blame] | 835 | INSTALLED_SYSTEMTARBALL_TARGET := $(system_tar).$(SYSTEM_TARBALL_FORMAT) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 836 | $(INSTALLED_SYSTEMTARBALL_TARGET): PRIVATE_SYSTEM_TAR := $(system_tar) |
| 837 | $(INSTALLED_SYSTEMTARBALL_TARGET): $(FS_GET_STATS) $(INTERNAL_SYSTEMIMAGE_FILES) |
| 838 | $(build-systemtarball-target) |
| 839 | |
| 840 | .PHONY: systemtarball-nodeps |
| 841 | systemtarball-nodeps: $(FS_GET_STATS) \ |
| 842 | $(filter-out systemtarball-nodeps stnod,$(MAKECMDGOALS)) |
| 843 | $(build-systemtarball-target) |
| 844 | |
| 845 | .PHONY: stnod |
| 846 | stnod: systemtarball-nodeps |
| 847 | |
| 848 | |
Bruce Beare | 52aac20 | 2010-06-04 15:24:49 -0700 | [diff] [blame] | 849 | ####### |
| 850 | ## boot tarball |
| 851 | define build-boottarball-target |
Bruce Beare | 45ac434 | 2010-06-24 14:02:00 -0700 | [diff] [blame] | 852 | $(hide) echo "Target boot fs tarball: $(INSTALLED_BOOTTARBALL_TARGET)" |
Bruce Beare | 52aac20 | 2010-06-04 15:24:49 -0700 | [diff] [blame] | 853 | $(hide) mkdir -p $(PRODUCT_OUT)/boot |
| 854 | $(hide) cp -f $(INTERNAL_BOOTIMAGE_FILES) $(PRODUCT_OUT)/boot/. |
| 855 | $(hide) echo $(BOARD_KERNEL_CMDLINE) > $(PRODUCT_OUT)/boot/cmdline |
| 856 | $(hide) $(MKTARBALL) $(FS_GET_STATS) \ |
| 857 | $(PRODUCT_OUT) boot $(PRIVATE_BOOT_TAR) \ |
| 858 | $(INSTALLED_BOOTTARBALL_TARGET) |
| 859 | endef |
| 860 | |
| 861 | ifndef BOOT_TARBALL_FORMAT |
| 862 | BOOT_TARBALL_FORMAT := bz2 |
| 863 | endif |
| 864 | |
| 865 | boot_tar := $(PRODUCT_OUT)/boot.tar |
| 866 | INSTALLED_BOOTTARBALL_TARGET := $(boot_tar).$(BOOT_TARBALL_FORMAT) |
| 867 | $(INSTALLED_BOOTTARBALL_TARGET): PRIVATE_BOOT_TAR := $(boot_tar) |
| 868 | $(INSTALLED_BOOTTARBALL_TARGET): $(FS_GET_STATS) $(INTERNAL_BOOTIMAGE_FILES) |
| 869 | $(build-boottarball-target) |
| 870 | |
| 871 | .PHONY: boottarball-nodeps btnod |
| 872 | boottarball-nodeps btnod: $(FS_GET_STATS) \ |
| 873 | $(filter-out boottarball-nodeps btnod,$(MAKECMDGOALS)) |
| 874 | $(build-boottarball-target) |
| 875 | |
| 876 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 877 | # ----------------------------------------------------------------- |
| 878 | # data partition image |
| 879 | INTERNAL_USERDATAIMAGE_FILES := \ |
| 880 | $(filter $(TARGET_OUT_DATA)/%,$(ALL_DEFAULT_INSTALLED_MODULES)) |
| 881 | |
Ying Wang | bd93d42 | 2011-10-28 17:02:30 -0700 | [diff] [blame^] | 882 | userdataimage_intermediates := \ |
| 883 | $(call intermediates-dir-for,PACKAGING,userdata) |
Joe Onorato | 64d85d0 | 2009-04-09 19:31:12 -0700 | [diff] [blame] | 884 | BUILT_USERDATAIMAGE_TARGET := $(PRODUCT_OUT)/userdata.img |
| 885 | |
Ying Wang | bd93d42 | 2011-10-28 17:02:30 -0700 | [diff] [blame^] | 886 | define build-userdataimage-target |
| 887 | $(call pretty,"Target userdata fs image: $(INSTALLED_USERDATAIMAGE_TARGET)") |
| 888 | @mkdir -p $(TARGET_OUT_DATA) |
| 889 | @mkdir -p $(userdataimage_intermediates) && rm -rf $(userdataimage_intermediates)/userdata_image_info.txt |
| 890 | $(call generate-userimage-prop-dictionary, $(userdataimage_intermediates)/userdata_image_info.txt) |
| 891 | $(hide) PATH=$(foreach p,$(INTERNAL_USERIMAGES_BINARY_PATHS),$(p):)$$PATH \ |
| 892 | ./build/tools/releasetools/build_image.py \ |
| 893 | $(TARGET_OUT_DATA) $(userdataimage_intermediates)/userdata_image_info.txt $@ |
| 894 | $(hide) $(call assert-max-image-size,$(INSTALLED_USERDATAIMAGE_TARGET),$(BOARD_USERDATAIMAGE_PARTITION_SIZE),yaffs) |
| 895 | endef |
| 896 | |
Joe Onorato | 64d85d0 | 2009-04-09 19:31:12 -0700 | [diff] [blame] | 897 | # We just build this directly to the install location. |
| 898 | INSTALLED_USERDATAIMAGE_TARGET := $(BUILT_USERDATAIMAGE_TARGET) |
Colin Cross | 144b028 | 2010-05-10 13:04:47 -0700 | [diff] [blame] | 899 | $(INSTALLED_USERDATAIMAGE_TARGET): $(INTERNAL_USERIMAGES_DEPS) \ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 900 | $(INTERNAL_USERDATAIMAGE_FILES) |
| 901 | $(build-userdataimage-target) |
| 902 | |
| 903 | .PHONY: userdataimage-nodeps |
Colin Cross | 144b028 | 2010-05-10 13:04:47 -0700 | [diff] [blame] | 904 | userdataimage-nodeps: | $(INTERNAL_USERIMAGES_DEPS) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 905 | $(build-userdataimage-target) |
| 906 | |
| 907 | ####### |
| 908 | ## data partition tarball |
| 909 | define build-userdatatarball-target |
| 910 | $(call pretty,"Target userdata fs tarball: " \ |
| 911 | "$(INSTALLED_USERDATATARBALL_TARGET)") |
| 912 | $(MKTARBALL) $(FS_GET_STATS) \ |
| 913 | $(PRODUCT_OUT) data $(PRIVATE_USERDATA_TAR) \ |
| 914 | $(INSTALLED_USERDATATARBALL_TARGET) |
| 915 | endef |
| 916 | |
| 917 | userdata_tar := $(PRODUCT_OUT)/userdata.tar |
| 918 | INSTALLED_USERDATATARBALL_TARGET := $(userdata_tar).bz2 |
| 919 | $(INSTALLED_USERDATATARBALL_TARGET): PRIVATE_USERDATA_TAR := $(userdata_tar) |
| 920 | $(INSTALLED_USERDATATARBALL_TARGET): $(FS_GET_STATS) $(INTERNAL_USERDATAIMAGE_FILES) |
| 921 | $(build-userdatatarball-target) |
| 922 | |
| 923 | .PHONY: userdatatarball-nodeps |
| 924 | userdatatarball-nodeps: $(FS_GET_STATS) |
| 925 | $(build-userdatatarball-target) |
| 926 | |
| 927 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 928 | # ----------------------------------------------------------------- |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 929 | # bring in the installer image generation defines if necessary |
| 930 | ifeq ($(TARGET_USE_DISKINSTALLER),true) |
| 931 | include bootable/diskinstaller/config.mk |
| 932 | endif |
| 933 | |
| 934 | # ----------------------------------------------------------------- |
Doug Zongker | 8678df4 | 2009-06-15 14:30:14 -0700 | [diff] [blame] | 935 | # host tools needed to build OTA packages |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 936 | |
Ying Wang | 0689866 | 2010-06-17 17:52:18 -0700 | [diff] [blame] | 937 | OTATOOLS := $(HOST_OUT_EXECUTABLES)/minigzip \ |
Doug Zongker | 8678df4 | 2009-06-15 14:30:14 -0700 | [diff] [blame] | 938 | $(HOST_OUT_EXECUTABLES)/mkbootfs \ |
| 939 | $(HOST_OUT_EXECUTABLES)/mkbootimg \ |
| 940 | $(HOST_OUT_EXECUTABLES)/fs_config \ |
| 941 | $(HOST_OUT_EXECUTABLES)/mkyaffs2image \ |
| 942 | $(HOST_OUT_EXECUTABLES)/zipalign \ |
| 943 | $(HOST_OUT_EXECUTABLES)/aapt \ |
| 944 | $(HOST_OUT_EXECUTABLES)/bsdiff \ |
Doug Zongker | c494d7c | 2009-06-18 08:43:44 -0700 | [diff] [blame] | 945 | $(HOST_OUT_EXECUTABLES)/imgdiff \ |
Doug Zongker | 8678df4 | 2009-06-15 14:30:14 -0700 | [diff] [blame] | 946 | $(HOST_OUT_JAVA_LIBRARIES)/dumpkey.jar \ |
Ying Wang | 933abf1 | 2010-06-16 14:31:34 -0700 | [diff] [blame] | 947 | $(HOST_OUT_JAVA_LIBRARIES)/signapk.jar \ |
| 948 | $(HOST_OUT_EXECUTABLES)/mkuserimg.sh \ |
| 949 | $(HOST_OUT_EXECUTABLES)/genext2fs \ |
| 950 | $(HOST_OUT_EXECUTABLES)/tune2fs \ |
Sriram Raman | ff83c85 | 2010-11-30 15:09:19 -0500 | [diff] [blame] | 951 | $(HOST_OUT_EXECUTABLES)/e2fsck \ |
Sriram Raman | c647aec | 2010-11-29 18:51:20 -0500 | [diff] [blame] | 952 | $(HOST_OUT_EXECUTABLES)/make_ext4fs |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 953 | |
Ying Wang | 0689866 | 2010-06-17 17:52:18 -0700 | [diff] [blame] | 954 | .PHONY: otatools |
| 955 | otatools: $(OTATOOLS) |
| 956 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 957 | # ----------------------------------------------------------------- |
| 958 | # A zip of the directories that map to the target filesystem. |
| 959 | # This zip can be used to create an OTA package or filesystem image |
| 960 | # as a post-build step. |
| 961 | # |
| 962 | name := $(TARGET_PRODUCT) |
| 963 | ifeq ($(TARGET_BUILD_TYPE),debug) |
| 964 | name := $(name)_debug |
| 965 | endif |
| 966 | name := $(name)-target_files-$(FILE_NAME_TAG) |
| 967 | |
| 968 | intermediates := $(call intermediates-dir-for,PACKAGING,target_files) |
| 969 | BUILT_TARGET_FILES_PACKAGE := $(intermediates)/$(name).zip |
| 970 | $(BUILT_TARGET_FILES_PACKAGE): intermediates := $(intermediates) |
| 971 | $(BUILT_TARGET_FILES_PACKAGE): \ |
| 972 | zip_root := $(intermediates)/$(name) |
| 973 | |
| 974 | # $(1): Directory to copy |
| 975 | # $(2): Location to copy it to |
| 976 | # The "ls -A" is to prevent "acp s/* d" from failing if s is empty. |
| 977 | define package_files-copy-root |
| 978 | if [ -d "$(strip $(1))" -a "$$(ls -A $(1))" ]; then \ |
| 979 | mkdir -p $(2) && \ |
| 980 | $(ACP) -rd $(strip $(1))/* $(2); \ |
| 981 | fi |
| 982 | endef |
| 983 | |
| 984 | built_ota_tools := \ |
Doug Zongker | 17c83cf | 2009-04-01 15:48:46 -0700 | [diff] [blame] | 985 | $(call intermediates-dir-for,EXECUTABLES,applypatch)/applypatch \ |
Doug Zongker | 6c77046 | 2009-07-22 18:27:31 -0700 | [diff] [blame] | 986 | $(call intermediates-dir-for,EXECUTABLES,applypatch_static)/applypatch_static \ |
Doug Zongker | a406c1e | 2009-06-12 16:57:08 -0700 | [diff] [blame] | 987 | $(call intermediates-dir-for,EXECUTABLES,check_prereq)/check_prereq \ |
Doug Zongker | 25863d7 | 2011-09-19 15:02:03 -0700 | [diff] [blame] | 988 | $(call intermediates-dir-for,EXECUTABLES,sqlite3)/sqlite3 \ |
Doug Zongker | a406c1e | 2009-06-12 16:57:08 -0700 | [diff] [blame] | 989 | $(call intermediates-dir-for,EXECUTABLES,updater)/updater |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 990 | $(BUILT_TARGET_FILES_PACKAGE): PRIVATE_OTA_TOOLS := $(built_ota_tools) |
| 991 | |
Doug Zongker | b1134dd | 2009-06-17 17:09:40 -0700 | [diff] [blame] | 992 | $(BUILT_TARGET_FILES_PACKAGE): PRIVATE_RECOVERY_API_VERSION := $(RECOVERY_API_VERSION) |
| 993 | |
Doug Zongker | c18736b | 2009-09-30 09:20:32 -0700 | [diff] [blame] | 994 | ifeq ($(TARGET_RELEASETOOLS_EXTENSIONS),) |
| 995 | # default to common dir for device vendor |
| 996 | $(BUILT_TARGET_FILES_PACKAGE): tool_extensions := $(TARGET_DEVICE_DIR)/../common |
| 997 | else |
| 998 | $(BUILT_TARGET_FILES_PACKAGE): tool_extensions := $(TARGET_RELEASETOOLS_EXTENSIONS) |
| 999 | endif |
| 1000 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1001 | # Depending on the various images guarantees that the underlying |
| 1002 | # directories are up-to-date. |
| 1003 | $(BUILT_TARGET_FILES_PACKAGE): \ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1004 | $(INSTALLED_BOOTIMAGE_TARGET) \ |
| 1005 | $(INSTALLED_RADIOIMAGE_TARGET) \ |
| 1006 | $(INSTALLED_RECOVERYIMAGE_TARGET) \ |
Doug Zongker | 4647f12 | 2009-07-02 09:00:54 -0700 | [diff] [blame] | 1007 | $(INSTALLED_SYSTEMIMAGE) \ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1008 | $(INSTALLED_USERDATAIMAGE_TARGET) \ |
| 1009 | $(INSTALLED_ANDROID_INFO_TXT_TARGET) \ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1010 | $(built_ota_tools) \ |
| 1011 | $(APKCERTS_FILE) \ |
Doug Zongker | 283e2a1 | 2010-03-15 17:52:32 -0700 | [diff] [blame] | 1012 | $(HOST_OUT_EXECUTABLES)/fs_config \ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1013 | | $(ACP) |
| 1014 | @echo "Package target files: $@" |
| 1015 | $(hide) rm -rf $@ $(zip_root) |
| 1016 | $(hide) mkdir -p $(dir $@) $(zip_root) |
| 1017 | @# Components of the recovery image |
| 1018 | $(hide) mkdir -p $(zip_root)/RECOVERY |
| 1019 | $(hide) $(call package_files-copy-root, \ |
| 1020 | $(TARGET_RECOVERY_ROOT_OUT),$(zip_root)/RECOVERY/RAMDISK) |
| 1021 | ifdef INSTALLED_KERNEL_TARGET |
| 1022 | $(hide) $(ACP) $(INSTALLED_KERNEL_TARGET) $(zip_root)/RECOVERY/kernel |
| 1023 | endif |
| 1024 | ifdef INSTALLED_2NDBOOTLOADER_TARGET |
| 1025 | $(hide) $(ACP) \ |
| 1026 | $(INSTALLED_2NDBOOTLOADER_TARGET) $(zip_root)/RECOVERY/second |
| 1027 | endif |
| 1028 | ifdef BOARD_KERNEL_CMDLINE |
| 1029 | $(hide) echo "$(BOARD_KERNEL_CMDLINE)" > $(zip_root)/RECOVERY/cmdline |
| 1030 | endif |
Doug Zongker | 38a649f | 2009-06-17 09:07:09 -0700 | [diff] [blame] | 1031 | ifdef BOARD_KERNEL_BASE |
| 1032 | $(hide) echo "$(BOARD_KERNEL_BASE)" > $(zip_root)/RECOVERY/base |
| 1033 | endif |
Ying Wang | 4de6b5b | 2010-08-25 14:29:34 -0700 | [diff] [blame] | 1034 | ifdef BOARD_KERNEL_PAGESIZE |
| 1035 | $(hide) echo "$(BOARD_KERNEL_PAGESIZE)" > $(zip_root)/RECOVERY/pagesize |
| 1036 | endif |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1037 | @# Components of the boot image |
| 1038 | $(hide) mkdir -p $(zip_root)/BOOT |
| 1039 | $(hide) $(call package_files-copy-root, \ |
| 1040 | $(TARGET_ROOT_OUT),$(zip_root)/BOOT/RAMDISK) |
| 1041 | ifdef INSTALLED_KERNEL_TARGET |
| 1042 | $(hide) $(ACP) $(INSTALLED_KERNEL_TARGET) $(zip_root)/BOOT/kernel |
| 1043 | endif |
| 1044 | ifdef INSTALLED_2NDBOOTLOADER_TARGET |
| 1045 | $(hide) $(ACP) \ |
| 1046 | $(INSTALLED_2NDBOOTLOADER_TARGET) $(zip_root)/BOOT/second |
| 1047 | endif |
| 1048 | ifdef BOARD_KERNEL_CMDLINE |
| 1049 | $(hide) echo "$(BOARD_KERNEL_CMDLINE)" > $(zip_root)/BOOT/cmdline |
| 1050 | endif |
Doug Zongker | 38a649f | 2009-06-17 09:07:09 -0700 | [diff] [blame] | 1051 | ifdef BOARD_KERNEL_BASE |
| 1052 | $(hide) echo "$(BOARD_KERNEL_BASE)" > $(zip_root)/BOOT/base |
| 1053 | endif |
Ying Wang | 4de6b5b | 2010-08-25 14:29:34 -0700 | [diff] [blame] | 1054 | ifdef BOARD_KERNEL_PAGESIZE |
| 1055 | $(hide) echo "$(BOARD_KERNEL_PAGESIZE)" > $(zip_root)/BOOT/pagesize |
| 1056 | endif |
Doug Zongker | e01100c | 2009-06-19 17:12:18 -0700 | [diff] [blame] | 1057 | $(hide) $(foreach t,$(INSTALLED_RADIOIMAGE_TARGET),\ |
| 1058 | mkdir -p $(zip_root)/RADIO; \ |
| 1059 | $(ACP) $(t) $(zip_root)/RADIO/$(notdir $(t));) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1060 | @# Contents of the system image |
| 1061 | $(hide) $(call package_files-copy-root, \ |
| 1062 | $(SYSTEMIMAGE_SOURCE_DIR),$(zip_root)/SYSTEM) |
| 1063 | @# Contents of the data image |
| 1064 | $(hide) $(call package_files-copy-root, \ |
| 1065 | $(TARGET_OUT_DATA),$(zip_root)/DATA) |
| 1066 | @# Extra contents of the OTA package |
| 1067 | $(hide) mkdir -p $(zip_root)/OTA/bin |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1068 | $(hide) $(ACP) $(INSTALLED_ANDROID_INFO_TXT_TARGET) $(zip_root)/OTA/ |
| 1069 | $(hide) $(ACP) $(PRIVATE_OTA_TOOLS) $(zip_root)/OTA/bin/ |
Doug Zongker | 8678df4 | 2009-06-15 14:30:14 -0700 | [diff] [blame] | 1070 | @# Files that do not end up in any images, but are necessary to |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1071 | @# build them. |
| 1072 | $(hide) mkdir -p $(zip_root)/META |
| 1073 | $(hide) $(ACP) $(APKCERTS_FILE) $(zip_root)/META/apkcerts.txt |
Doug Zongker | 17c83cf | 2009-04-01 15:48:46 -0700 | [diff] [blame] | 1074 | $(hide) echo "$(PRODUCT_OTA_PUBLIC_KEYS)" > $(zip_root)/META/otakeys.txt |
Doug Zongker | 3797473 | 2010-09-16 17:44:38 -0700 | [diff] [blame] | 1075 | $(hide) echo "recovery_api_version=$(PRIVATE_RECOVERY_API_VERSION)" > $(zip_root)/META/misc_info.txt |
Doug Zongker | b4c7d32 | 2010-07-01 15:30:11 -0700 | [diff] [blame] | 1076 | ifdef BOARD_FLASH_BLOCK_SIZE |
Doug Zongker | 3797473 | 2010-09-16 17:44:38 -0700 | [diff] [blame] | 1077 | $(hide) echo "blocksize=$(BOARD_FLASH_BLOCK_SIZE)" >> $(zip_root)/META/misc_info.txt |
Doug Zongker | b4c7d32 | 2010-07-01 15:30:11 -0700 | [diff] [blame] | 1078 | endif |
| 1079 | ifdef BOARD_BOOTIMAGE_PARTITION_SIZE |
Ying Wang | 0083671 | 2011-01-14 11:30:56 -0800 | [diff] [blame] | 1080 | $(hide) echo "boot_size=$(BOARD_BOOTIMAGE_PARTITION_SIZE)" >> $(zip_root)/META/misc_info.txt |
Doug Zongker | b4c7d32 | 2010-07-01 15:30:11 -0700 | [diff] [blame] | 1081 | endif |
| 1082 | ifdef BOARD_RECOVERYIMAGE_PARTITION_SIZE |
Ying Wang | 0083671 | 2011-01-14 11:30:56 -0800 | [diff] [blame] | 1083 | $(hide) echo "recovery_size=$(BOARD_RECOVERYIMAGE_PARTITION_SIZE)" >> $(zip_root)/META/misc_info.txt |
Doug Zongker | b4c7d32 | 2010-07-01 15:30:11 -0700 | [diff] [blame] | 1084 | endif |
Doug Zongker | 3797473 | 2010-09-16 17:44:38 -0700 | [diff] [blame] | 1085 | $(hide) echo "tool_extensions=$(tool_extensions)" >> $(zip_root)/META/misc_info.txt |
Ying Wang | 3c21fe5 | 2011-10-04 10:50:08 -0700 | [diff] [blame] | 1086 | $(hide) echo "default_system_dev_certificate=$(DEFAULT_SYSTEM_DEV_CERTIFICATE)" >> $(zip_root)/META/misc_info.txt |
Doug Zongker | 5d4808d | 2011-03-16 07:49:13 -0700 | [diff] [blame] | 1087 | ifdef PRODUCT_EXTRA_RECOVERY_KEYS |
| 1088 | $(hide) echo "extra_recovery_keys=$(PRODUCT_EXTRA_RECOVERY_KEYS)" >> $(zip_root)/META/misc_info.txt |
Doug Zongker | e121d6a | 2011-02-01 14:13:52 -0800 | [diff] [blame] | 1089 | endif |
Ying Wang | bd93d42 | 2011-10-28 17:02:30 -0700 | [diff] [blame^] | 1090 | $(call generate-userimage-prop-dictionary, $(zip_root)/META/misc_info.txt) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1091 | @# Zip everything up, preserving symlinks |
| 1092 | $(hide) (cd $(zip_root) && zip -qry ../$(notdir $@) .) |
Doug Zongker | 23f8bde | 2011-09-07 14:11:51 -0700 | [diff] [blame] | 1093 | @# Run fs_config on all the system, boot ramdisk, and recovery ramdisk files in the zip, and save the output |
| 1094 | $(hide) zipinfo -1 $@ | awk 'BEGIN { FS="SYSTEM/" } /^SYSTEM\// {print "system/" $$2}' | $(HOST_OUT_EXECUTABLES)/fs_config > $(zip_root)/META/filesystem_config.txt |
| 1095 | $(hide) zipinfo -1 $@ | awk 'BEGIN { FS="BOOT/RAMDISK/" } /^BOOT\/RAMDISK\// {print $$2}' | $(HOST_OUT_EXECUTABLES)/fs_config > $(zip_root)/META/boot_filesystem_config.txt |
| 1096 | $(hide) zipinfo -1 $@ | awk 'BEGIN { FS="RECOVERY/RAMDISK/" } /^RECOVERY\/RAMDISK\// {print $$2}' | $(HOST_OUT_EXECUTABLES)/fs_config > $(zip_root)/META/recovery_filesystem_config.txt |
| 1097 | $(hide) (cd $(zip_root) && zip -q ../$(notdir $@) META/*filesystem_config.txt) |
Doug Zongker | 283e2a1 | 2010-03-15 17:52:32 -0700 | [diff] [blame] | 1098 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1099 | |
| 1100 | target-files-package: $(BUILT_TARGET_FILES_PACKAGE) |
| 1101 | |
Doug Zongker | 367910f | 2009-06-15 18:56:51 -0700 | [diff] [blame] | 1102 | |
Doug Zongker | 367910f | 2009-06-15 18:56:51 -0700 | [diff] [blame] | 1103 | ifneq ($(TARGET_PRODUCT),sdk) |
Ying Wang | 279f308 | 2011-02-09 12:26:42 -0800 | [diff] [blame] | 1104 | ifeq ($(filter generic%,$(TARGET_DEVICE)),) |
Ying Wang | fb0a347 | 2010-08-25 16:06:06 -0700 | [diff] [blame] | 1105 | ifneq ($(TARGET_NO_KERNEL),true) |
Ying Wang | a73b656 | 2011-03-03 21:52:08 -0800 | [diff] [blame] | 1106 | ifneq ($(recovery_fstab),) |
Doug Zongker | 367910f | 2009-06-15 18:56:51 -0700 | [diff] [blame] | 1107 | |
Ying Wang | 09a00a6 | 2010-10-20 14:01:09 -0700 | [diff] [blame] | 1108 | # ----------------------------------------------------------------- |
| 1109 | # OTA update package |
| 1110 | |
Doug Zongker | 8678df4 | 2009-06-15 14:30:14 -0700 | [diff] [blame] | 1111 | name := $(TARGET_PRODUCT) |
| 1112 | ifeq ($(TARGET_BUILD_TYPE),debug) |
| 1113 | name := $(name)_debug |
| 1114 | endif |
| 1115 | name := $(name)-ota-$(FILE_NAME_TAG) |
| 1116 | |
| 1117 | INTERNAL_OTA_PACKAGE_TARGET := $(PRODUCT_OUT)/$(name).zip |
| 1118 | |
| 1119 | $(INTERNAL_OTA_PACKAGE_TARGET): KEY_CERT_PAIR := $(DEFAULT_KEY_CERT_PAIR) |
| 1120 | |
Ying Wang | 0689866 | 2010-06-17 17:52:18 -0700 | [diff] [blame] | 1121 | $(INTERNAL_OTA_PACKAGE_TARGET): $(BUILT_TARGET_FILES_PACKAGE) $(OTATOOLS) |
Doug Zongker | 8678df4 | 2009-06-15 14:30:14 -0700 | [diff] [blame] | 1122 | @echo "Package OTA: $@" |
Ying Wang | 68bb651 | 2010-08-25 15:23:21 -0700 | [diff] [blame] | 1123 | $(hide) ./build/tools/releasetools/ota_from_target_files -v \ |
Doug Zongker | 602a84e | 2009-06-18 08:35:12 -0700 | [diff] [blame] | 1124 | -p $(HOST_OUT) \ |
Doug Zongker | 8678df4 | 2009-06-15 14:30:14 -0700 | [diff] [blame] | 1125 | -k $(KEY_CERT_PAIR) \ |
| 1126 | $(BUILT_TARGET_FILES_PACKAGE) $@ |
| 1127 | |
| 1128 | .PHONY: otapackage |
| 1129 | otapackage: $(INTERNAL_OTA_PACKAGE_TARGET) |
| 1130 | |
Ying Wang | 09a00a6 | 2010-10-20 14:01:09 -0700 | [diff] [blame] | 1131 | # ----------------------------------------------------------------- |
| 1132 | # The update package |
| 1133 | |
| 1134 | name := $(TARGET_PRODUCT) |
| 1135 | ifeq ($(TARGET_BUILD_TYPE),debug) |
| 1136 | name := $(name)_debug |
| 1137 | endif |
| 1138 | name := $(name)-img-$(FILE_NAME_TAG) |
| 1139 | |
| 1140 | INTERNAL_UPDATE_PACKAGE_TARGET := $(PRODUCT_OUT)/$(name).zip |
| 1141 | |
| 1142 | ifeq ($(TARGET_RELEASETOOLS_EXTENSIONS),) |
| 1143 | # default to common dir for device vendor |
| 1144 | $(INTERNAL_UPDATE_PACKAGE_TARGET): extensions := $(TARGET_DEVICE_DIR)/../common |
| 1145 | else |
| 1146 | $(INTERNAL_UPDATE_PACKAGE_TARGET): extensions := $(TARGET_RELEASETOOLS_EXTENSIONS) |
| 1147 | endif |
| 1148 | |
| 1149 | $(INTERNAL_UPDATE_PACKAGE_TARGET): $(BUILT_TARGET_FILES_PACKAGE) $(OTATOOLS) |
| 1150 | @echo "Package: $@" |
| 1151 | $(hide) ./build/tools/releasetools/img_from_target_files -v \ |
| 1152 | -s $(extensions) \ |
| 1153 | -p $(HOST_OUT) \ |
| 1154 | $(BUILT_TARGET_FILES_PACKAGE) $@ |
| 1155 | |
| 1156 | .PHONY: updatepackage |
| 1157 | updatepackage: $(INTERNAL_UPDATE_PACKAGE_TARGET) |
| 1158 | |
Ying Wang | a73b656 | 2011-03-03 21:52:08 -0800 | [diff] [blame] | 1159 | endif # recovery_fstab is defined |
Ying Wang | fb0a347 | 2010-08-25 16:06:06 -0700 | [diff] [blame] | 1160 | endif # TARGET_NO_KERNEL != true |
Ying Wang | 279f308 | 2011-02-09 12:26:42 -0800 | [diff] [blame] | 1161 | endif # TARGET_DEVICE != generic* |
Doug Zongker | 367910f | 2009-06-15 18:56:51 -0700 | [diff] [blame] | 1162 | endif # TARGET_PRODUCT != sdk |
Doug Zongker | 8678df4 | 2009-06-15 14:30:14 -0700 | [diff] [blame] | 1163 | |
| 1164 | # ----------------------------------------------------------------- |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1165 | # A zip of the tests that are built when running "make tests". |
| 1166 | # This is very similar to BUILT_TARGET_FILES_PACKAGE, but we |
| 1167 | # only grab SYSTEM and DATA, and it's called "*-tests-*.zip". |
| 1168 | # |
| 1169 | name := $(TARGET_PRODUCT) |
| 1170 | ifeq ($(TARGET_BUILD_TYPE),debug) |
| 1171 | name := $(name)_debug |
| 1172 | endif |
| 1173 | name := $(name)-tests-$(FILE_NAME_TAG) |
| 1174 | |
| 1175 | intermediates := $(call intermediates-dir-for,PACKAGING,tests_zip) |
| 1176 | BUILT_TESTS_ZIP_PACKAGE := $(intermediates)/$(name).zip |
| 1177 | $(BUILT_TESTS_ZIP_PACKAGE): intermediates := $(intermediates) |
| 1178 | $(BUILT_TESTS_ZIP_PACKAGE): zip_root := $(intermediates)/$(name) |
| 1179 | |
| 1180 | # Depending on the images guarantees that the underlying |
| 1181 | # directories are up-to-date. |
| 1182 | $(BUILT_TESTS_ZIP_PACKAGE): \ |
| 1183 | $(BUILT_SYSTEMIMAGE) \ |
| 1184 | $(INSTALLED_USERDATAIMAGE_TARGET) \ |
| 1185 | | $(ACP) |
| 1186 | @echo "Package test files: $@" |
| 1187 | $(hide) rm -rf $@ $(zip_root) |
| 1188 | $(hide) mkdir -p $(dir $@) $(zip_root) |
| 1189 | @# Some parts of the system image |
| 1190 | $(hide) $(call package_files-copy-root, \ |
| 1191 | $(SYSTEMIMAGE_SOURCE_DIR)/xbin,$(zip_root)/SYSTEM/xbin) |
| 1192 | $(hide) $(call package_files-copy-root, \ |
| 1193 | $(SYSTEMIMAGE_SOURCE_DIR)/lib,$(zip_root)/SYSTEM/lib) |
| 1194 | $(hide) $(call package_files-copy-root, \ |
| 1195 | $(SYSTEMIMAGE_SOURCE_DIR)/framework, \ |
| 1196 | $(zip_root)/SYSTEM/framework) |
| 1197 | $(hide) $(ACP) $(SYSTEMIMAGE_SOURCE_DIR)/build.prop $(zip_root)/SYSTEM |
| 1198 | @# Contents of the data image |
| 1199 | $(hide) $(call package_files-copy-root, \ |
| 1200 | $(TARGET_OUT_DATA),$(zip_root)/DATA) |
| 1201 | $(hide) (cd $(zip_root) && zip -qry ../$(notdir $@) .) |
| 1202 | |
Ying Wang | 9c76255 | 2010-09-10 14:39:33 -0700 | [diff] [blame] | 1203 | .PHONY: tests-zip-package |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1204 | tests-zip-package: $(BUILT_TESTS_ZIP_PACKAGE) |
| 1205 | |
Ying Wang | db2cb63 | 2010-09-14 16:07:56 -0700 | [diff] [blame] | 1206 | # Target needed by tests build |
| 1207 | .PHONY: tests-build-target |
| 1208 | tests-build-target: $(BUILT_TESTS_ZIP_PACKAGE) \ |
| 1209 | $(BUILT_USERDATAIMAGE_TARGET) |
| 1210 | |
| 1211 | ifneq (,$(filter $(MAKECMDGOALS),tests-build-target)) |
| 1212 | $(call dist-for-goals, tests-build-target, \ |
| 1213 | $(BUILT_TESTS_ZIP_PACKAGE) \ |
| 1214 | $(BUILT_USERDATAIMAGE_TARGET)) |
Ying Wang | 9c76255 | 2010-09-10 14:39:33 -0700 | [diff] [blame] | 1215 | endif |
| 1216 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1217 | # ----------------------------------------------------------------- |
| 1218 | # A zip of the symbols directory. Keep the full paths to make it |
| 1219 | # more obvious where these files came from. |
| 1220 | # |
| 1221 | name := $(TARGET_PRODUCT) |
| 1222 | ifeq ($(TARGET_BUILD_TYPE),debug) |
| 1223 | name := $(name)_debug |
| 1224 | endif |
| 1225 | name := $(name)-symbols-$(FILE_NAME_TAG) |
| 1226 | |
| 1227 | SYMBOLS_ZIP := $(PRODUCT_OUT)/$(name).zip |
| 1228 | $(SYMBOLS_ZIP): $(INSTALLED_SYSTEMIMAGE) $(INSTALLED_BOOTIMAGE_TARGET) |
| 1229 | @echo "Package symbols: $@" |
| 1230 | $(hide) rm -rf $@ |
| 1231 | $(hide) mkdir -p $(dir $@) |
| 1232 | $(hide) zip -qr $@ $(TARGET_OUT_UNSTRIPPED) |
| 1233 | |
| 1234 | # ----------------------------------------------------------------- |
| 1235 | # A zip of the Android Apps. Not keeping full path so that we don't |
| 1236 | # include product names when distributing |
| 1237 | # |
| 1238 | name := $(TARGET_PRODUCT) |
| 1239 | ifeq ($(TARGET_BUILD_TYPE),debug) |
| 1240 | name := $(name)_debug |
| 1241 | endif |
| 1242 | name := $(name)-apps-$(FILE_NAME_TAG) |
| 1243 | |
| 1244 | APPS_ZIP := $(PRODUCT_OUT)/$(name).zip |
| 1245 | $(APPS_ZIP): $(INSTALLED_SYSTEMIMAGE) |
| 1246 | @echo "Package apps: $@" |
| 1247 | $(hide) rm -rf $@ |
| 1248 | $(hide) mkdir -p $(dir $@) |
| 1249 | $(hide) zip -qj $@ $(TARGET_OUT_APPS)/* |
| 1250 | |
Guang Zhu | 0198d6e | 2010-04-23 11:54:37 -0700 | [diff] [blame] | 1251 | |
| 1252 | #------------------------------------------------------------------ |
| 1253 | # A zip of emma code coverage meta files. Generated for fully emma |
| 1254 | # instrumented build. |
| 1255 | # |
| 1256 | EMMA_META_ZIP := $(PRODUCT_OUT)/emma_meta.zip |
| 1257 | $(EMMA_META_ZIP): $(INSTALLED_SYSTEMIMAGE) |
| 1258 | @echo "Collecting Emma coverage meta files." |
| 1259 | $(hide) find $(TARGET_COMMON_OUT_ROOT) -name "coverage.em" | \ |
| 1260 | zip -@ -q $@ |
| 1261 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1262 | # ----------------------------------------------------------------- |
| 1263 | # dalvik something |
| 1264 | .PHONY: dalvikfiles |
| 1265 | dalvikfiles: $(INTERNAL_DALVIK_MODULES) |
| 1266 | |
| 1267 | # ----------------------------------------------------------------- |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1268 | # The emulator package |
| 1269 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1270 | INTERNAL_EMULATOR_PACKAGE_FILES += \ |
| 1271 | $(HOST_OUT_EXECUTABLES)/emulator$(HOST_EXECUTABLE_SUFFIX) \ |
Bruce Beare | 18a130e | 2011-02-18 15:06:20 -0800 | [diff] [blame] | 1272 | prebuilt/android-$(TARGET_ARCH)/kernel/kernel-qemu \ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1273 | $(INSTALLED_RAMDISK_TARGET) \ |
| 1274 | $(INSTALLED_SYSTEMIMAGE) \ |
| 1275 | $(INSTALLED_USERDATAIMAGE_TARGET) |
| 1276 | |
| 1277 | name := $(TARGET_PRODUCT)-emulator-$(FILE_NAME_TAG) |
| 1278 | |
| 1279 | INTERNAL_EMULATOR_PACKAGE_TARGET := $(PRODUCT_OUT)/$(name).zip |
| 1280 | |
| 1281 | $(INTERNAL_EMULATOR_PACKAGE_TARGET): $(INTERNAL_EMULATOR_PACKAGE_FILES) |
| 1282 | @echo "Package: $@" |
| 1283 | $(hide) zip -qj $@ $(INTERNAL_EMULATOR_PACKAGE_FILES) |
| 1284 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1285 | # ----------------------------------------------------------------- |
| 1286 | # The pdk package (Platform Development Kit) |
| 1287 | |
| 1288 | ifneq (,$(filter pdk,$(MAKECMDGOALS))) |
| 1289 | include development/pdk/Pdk.mk |
| 1290 | endif |
| 1291 | |
| 1292 | # ----------------------------------------------------------------- |
| 1293 | # The SDK |
| 1294 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1295 | # The SDK includes host-specific components, so it belongs under HOST_OUT. |
| 1296 | sdk_dir := $(HOST_OUT)/sdk |
| 1297 | |
| 1298 | # Build a name that looks like: |
| 1299 | # |
| 1300 | # linux-x86 --> android-sdk_12345_linux-x86 |
| 1301 | # darwin-x86 --> android-sdk_12345_mac-x86 |
| 1302 | # windows-x86 --> android-sdk_12345_windows |
| 1303 | # |
| 1304 | sdk_name := android-sdk_$(FILE_NAME_TAG) |
| 1305 | ifeq ($(HOST_OS),darwin) |
Joe Onorato | 03fbe40 | 2009-04-13 08:31:16 -0700 | [diff] [blame] | 1306 | INTERNAL_SDK_HOST_OS_NAME := mac |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1307 | else |
Joe Onorato | 03fbe40 | 2009-04-13 08:31:16 -0700 | [diff] [blame] | 1308 | INTERNAL_SDK_HOST_OS_NAME := $(HOST_OS) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1309 | endif |
| 1310 | ifneq ($(HOST_OS),windows) |
Joe Onorato | 03fbe40 | 2009-04-13 08:31:16 -0700 | [diff] [blame] | 1311 | INTERNAL_SDK_HOST_OS_NAME := $(INTERNAL_SDK_HOST_OS_NAME)-$(HOST_ARCH) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1312 | endif |
Joe Onorato | 03fbe40 | 2009-04-13 08:31:16 -0700 | [diff] [blame] | 1313 | sdk_name := $(sdk_name)_$(INTERNAL_SDK_HOST_OS_NAME) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1314 | |
| 1315 | sdk_dep_file := $(sdk_dir)/sdk_deps.mk |
| 1316 | |
| 1317 | ATREE_FILES := |
| 1318 | -include $(sdk_dep_file) |
| 1319 | |
| 1320 | # if we don't have a real list, then use "everything" |
| 1321 | ifeq ($(strip $(ATREE_FILES)),) |
| 1322 | ATREE_FILES := \ |
| 1323 | $(ALL_PREBUILT) \ |
| 1324 | $(ALL_COPIED_HEADERS) \ |
| 1325 | $(ALL_GENERATED_SOURCES) \ |
| 1326 | $(ALL_DEFAULT_INSTALLED_MODULES) \ |
| 1327 | $(INSTALLED_RAMDISK_TARGET) \ |
| 1328 | $(ALL_DOCS) \ |
| 1329 | $(ALL_SDK_FILES) |
| 1330 | endif |
| 1331 | |
| 1332 | atree_dir := development/build |
| 1333 | |
David 'Digit' Turner | 74b0c36 | 2011-03-23 11:20:14 +0100 | [diff] [blame] | 1334 | # sdk/build/tools.atree contains the generic rules, while |
| 1335 | # |
| 1336 | # sdk/build/tools.$(TARGET_ARCH).atree contains target-specific rules |
| 1337 | # the latter is optional. |
| 1338 | # |
| 1339 | sdk_tools_atree_files := sdk/build/tools.atree |
| 1340 | ifneq (,$(strip $(wildcard sdk/build/tools.$(TARGET_ARCH).atree))) |
| 1341 | sdk_tools_atree_files += sdk/build/tools.$(TARGET_ARCH).atree |
| 1342 | endif |
| 1343 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1344 | sdk_atree_files := \ |
| 1345 | $(atree_dir)/sdk.exclude.atree \ |
| 1346 | $(atree_dir)/sdk.atree \ |
Xavier Ducrohet | ffd5087 | 2010-09-27 15:51:32 -0700 | [diff] [blame] | 1347 | $(atree_dir)/sdk-$(HOST_OS)-$(HOST_ARCH).atree \ |
David 'Digit' Turner | 74b0c36 | 2011-03-23 11:20:14 +0100 | [diff] [blame] | 1348 | $(sdk_tools_atree_files) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1349 | |
David 'Digit' Turner | 77ec16a | 2011-06-23 12:49:02 +0200 | [diff] [blame] | 1350 | # development/build/sdk-android-<abi>.atree is used to differentiate |
| 1351 | # between architecture models (e.g. ARMv5TE versus ARMv7) when copying |
| 1352 | # files like the kernel image. We use TARGET_CPU_ABI because we don't |
| 1353 | # have a better way to distinguish between CPU models. |
| 1354 | ifneq (,$(strip $(wildcard $(atree_dir)/sdk-android-$(TARGET_CPU_ABI).atree))) |
| 1355 | sdk_atree_files += $(atree_dir)/sdk-android-$(TARGET_CPU_ABI).atree |
| 1356 | endif |
| 1357 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1358 | deps := \ |
| 1359 | $(target_notice_file_txt) \ |
| 1360 | $(tools_notice_file_txt) \ |
| 1361 | $(OUT_DOCS)/offline-sdk-timestamp \ |
Ying Wang | 139e332 | 2010-03-31 17:29:04 -0700 | [diff] [blame] | 1362 | $(SYMBOLS_ZIP) \ |
Doug Zongker | dddd957 | 2009-06-15 21:25:32 -0700 | [diff] [blame] | 1363 | $(INSTALLED_SYSTEMIMAGE) \ |
| 1364 | $(INSTALLED_USERDATAIMAGE_TARGET) \ |
| 1365 | $(INSTALLED_RAMDISK_TARGET) \ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1366 | $(INSTALLED_SDK_BUILD_PROP_TARGET) \ |
Ying Wang | 139e332 | 2010-03-31 17:29:04 -0700 | [diff] [blame] | 1367 | $(INSTALLED_BUILD_PROP_TARGET) \ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1368 | $(ATREE_FILES) \ |
| 1369 | $(atree_dir)/sdk.atree \ |
David 'Digit' Turner | 74b0c36 | 2011-03-23 11:20:14 +0100 | [diff] [blame] | 1370 | $(sdk_tools_atree_files) \ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1371 | $(HOST_OUT_EXECUTABLES)/atree \ |
| 1372 | $(HOST_OUT_EXECUTABLES)/line_endings |
| 1373 | |
| 1374 | INTERNAL_SDK_TARGET := $(sdk_dir)/$(sdk_name).zip |
| 1375 | $(INTERNAL_SDK_TARGET): PRIVATE_NAME := $(sdk_name) |
| 1376 | $(INTERNAL_SDK_TARGET): PRIVATE_DIR := $(sdk_dir)/$(sdk_name) |
| 1377 | $(INTERNAL_SDK_TARGET): PRIVATE_DEP_FILE := $(sdk_dep_file) |
| 1378 | $(INTERNAL_SDK_TARGET): PRIVATE_INPUT_FILES := $(sdk_atree_files) |
| 1379 | |
| 1380 | # Set SDK_GNU_ERROR to non-empty to fail when a GNU target is built. |
| 1381 | # |
| 1382 | #SDK_GNU_ERROR := true |
| 1383 | |
| 1384 | $(INTERNAL_SDK_TARGET): $(deps) |
| 1385 | @echo "Package SDK: $@" |
| 1386 | $(hide) rm -rf $(PRIVATE_DIR) $@ |
| 1387 | $(hide) for f in $(target_gnu_MODULES); do \ |
| 1388 | if [ -f $$f ]; then \ |
| 1389 | echo SDK: $(if $(SDK_GNU_ERROR),ERROR:,warning:) \ |
| 1390 | including GNU target $$f >&2; \ |
| 1391 | FAIL=$(SDK_GNU_ERROR); \ |
| 1392 | fi; \ |
| 1393 | done; \ |
| 1394 | if [ $$FAIL ]; then exit 1; fi |
| 1395 | $(hide) ( \ |
| 1396 | $(HOST_OUT_EXECUTABLES)/atree \ |
| 1397 | $(addprefix -f ,$(PRIVATE_INPUT_FILES)) \ |
| 1398 | -m $(PRIVATE_DEP_FILE) \ |
| 1399 | -I . \ |
| 1400 | -I $(PRODUCT_OUT) \ |
| 1401 | -I $(HOST_OUT) \ |
| 1402 | -I $(TARGET_COMMON_OUT_ROOT) \ |
| 1403 | -v "PLATFORM_NAME=android-$(PLATFORM_VERSION)" \ |
Raphael Moll | 7558ad5 | 2011-01-05 14:58:17 -0800 | [diff] [blame] | 1404 | -v "OUT_DIR=$(OUT_DIR)" \ |
Bruce Beare | 18a130e | 2011-02-18 15:06:20 -0800 | [diff] [blame] | 1405 | -v "TARGET_ARCH=$(TARGET_ARCH)" \ |
| 1406 | -v "TARGET_CPU_ABI=$(TARGET_CPU_ABI)" \ |
David 'Digit' Turner | 557c51f | 2011-08-25 14:28:03 +0200 | [diff] [blame] | 1407 | -v "DLL_EXTENSION=$(HOST_SHLIB_SUFFIX)" \ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1408 | -o $(PRIVATE_DIR) && \ |
| 1409 | cp -f $(target_notice_file_txt) \ |
Xavier Ducrohet | 6de7bc6 | 2011-09-21 10:22:19 -0700 | [diff] [blame] | 1410 | $(PRIVATE_DIR)/system-images/android-$(PLATFORM_VERSION)/$(TARGET_CPU_ABI)/NOTICE.txt && \ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1411 | cp -f $(tools_notice_file_txt) $(PRIVATE_DIR)/tools/NOTICE.txt && \ |
Xavier Ducrohet | 4216a8c | 2011-03-15 13:28:40 -0700 | [diff] [blame] | 1412 | cp -f $(tools_notice_file_txt) $(PRIVATE_DIR)/platform-tools/NOTICE.txt && \ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1413 | HOST_OUT_EXECUTABLES=$(HOST_OUT_EXECUTABLES) HOST_OS=$(HOST_OS) \ |
Raphael | 7a6a9c3 | 2011-02-01 13:30:00 -0800 | [diff] [blame] | 1414 | development/build/tools/sdk_clean.sh $(PRIVATE_DIR) && \ |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1415 | chmod -R ug+rwX $(PRIVATE_DIR) && \ |
| 1416 | cd $(dir $@) && zip -rq $(notdir $@) $(PRIVATE_NAME) \ |
| 1417 | ) || ( rm -rf $(PRIVATE_DIR) $@ && exit 44 ) |
| 1418 | |
Raphael | 3d224a0 | 2010-04-16 17:50:09 -0700 | [diff] [blame] | 1419 | |
| 1420 | # Is a Windows SDK requested? If so, we need some definitions from here |
| 1421 | # in order to find the Linux SDK used to create the Windows one. |
Raphael | c4d4731 | 2011-02-15 16:09:36 -0800 | [diff] [blame] | 1422 | MAIN_SDK_NAME := $(sdk_name) |
| 1423 | MAIN_SDK_DIR := $(sdk_dir) |
| 1424 | MAIN_SDK_ZIP := $(INTERNAL_SDK_TARGET) |
Raphael | 3d224a0 | 2010-04-16 17:50:09 -0700 | [diff] [blame] | 1425 | ifneq ($(filter win_sdk,$(MAKECMDGOALS)),) |
Raphael | 3d224a0 | 2010-04-16 17:50:09 -0700 | [diff] [blame] | 1426 | include $(TOPDIR)development/build/tools/windows_sdk.mk |
| 1427 | endif |
| 1428 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1429 | # ----------------------------------------------------------------- |
| 1430 | # Findbugs |
| 1431 | INTERNAL_FINDBUGS_XML_TARGET := $(PRODUCT_OUT)/findbugs.xml |
| 1432 | INTERNAL_FINDBUGS_HTML_TARGET := $(PRODUCT_OUT)/findbugs.html |
| 1433 | $(INTERNAL_FINDBUGS_XML_TARGET): $(ALL_FINDBUGS_FILES) |
| 1434 | @echo UnionBugs: $@ |
| 1435 | $(hide) prebuilt/common/findbugs/bin/unionBugs $(ALL_FINDBUGS_FILES) \ |
| 1436 | > $@ |
| 1437 | $(INTERNAL_FINDBUGS_HTML_TARGET): $(INTERNAL_FINDBUGS_XML_TARGET) |
| 1438 | @echo ConvertXmlToText: $@ |
| 1439 | $(hide) prebuilt/common/findbugs/bin/convertXmlToText -html:fancy.xsl \ |
| 1440 | $(INTERNAL_FINDBUGS_XML_TARGET) > $@ |
| 1441 | |
| 1442 | # ----------------------------------------------------------------- |
| 1443 | # Findbugs |
| 1444 | |
| 1445 | # ----------------------------------------------------------------- |
| 1446 | # These are some additional build tasks that need to be run. |
| 1447 | include $(sort $(wildcard $(BUILD_SYSTEM)/tasks/*.mk)) |
Claes Elgemark | e22ad67 | 2010-11-12 15:46:00 +0100 | [diff] [blame] | 1448 | -include $(sort $(wildcard vendor/*/build/tasks/*.mk)) |
Raphael | c4d4731 | 2011-02-15 16:09:36 -0800 | [diff] [blame] | 1449 | |
| 1450 | # ----------------------------------------------------------------- |
| 1451 | # Create SDK repository packages. Must be done after tasks/* since |
| 1452 | # we need the addon rules defined. |
| 1453 | ifneq ($(sdk_repo_goal),) |
| 1454 | include $(TOPDIR)development/build/tools/sdk_repo.mk |
| 1455 | endif |