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