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