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