1 # Put some miscellaneous rules here
3 ifeq (,$(REQUESTED_PRODUCT))
4 REQUESTED_PRODUCT := $(TARGET_PRODUCT)
7 # Pick a reasonable string to use to identify files.
8 ifneq "" "$(filter eng.%,$(BUILD_NUMBER))"
9 # BUILD_NUMBER has a timestamp in it, which means that
10 # it will change every time. Pick a stable value.
11 FILE_NAME_TAG := eng.$(USER)
13 FILE_NAME_TAG := $(BUILD_NUMBER)
16 # -----------------------------------------------------------------
17 # Define rules to copy PRODUCT_COPY_FILES defined by the product.
18 # PRODUCT_COPY_FILES contains words like <source file>:<dest file>.
19 # <dest file> is relative to $(PRODUCT_OUT), so it should look like,
20 # e.g., "system/etc/file.xml".
21 $(foreach cf,$(PRODUCT_COPY_FILES), \
22 $(eval _w := $(subst :,$(space),$(cf))) \
23 $(eval _src := $(word 1,$(_w))) \
24 $(eval _dest := $(subst //,/,$(PRODUCT_OUT)/$(word 2,$(_w)))) \
25 $(eval $(call copy-one-file,$(_src),$(_dest))) \
26 $(eval ALL_DEFAULT_INSTALLED_MODULES += $(_dest)) \
29 # -----------------------------------------------------------------
31 gen := $(OUT_DOCS)/index.html
33 $(gen): frameworks/base/docs/docs-redirect-index.html
37 # -----------------------------------------------------------------
39 INSTALLED_DEFAULT_PROP_TARGET := $(TARGET_ROOT_OUT)/default.prop
40 ALL_DEFAULT_INSTALLED_MODULES += $(INSTALLED_DEFAULT_PROP_TARGET)
41 ADDITIONAL_DEFAULT_PROPERTIES := \
42 $(call collapse-pairs, $(ADDITIONAL_DEFAULT_PROPERTIES))
44 $(INSTALLED_DEFAULT_PROP_TARGET):
45 @echo Target buildinfo: $@
47 $(hide) echo "#" > $@; \
48 echo "# ADDITIONAL_DEFAULT_PROPERTIES" >> $@; \
50 $(hide) $(foreach line,$(ADDITIONAL_DEFAULT_PROPERTIES), \
51 echo "$(line)" >> $@;)
53 # -----------------------------------------------------------------
55 INSTALLED_BUILD_PROP_TARGET := $(TARGET_OUT)/build.prop
56 ALL_DEFAULT_INSTALLED_MODULES += $(INSTALLED_BUILD_PROP_TARGET)
57 ADDITIONAL_BUILD_PROPERTIES := \
58 $(call collapse-pairs, $(ADDITIONAL_BUILD_PROPERTIES))
60 build_target := $(strip $(firstword \
61 $(filter user userdebug sdk tests all, $(MAKECMDGOALS))))
62 ifeq ($(build_target),)
63 # eng, droid, or nothing
66 $(INSTALLED_BUILD_PROP_TARGET): PRIVATE_BUILD_TARGET := $(build_target)
68 # A list of arbitrary tags describing the build configuration.
69 # Force ":=" so we can use +=
70 BUILD_VERSION_TAGS := $(BUILD_VERSION_TAGS)
71 ifeq ($(TARGET_BUILD_TYPE),debug)
72 BUILD_VERSION_TAGS += debug
74 # Apps are always signed with test keys, and may be re-signed in a post-build
75 # step. If that happens, the "test-keys" tag will be removed by that step.
76 BUILD_VERSION_TAGS += test-keys
77 ifndef INCLUDE_TEST_OTA_KEYS
78 BUILD_VERSION_TAGS += ota-rel-keys
80 BUILD_VERSION_TAGS := $(subst $(space),$(comma),$(sort $(BUILD_VERSION_TAGS)))
82 # A human-readable string that descibes this build in detail.
83 build_desc := $(REQUESTED_PRODUCT)-$(build_target) $(PLATFORM_VERSION) $(BUILD_ID) $(BUILD_NUMBER) $(BUILD_VERSION_TAGS)
84 $(INSTALLED_BUILD_PROP_TARGET): PRIVATE_BUILD_DESC := $(build_desc)
86 # The string used to uniquely identify this build; used by the OTA server.
87 ifeq (,$(strip $(BUILD_FINGERPRINT)))
88 BUILD_FINGERPRINT := $(PRODUCT_BRAND)/$(REQUESTED_PRODUCT)/$(TARGET_PRODUCT)/$(TARGET_BOOTLOADER_BOARD_NAME):$(PLATFORM_VERSION)/$(BUILD_ID)/$(BUILD_NUMBER):$(build_target)/$(BUILD_VERSION_TAGS)
91 # Selects the first locale in the list given as the argument,
92 # and splits it into language and region, which each may be
95 $(subst _, , $(firstword $(1)))
98 # Selects the first locale in the list given as the argument
99 # and returns the language (or the region)
100 define default-locale-language
101 $(word 2, 2, $(call default-locale, $(1)))
103 define default-locale-region
104 $(word 3, 3, $(call default-locale, $(1)))
107 BUILDINFO_SH := build/tools/buildinfo.sh
108 $(INSTALLED_BUILD_PROP_TARGET): $(BUILDINFO_SH) $(INTERNAL_BUILD_ID_MAKEFILE)
109 @echo Target buildinfo: $@
111 $(hide) TARGET_BUILD_TYPE="$(PRIVATE_BUILD_TARGET)" \
112 TARGET_PRODUCT="$(TARGET_PRODUCT)" \
113 PRODUCT_NAME="$(REQUESTED_PRODUCT)" \
114 PRODUCT_BRAND="$(PRODUCT_BRAND)" \
115 PRODUCT_DEFAULT_LANGUAGE="$(call default-locale-language,$(PRODUCT_LOCALES))" \
116 PRODUCT_DEFAULT_REGION="$(call default-locale-region,$(PRODUCT_LOCALES))" \
117 PRODUCT_MODEL="$(PRODUCT_MODEL)" \
118 PRODUCT_MANUFACTURER="$(PRODUCT_MANUFACTURER)" \
119 PRIVATE_BUILD_DESC="$(PRIVATE_BUILD_DESC)" \
120 BUILD_ID="$(BUILD_ID)" \
121 BUILD_NUMBER="$(BUILD_NUMBER)" \
122 PLATFORM_VERSION="$(PLATFORM_VERSION)" \
123 PLATFORM_SDK_VERSION="$(PLATFORM_SDK_VERSION)" \
124 BUILD_VERSION_TAGS="$(BUILD_VERSION_TAGS)" \
125 TARGET_BOOTLOADER_BOARD_NAME="$(TARGET_BOOTLOADER_BOARD_NAME)" \
126 BUILD_FINGERPRINT="$(BUILD_FINGERPRINT)" \
127 bash $(BUILDINFO_SH) > $@
128 $(hide) if [ -f $(TARGET_PRODUCT_DIR)/system.prop ]; then \
129 cat $(TARGET_PRODUCT_DIR)/system.prop >> $@; \
131 $(if $(ADDITIONAL_BUILD_PROPERTIES), \
132 $(hide) echo >> $@; \
134 echo "# ADDITIONAL_BUILD_PROPERTIES" >> $@; \
136 $(hide) $(foreach line,$(ADDITIONAL_BUILD_PROPERTIES), \
137 echo "$(line)" >> $@;)
142 # -----------------------------------------------------------------
145 # There are certain things in build.prop that we don't want to
146 # ship with the sdk; remove them.
148 # This must be a list of entire property keys followed by
149 # "=" characters, without any internal spaces.
150 sdk_build_prop_remove := \
154 ro.product.manufacturer= \
156 # TODO: Remove this soon-to-be obsolete property
157 sdk_build_prop_remove += ro.build.product=
158 INSTALLED_SDK_BUILD_PROP_TARGET := $(PRODUCT_OUT)/sdk/sdk-build.prop
159 $(INSTALLED_SDK_BUILD_PROP_TARGET): $(INSTALLED_BUILD_PROP_TARGET)
160 @echo SDK buildinfo: $@
162 $(hide) grep -v "$(subst $(space),\|,$(strip \
163 $(sdk_build_prop_remove)))" $< > $@.tmp
164 $(hide) for x in $(sdk_build_prop_remove); do \
165 echo "$$x"generic >> $@.tmp; done
168 # -----------------------------------------------------------------
170 PACKAGE_STATS_FILE := $(PRODUCT_OUT)/package-stats.txt
171 PACKAGES_TO_STAT := \
172 $(sort $(filter $(TARGET_OUT)/% $(TARGET_OUT_DATA)/%, \
173 $(filter %.jar %.apk, $(ALL_DEFAULT_INSTALLED_MODULES))))
174 $(PACKAGE_STATS_FILE): $(PACKAGES_TO_STAT)
175 @echo Package stats: $@
178 $(hide) tools/dump-package-stats $^ > $@
180 .PHONY: package-stats
181 package-stats: $(PACKAGE_STATS_FILE)
183 # -----------------------------------------------------------------
184 # Cert-to-package mapping. Used by the post-build signing tools.
185 name := $(REQUESTED_PRODUCT)
186 ifeq ($(TARGET_BUILD_TYPE),debug)
187 name := $(name)_debug
189 name := $(name)-apkcerts-$(FILE_NAME_TAG)
191 $(call intermediates-dir-for,PACKAGING,apkcerts)
192 APKCERTS_FILE := $(intermediates)/$(name).txt
193 # Depending on the built packages isn't exactly right,
194 # but it should guarantee that the apkcerts file is rebuilt
195 # if any packages change which certs they're signed with.
196 all_built_packages := $(foreach p,$(PACKAGES),$(ALL_MODULES.$(p).BUILT))
197 $(APKCERTS_FILE): $(all_built_packages)
198 @echo APK certs list: $@
201 $(hide) $(foreach p,$(PACKAGES),\
202 echo 'name="$(p).apk" certificate="$(PACKAGES.$(p).CERTIFICATE)" \
203 private_key="$(PACKAGES.$(p).PRIVATE_KEY)"' >> $@;)
205 .PHONY: apkcerts-list
206 apkcerts-list: $(APKCERTS_FILE)
208 # -----------------------------------------------------------------
209 # installed file list
210 INSTALLED_FILES_FILE := $(PRODUCT_OUT)/installed-files.txt
211 $(INSTALLED_FILES_FILE): $(ALL_DEFAULT_INSTALLED_MODULES)
212 @echo Installed file list: $@
215 $(hide) (cd $(PRODUCT_OUT) && \
216 find system data -type f -printf 'name="%p" size=%s\n') | \
219 .PHONY: installed-file-list
220 installed-file-list: $(INSTALLED_FILES_FILE)
222 # -----------------------------------------------------------------
224 ifdef CREATE_MODULE_INFO_FILE
225 MODULE_INFO_FILE := $(PRODUCT_OUT)/module-info.txt
226 $(info Generating $(MODULE_INFO_FILE)...)
227 $(shell rm -f $(MODULE_INFO_FILE))
228 $(foreach m,$(ALL_MODULES), \
229 $(shell echo "NAME=\"$(m)\"" \
230 "PATH=\"$(strip $(ALL_MODULES.$(m).PATH))\"" \
231 "TAGS=\"$(strip $(filter-out _%,$(ALL_MODULES.$(m).TAGS)))\"" \
232 "BUILT=\"$(strip $(ALL_MODULES.$(m).BUILT))\"" \
233 "INSTALLED=\"$(strip $(ALL_MODULES.$(m).INSTALLED))\"" >> $(MODULE_INFO_FILE)))
236 # Rules that need to be present for the simulator, even
237 # if they don't do anything.
241 ifneq ($(TARGET_SIMULATOR),true)
243 # #################################################################
244 # Targets for boot/OS images
245 # #################################################################
247 # -----------------------------------------------------------------
249 INTERNAL_RAMDISK_FILES := $(filter $(TARGET_ROOT_OUT)/%, \
251 $(ALL_COPIED_HEADERS) \
252 $(ALL_GENERATED_SOURCES) \
253 $(ALL_DEFAULT_INSTALLED_MODULES))
255 INSTALLED_RAMDISK_TARGET := $(PRODUCT_OUT)/ramdisk.img
256 $(INSTALLED_RAMDISK_TARGET): $(MKBOOTFS) $(INTERNAL_RAMDISK_FILES)
257 $(call pretty,"Target ram disk: $@")
258 $(hide) $(MKBOOTFS) $(TARGET_ROOT_OUT) | gzip > $@
261 ifneq ($(strip $(TARGET_NO_KERNEL)),true)
263 # -----------------------------------------------------------------
264 # the boot image, which is a collection of other images.
265 INTERNAL_BOOTIMAGE_ARGS := \
266 $(addprefix --second ,$(INSTALLED_2NDBOOTLOADER_TARGET)) \
267 --kernel $(INSTALLED_KERNEL_TARGET) \
268 --ramdisk $(INSTALLED_RAMDISK_TARGET)
270 INTERNAL_BOOTIMAGE_FILES := $(filter-out --%,$(INTERNAL_BOOTIMAGE_ARGS))
272 BOARD_KERNEL_CMDLINE := $(strip $(BOARD_KERNEL_CMDLINE))
273 ifdef BOARD_KERNEL_CMDLINE
274 INTERNAL_BOOTIMAGE_ARGS += --cmdline "$(BOARD_KERNEL_CMDLINE)"
277 INSTALLED_BOOTIMAGE_TARGET := $(PRODUCT_OUT)/boot.img
278 $(INSTALLED_BOOTIMAGE_TARGET): $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_FILES)
279 $(call pretty,"Target boot image: $@")
280 $(hide) $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_ARGS) --output $@
281 $(hide) $(call assert-max-file-size,$@,$(BOARD_BOOTIMAGE_MAX_SIZE))
283 else # TARGET_NO_KERNEL
284 # HACK: The top-level targets depend on the bootimage. Not all targets
285 # can produce a bootimage, though, and emulator targets need the ramdisk
286 # instead. Fake it out by calling the ramdisk the bootimage.
287 # TODO: make the emulator use bootimages, and make mkbootimg accept
288 # kernel-less inputs.
289 INSTALLED_BOOTIMAGE_TARGET := $(INSTALLED_RAMDISK_TARGET)
292 # -----------------------------------------------------------------
295 # This needs to be before the systemimage rules, because it adds to
296 # ALL_DEFAULT_INSTALLED_MODULES, which those use to pick which files
297 # go into the systemimage.
301 # Create the rule to combine the files into text and html forms
302 # $(1) - Plain text output file
303 # $(2) - HTML output file
305 # $(4) - Directory to use. Notice files are all $(4)/src. Other
306 # directories in there will be used for scratch
307 # $(5) - Dependencies for the output files
309 # The algorithm here is that we go collect a hash for each of the notice
310 # files and write the names of the files that match that hash. Then
311 # to generate the real files, we go print out all of the files and their
314 # These rules are fairly complex, so they depend on this makefile so if
315 # it changes, they'll run again.
317 # TODO: We could clean this up so that we just record the locations of the
318 # original notice files instead of making rules to copy them somwehere.
319 # Then we could traverse that without quite as much bash drama.
320 define combine-notice-files
321 $(1) $(2): PRIVATE_MESSAGE := $(3)
322 $(1) $(2) $(4)/hash-timestamp: PRIVATE_DIR := $(4)
323 $(4)/hash-timestamp: $(5) $(BUILD_SYSTEM)/Makefile
324 @echo Finding NOTICE files: $$@
325 $$(hide) rm -rf $$@ $$(PRIVATE_DIR)/hash
326 $$(hide) mkdir -p $$(PRIVATE_DIR)/hash
327 $$(hide) for file in $$$$(find $$(PRIVATE_DIR)/src -type f); do \
328 hash=$$$$($(MD5SUM) $$$$file | sed -e "s/ .*//"); \
329 hashfile=$$(PRIVATE_DIR)/hash/$$$$hash; \
330 echo $$$$file >> $$$$hashfile; \
333 $(1): $(4)/hash-timestamp
334 @echo Combining NOTICE files: $$@
335 $$(hide) mkdir -p $$(dir $$@)
336 $$(hide) echo $$(PRIVATE_MESSAGE) > $$@
337 $$(hide) find $$(PRIVATE_DIR)/hash -type f | xargs cat | sort | \
338 sed -e "s:$$(PRIVATE_DIR)/src\(.*\)\.txt: \1:" >> $$@
342 $$(hide) for hashfile in $$$$(find $$(PRIVATE_DIR)/hash -type f); do \
343 echo "============================================================"\
345 echo "Notices for file(s):" >> $$@; \
346 cat $$$$hashfile | sort | \
347 sed -e "s:$$(PRIVATE_DIR)/src\(.*\)\.txt: \1:" >> \
349 echo "------------------------------------------------------------"\
352 orig=$$$$(head -n 1 $$$$hashfile); \
353 cat $$$$orig >> $$@; \
358 $(2): $(4)/hash-timestamp
359 @echo Combining NOTICE files: $$@
360 $$(hide) mkdir -p $$(dir $$@)
361 $$(hide) echo "<html><head>" > $$@
362 $$(hide) echo "<style type=\"text/css\">" >> $$@
363 $$(hide) echo "body { padding: 0; font-family: sans-serif; }" >> $$@
364 $$(hide) echo ".same-license { background-color: #eeeeee; border-top: 20px solid white; padding: 10px; }" >> $$@
365 $$(hide) echo ".label { font-weight: bold; }" >> $$@
366 $$(hide) echo ".file-list { margin-left: 1em; font-color: blue; }" >> $$@
367 $$(hide) echo "</style>" >> $$@
368 $$(hide) echo "</head><body topmargin=\"0\" leftmargin=\"0\" rightmargin=\"0\" bottommargin=\"0\">" >> $$@
369 $$(hide) echo "<table cellpading=\"0\" cellspacing=\"0\" border=\"0\">" \
371 $$(hide) for hashfile in $$$$(find $$(PRIVATE_DIR)/hash -type f); do \
372 cat $$$$hashfile | sort | \
373 sed -e "s:$$(PRIVATE_DIR)/src\(.*\)\.txt: <a name=\"\1\"></a>:" >> \
375 echo "<tr><td class=\"same-license\">" >> $$@; \
376 echo "<div class=\"label\">Notices for file(s):</div>" >> $$@; \
377 echo "<div class=\"file-list\">" >> $$@; \
378 cat $$$$hashfile | sort | \
379 sed -e "s:$$(PRIVATE_DIR)/src\(.*\)\.txt: \1<br/>:" >> $$@; \
380 echo "</div><!-- file-list -->" >> $$@; \
382 orig=$$$$(head -n 1 $$$$hashfile); \
383 echo "<pre class=\"license-text\">" >> $$@; \
384 cat $$$$orig | sed -e "s/\&/\&/g" | sed -e "s/</\</g" \
385 | sed -e "s/>/\>/g" >> $$@; \
386 echo "</pre><!-- license-text -->" >> $$@; \
387 echo "</td></tr><!-- same-license -->" >> $$@; \
392 $$(hide) echo "</table>" >> $$@
393 $$(hide) echo "</body></html>" >> $$@
394 notice_files: $(1) $(2)
397 # TODO These intermediate NOTICE.txt/NOTICE.html files should go into
398 # TARGET_OUT_NOTICE_FILES now that the notice files are gathered from
399 # the src subdirectory.
401 target_notice_file_txt := $(TARGET_OUT_INTERMEDIATES)/NOTICE.txt
402 target_notice_file_html := $(TARGET_OUT_INTERMEDIATES)/NOTICE.html
403 tools_notice_file_txt := $(HOST_OUT_INTERMEDIATES)/NOTICE.txt
404 tools_notice_file_html := $(HOST_OUT_INTERMEDIATES)/NOTICE.html
406 kernel_notice_file := $(TARGET_OUT_NOTICE_FILES)/src/kernel.txt
408 $(eval $(call combine-notice-files, \
409 $(target_notice_file_txt), \
410 $(target_notice_file_html), \
411 "Notices for files contained in the filesystem images in this directory:", \
412 $(TARGET_OUT_NOTICE_FILES), \
413 $(ALL_DEFAULT_INSTALLED_MODULES) $(kernel_notice_file)))
415 $(eval $(call combine-notice-files, \
416 $(tools_notice_file_txt), \
417 $(tools_notice_file_html), \
418 "Notices for files contained in the tools directory:", \
419 $(HOST_OUT_NOTICE_FILES), \
420 $(ALL_DEFAULT_INSTALLED_MODULES)))
422 # Install the html file at /system/NOTICE.html.
423 # This is not ideal, but this is very late in the game, after a lot of
424 # the module processing has already been done -- in fact, we used the
425 # fact that all that has been done to get the list of modules that we
426 # need notice files for.
427 installed_notice_html := $(TARGET_OUT)/etc/NOTICE.html
428 $(installed_notice_html): $(target_notice_file_html) | $(ACP)
429 $(copy-file-to-target)
430 ALL_DEFAULT_INSTALLED_MODULES += $(installed_notice_html)
432 # The kernel isn't really a module, so to get its module file in there, we
433 # make the target NOTICE files depend on this particular file too, which will
434 # then be in the right directory for the find in combine-notice-files to work.
435 $(kernel_notice_file): \
436 prebuilt/$(TARGET_PREBUILT_TAG)/kernel/LINUX_KERNEL_COPYING \
439 $(hide) mkdir -p $(dir $@)
443 # #################################################################
444 # Targets for user images
445 # #################################################################
447 # -----------------------------------------------------------------
450 # First, the "unoptimized" image, which contains .apk/.jar files
451 # that contain regular, unoptimized/unverified .dex entries.
453 systemimage_unopt_intermediates := \
454 $(call intermediates-dir-for,PACKAGING,systemimage_unopt)
455 BUILT_SYSTEMIMAGE_UNOPT := $(systemimage_unopt_intermediates)/system.img
457 INTERNAL_SYSTEMIMAGE_FILES := $(filter $(TARGET_OUT)/%, \
459 $(ALL_COPIED_HEADERS) \
460 $(ALL_GENERATED_SOURCES) \
461 $(ALL_DEFAULT_INSTALLED_MODULES))
464 define build-systemimage-target
465 @echo "Target system fs image: $(1)"
466 @mkdir -p $(dir $(1))
467 $(hide) $(MKYAFFS2) -f $(TARGET_OUT) $(1)
470 $(BUILT_SYSTEMIMAGE_UNOPT): $(INTERNAL_SYSTEMIMAGE_FILES) | $(MKYAFFS2)
471 $(call build-systemimage-target,$@)
473 # The installed image, which may be optimized or unoptimized.
475 INSTALLED_SYSTEMIMAGE := $(PRODUCT_OUT)/system.img
478 ifndef DISABLE_DEXPREOPT
479 with_dexpreopt := true
483 # This file will set BUILT_SYSTEMIMAGE and SYSTEMIMAGE_SOURCE_DIR
484 include tools/dexpreopt/Config.mk
486 BUILT_SYSTEMIMAGE := $(BUILT_SYSTEMIMAGE_UNOPT)
487 SYSTEMIMAGE_SOURCE_DIR := $(TARGET_OUT)
490 $(INSTALLED_SYSTEMIMAGE): $(BUILT_SYSTEMIMAGE) | $(ACP)
491 @echo "Install system fs image: $@"
492 $(copy-file-to-target)
493 $(hide) $(call assert-max-file-size,$@,$(BOARD_SYSTEMIMAGE_MAX_SIZE))
495 systemimage: $(INSTALLED_SYSTEMIMAGE) report_config
497 .PHONY: systemimage-nodeps snod
498 systemimage-nodeps snod: $(filter-out systemimage-nodeps snod,$(MAKECMDGOALS)) \
499 report_config | $(MKYAFFS2)
500 @echo "make $@: ignoring dependencies"
501 $(call build-systemimage-target,$(INSTALLED_SYSTEMIMAGE))
502 $(hide) $(call assert-max-file-size,$(INSTALLED_SYSTEMIMAGE),$(BOARD_SYSTEMIMAGE_MAX_SIZE))
504 # -----------------------------------------------------------------
505 # data partition image
506 INTERNAL_USERDATAIMAGE_FILES := \
507 $(filter $(TARGET_OUT_DATA)/%,$(ALL_DEFAULT_INSTALLED_MODULES))
509 define build-userdataimage-target
510 $(call pretty,"Target userdata fs image: $(INSTALLED_USERDATAIMAGE_TARGET)")
511 $(hide) $(MKYAFFS2) -f $(TARGET_OUT_DATA) $(INSTALLED_USERDATAIMAGE_TARGET)
512 $(hide) $(call assert-max-file-size,$(INSTALLED_USERDATAIMAGE_TARGET),$(BOARD_USERDATAIMAGE_MAX_SIZE))
515 INSTALLED_USERDATAIMAGE_TARGET := $(PRODUCT_OUT)/userdata.img
516 $(INSTALLED_USERDATAIMAGE_TARGET): $(MKYAFFS2) $(INTERNAL_USERDATAIMAGE_FILES)
517 $(build-userdataimage-target)
519 .PHONY: userdataimage-nodeps
520 userdataimage-nodeps: $(MKYAFFS2)
521 $(build-userdataimage-target)
524 # If neither TARGET_NO_KERNEL nor TARGET_NO_RECOVERY are true
525 ifeq (,$(filter true, $(TARGET_NO_KERNEL) $(TARGET_NO_RECOVERY)))
527 # -----------------------------------------------------------------
529 INSTALLED_RECOVERYIMAGE_TARGET := $(PRODUCT_OUT)/recovery.img
531 recovery_initrc := $(call include-path-for, recovery)/etc/init.rc
532 recovery_kernel := $(INSTALLED_KERNEL_TARGET) # same as a non-recovery system
533 recovery_ramdisk := $(PRODUCT_OUT)/ramdisk-recovery.img
534 recovery_build_prop := $(INSTALLED_BUILD_PROP_TARGET)
535 recovery_binary := $(call intermediates-dir-for,EXECUTABLES,recovery)/recovery
536 recovery_resources := $(call include-path-for, recovery)/res
538 INTERNAL_RECOVERYIMAGE_ARGS := \
539 $(addprefix --second ,$(INSTALLED_2NDBOOTLOADER_TARGET)) \
540 --kernel $(recovery_kernel) \
541 --ramdisk $(recovery_ramdisk)
543 # Assumes this has already been stripped
544 ifdef BOARD_KERNEL_CMDLINE
545 INTERNAL_RECOVERYIMAGE_ARGS += --cmdline "$(BOARD_KERNEL_CMDLINE)"
548 $(INSTALLED_RECOVERYIMAGE_TARGET): $(MKBOOTFS) $(MKBOOTIMG) \
549 $(INSTALLED_RAMDISK_TARGET) \
550 $(INSTALLED_BOOTIMAGE_TARGET) \
552 $(recovery_initrc) $(recovery_kernel) \
553 $(INSTALLED_2NDBOOTLOADER_TARGET) \
554 $(recovery_build_prop)
555 @echo ----- Making recovery image ------
556 rm -rf $(TARGET_RECOVERY_OUT)
557 mkdir -p $(TARGET_RECOVERY_OUT)
558 mkdir -p $(TARGET_RECOVERY_ROOT_OUT)
559 mkdir -p $(TARGET_RECOVERY_ROOT_OUT)/etc
560 mkdir -p $(TARGET_RECOVERY_ROOT_OUT)/tmp
561 echo Copying baseline ramdisk...
562 cp -R $(TARGET_ROOT_OUT) $(TARGET_RECOVERY_OUT)
563 echo Modifying ramdisk contents...
564 cp -f $(recovery_initrc) $(TARGET_RECOVERY_ROOT_OUT)/
565 cp -f $(recovery_binary) $(TARGET_RECOVERY_ROOT_OUT)/sbin/
566 cp -rf $(recovery_resources) $(TARGET_RECOVERY_ROOT_OUT)/
567 cat $(INSTALLED_DEFAULT_PROP_TARGET) $(recovery_build_prop) \
568 > $(TARGET_RECOVERY_ROOT_OUT)/default.prop
569 $(MKBOOTFS) $(TARGET_RECOVERY_ROOT_OUT) | gzip > $(recovery_ramdisk)
570 $(MKBOOTIMG) $(INTERNAL_RECOVERYIMAGE_ARGS) --output $@
571 @echo ----- Made recovery image -------- $@
572 $(hide) $(call assert-max-file-size,$@,$(BOARD_RECOVERYIMAGE_MAX_SIZE))
575 INSTALLED_RECOVERYIMAGE_TARGET :=
578 .PHONY: recoveryimage
579 recoveryimage: $(INSTALLED_RECOVERYIMAGE_TARGET)
581 # -----------------------------------------------------------------
583 name := $(REQUESTED_PRODUCT)
584 ifeq ($(TARGET_BUILD_TYPE),debug)
585 name := $(name)_debug
587 name := $(name)-ota-$(FILE_NAME_TAG)
589 INTERNAL_OTA_PACKAGE_TARGET := $(PRODUCT_OUT)/$(name).zip
590 INTERNAL_OTA_INTERMEDIATES_DIR := $(call intermediates-dir-for,PACKAGING,ota)
591 INTERNAL_OTA_RECOVERYIMAGE_TARGET := $(INTERNAL_OTA_INTERMEDIATES_DIR)/system/recovery.img
592 INTERNAL_OTA_SCRIPT_TARGET := $(INTERNAL_OTA_INTERMEDIATES_DIR)/META-INF/com/google/android/update-script
594 # Sign OTA packages with the test key by default.
595 # Actual product deliverables will be re-signed by hand.
596 private_key := $(SRC_TARGET_DIR)/product/security/testkey.pk8
597 certificate := $(SRC_TARGET_DIR)/product/security/testkey.x509.pem
598 $(INTERNAL_OTA_PACKAGE_TARGET): $(private_key) $(certificate) $(SIGNAPK_JAR)
599 $(INTERNAL_OTA_PACKAGE_TARGET): PRIVATE_PRIVATE_KEY := $(private_key)
600 $(INTERNAL_OTA_PACKAGE_TARGET): PRIVATE_CERTIFICATE := $(certificate)
602 # Depending on INSTALLED_SYSTEMIMAGE guarantees that SYSTEMIMAGE_SOURCE_DIR
603 # is up-to-date. We use jar instead of zip so that we can use the -C
604 # switch to avoid cd-ing all over the place.
605 # TODO: Make our own jar-creation tool to avoid all these shenanigans.
606 $(INTERNAL_OTA_PACKAGE_TARGET): \
607 $(INTERNAL_OTA_SCRIPT_TARGET) \
608 $(INTERNAL_OTA_RECOVERYIMAGE_TARGET) \
609 $(INSTALLED_BOOTIMAGE_TARGET) \
610 $(INSTALLED_RADIOIMAGE_TARGET) \
611 $(INSTALLED_ANDROID_INFO_TXT_TARGET) \
612 $(INSTALLED_SYSTEMIMAGE)
613 @echo "Package OTA: $@"
617 $(INSTALLED_BOOTIMAGE_TARGET) \
618 $(INSTALLED_RADIOIMAGE_TARGET) \
619 $(INSTALLED_ANDROID_INFO_TXT_TARGET), \
620 -C $(dir $(item)) $(notdir $(item))) \
621 -C $(INTERNAL_OTA_INTERMEDIATES_DIR) .
622 $(hide) find $(SYSTEMIMAGE_SOURCE_DIR) -type f -print | \
623 sed 's|^$(dir $(SYSTEMIMAGE_SOURCE_DIR))|-C & |' | \
625 $(hide) if jar tf $@ | egrep '.{65}' >&2; then \
626 echo "Path too long (>64 chars) for OTA update" >&2; \
631 $(INTERNAL_OTA_SCRIPT_TARGET): \
632 $(HOST_OUT_EXECUTABLES)/make-update-script \
633 $(INSTALLED_ANDROID_INFO_TXT_TARGET) \
634 $(INSTALLED_SYSTEMIMAGE)
637 @echo "Update script: $@"
638 $(hide) TARGET_PRODUCT=$(TARGET_PRODUCT) \
639 $< $(SYSTEMIMAGE_SOURCE_DIR) \
640 $(INSTALLED_ANDROID_INFO_TXT_TARGET) \
643 # This copy is so recovery.img can be in /system within the OTA package.
644 # That way it gets installed into the system image, which in turn installs it.
645 $(INTERNAL_OTA_RECOVERYIMAGE_TARGET): $(INSTALLED_RECOVERYIMAGE_TARGET)
650 otapackage: $(INTERNAL_OTA_PACKAGE_TARGET)
652 # Keys authorized to sign OTA packages this build will accept.
653 ifeq ($(INCLUDE_TEST_OTA_KEYS),true)
655 $(sort $(SRC_TARGET_DIR)/product/security/testkey.x509.pem $(OTA_PUBLIC_KEYS))
658 ifeq ($(OTA_PUBLIC_KEYS),)
659 $(error No OTA_PUBLIC_KEYS defined)
662 # Build a keystore with the authorized keys in it.
663 # java/android/android/server/checkin/UpdateVerifier.java uses this.
664 ALL_DEFAULT_INSTALLED_MODULES += $(TARGET_OUT_ETC)/security/otacerts.zip
665 $(TARGET_OUT_ETC)/security/otacerts.zip: $(OTA_PUBLIC_KEYS)
667 $(hide) mkdir -p $(dir $@)
668 zip -qj $@ $(OTA_PUBLIC_KEYS)
670 # The device does not support JKS, see bug 857840.
671 # $(hide) for f in $(OTA_PUBLIC_KEYS); do \
672 # echo "keytool: $@ <= $$f" && \
673 # keytool -keystore $@ -storepass $(notdir $@) -noprompt \
674 # -import -file $$f -alias $(notdir $$f) || exit 1; \
677 ifdef RECOVERY_INSTALL_OTA_KEYS_INC
678 # Generate a C-includable file containing the keys.
679 # RECOVERY_INSTALL_OTA_KEYS_INC is defined by recovery/Android.mk.
680 # *** THIS IS A TOTAL HACK; EXECUTABLES MUST NOT CHANGE BETWEEN DIFFERENT
681 # PRODUCTS/BUILD TYPES. ***
682 # TODO: make recovery read the keys from an external file.
683 DUMPKEY_JAR := $(HOST_OUT_JAVA_LIBRARIES)/dumpkey.jar
684 $(RECOVERY_INSTALL_OTA_KEYS_INC): PRIVATE_OTA_PUBLIC_KEYS := $(OTA_PUBLIC_KEYS)
685 $(RECOVERY_INSTALL_OTA_KEYS_INC): $(OTA_PUBLIC_KEYS) $(DUMPKEY_JAR)
686 @echo "DumpPublicKey: $@ <= $(PRIVATE_OTA_PUBLIC_KEYS)"
689 $(hide) java -jar $(DUMPKEY_JAR) $(PRIVATE_OTA_PUBLIC_KEYS) > $@
692 # -----------------------------------------------------------------
693 # A zip of the directories that map to the target filesystem.
694 # This zip can be used to create an OTA package or filesystem image
695 # as a post-build step.
697 name := $(REQUESTED_PRODUCT)
698 ifeq ($(TARGET_BUILD_TYPE),debug)
699 name := $(name)_debug
701 name := $(name)-target_files-$(FILE_NAME_TAG)
703 intermediates := $(call intermediates-dir-for,PACKAGING,target_files)
704 BUILT_TARGET_FILES_PACKAGE := $(intermediates)/$(name).zip
705 $(BUILT_TARGET_FILES_PACKAGE): intermediates := $(intermediates)
706 $(BUILT_TARGET_FILES_PACKAGE): \
707 zip_root := $(intermediates)/$(name)
709 # $(1): Directory to copy
710 # $(2): Location to copy it to
711 # The "ls -A" is to prevent "acp s/* d" from failing if s is empty.
712 define package_files-copy-root
713 if [ -d "$(strip $(1))" -a "$$(ls -A $(1))" ]; then \
715 $(ACP) -rd $(strip $(1))/* $(2); \
719 # Depending on the various images guarantees that the underlying
720 # directories are up-to-date.
721 $(BUILT_TARGET_FILES_PACKAGE): \
722 $(INTERNAL_OTA_SCRIPT_TARGET) \
723 $(INSTALLED_BOOTIMAGE_TARGET) \
724 $(INSTALLED_RADIOIMAGE_TARGET) \
725 $(INSTALLED_RECOVERYIMAGE_TARGET) \
726 $(BUILT_SYSTEMIMAGE) \
727 $(INSTALLED_USERDATAIMAGE_TARGET) \
728 $(INSTALLED_ANDROID_INFO_TXT_TARGET) \
729 $(INTERNAL_OTA_SCRIPT_TARGET) \
732 @echo "Package target files: $@"
733 $(hide) rm -rf $@ $(zip_root)
734 $(hide) mkdir -p $(dir $@) $(zip_root)
735 @# Components of the recovery image
736 $(hide) mkdir -p $(zip_root)/RECOVERY
737 $(hide) $(call package_files-copy-root, \
738 $(TARGET_RECOVERY_ROOT_OUT),$(zip_root)/RECOVERY/RAMDISK)
739 $(hide) $(ACP) $(INSTALLED_KERNEL_TARGET) $(zip_root)/RECOVERY/kernel
740 ifdef INSTALLED_2NDBOOTLOADER_TARGET
742 $(INSTALLED_2NDBOOTLOADER_TARGET) $(zip_root)/RECOVERY/second
744 ifdef BOARD_KERNEL_CMDLINE
745 $(hide) echo "$(BOARD_KERNEL_CMDLINE)" > $(zip_root)/RECOVERY/cmdline
747 @# Components of the boot image
748 $(hide) mkdir -p $(zip_root)/BOOT
749 $(hide) $(call package_files-copy-root, \
750 $(TARGET_ROOT_OUT),$(zip_root)/BOOT/RAMDISK)
751 $(hide) $(ACP) $(INSTALLED_KERNEL_TARGET) $(zip_root)/BOOT/kernel
752 ifdef INSTALLED_2NDBOOTLOADER_TARGET
754 $(INSTALLED_2NDBOOTLOADER_TARGET) $(zip_root)/BOOT/second
756 ifdef BOARD_KERNEL_CMDLINE
757 $(hide) echo "$(BOARD_KERNEL_CMDLINE)" > $(zip_root)/BOOT/cmdline
759 ifdef INSTALLED_RADIOIMAGE_TARGET
761 $(hide) mkdir -p $(zip_root)/RADIO
762 $(hide) $(ACP) $(INSTALLED_RADIOIMAGE_TARGET) $(zip_root)/RADIO/image
764 @# Contents of the system image
765 $(hide) $(call package_files-copy-root, \
766 $(SYSTEMIMAGE_SOURCE_DIR),$(zip_root)/SYSTEM)
767 @# Contents of the data image
768 $(hide) $(call package_files-copy-root, \
769 $(TARGET_OUT_DATA),$(zip_root)/DATA)
770 @# Extra contents of the OTA package
771 $(hide) mkdir -p $(zip_root)/OTA
772 $(hide) $(call package_files-copy-root, \
773 $(INTERNAL_OTA_INTERMEDIATES_DIR),$(zip_root)/OTA)
774 $(hide) $(ACP) $(INSTALLED_ANDROID_INFO_TXT_TARGET) $(zip_root)/OTA/
775 @# Files that don't end up in any images, but are necessary to
777 $(hide) mkdir -p $(zip_root)/META
778 $(hide) $(ACP) $(APKCERTS_FILE) $(zip_root)/META/apkcerts.txt
779 @# Zip everything up, preserving symlinks
780 $(hide) (cd $(zip_root) && zip -qry ../$(notdir $@) .)
782 target-files-package: $(BUILT_TARGET_FILES_PACKAGE)
784 # -----------------------------------------------------------------
785 # A zip of the tests that are built when running "make tests".
786 # This is very similar to BUILT_TARGET_FILES_PACKAGE, but we
787 # only grab SYSTEM and DATA, and it's called "*-tests-*.zip".
789 name := $(REQUESTED_PRODUCT)
790 ifeq ($(TARGET_BUILD_TYPE),debug)
791 name := $(name)_debug
793 name := $(name)-tests-$(FILE_NAME_TAG)
795 intermediates := $(call intermediates-dir-for,PACKAGING,tests_zip)
796 BUILT_TESTS_ZIP_PACKAGE := $(intermediates)/$(name).zip
797 $(BUILT_TESTS_ZIP_PACKAGE): intermediates := $(intermediates)
798 $(BUILT_TESTS_ZIP_PACKAGE): zip_root := $(intermediates)/$(name)
800 # Depending on the images guarantees that the underlying
801 # directories are up-to-date.
802 $(BUILT_TESTS_ZIP_PACKAGE): \
803 $(BUILT_SYSTEMIMAGE) \
804 $(INSTALLED_USERDATAIMAGE_TARGET) \
806 @echo "Package test files: $@"
807 $(hide) rm -rf $@ $(zip_root)
808 $(hide) mkdir -p $(dir $@) $(zip_root)
809 @# Some parts of the system image
810 $(hide) $(call package_files-copy-root, \
811 $(SYSTEMIMAGE_SOURCE_DIR)/xbin,$(zip_root)/SYSTEM/xbin)
812 $(hide) $(call package_files-copy-root, \
813 $(SYSTEMIMAGE_SOURCE_DIR)/lib,$(zip_root)/SYSTEM/lib)
814 $(hide) $(call package_files-copy-root, \
815 $(SYSTEMIMAGE_SOURCE_DIR)/framework, \
816 $(zip_root)/SYSTEM/framework)
817 $(hide) $(ACP) $(SYSTEMIMAGE_SOURCE_DIR)/build.prop $(zip_root)/SYSTEM
818 @# Contents of the data image
819 $(hide) $(call package_files-copy-root, \
820 $(TARGET_OUT_DATA),$(zip_root)/DATA)
821 $(hide) (cd $(zip_root) && zip -qry ../$(notdir $@) .)
823 tests-zip-package: $(BUILT_TESTS_ZIP_PACKAGE)
825 # -----------------------------------------------------------------
826 # A zip of the symbols directory. Keep the full paths to make it
827 # more obvious where these files came from.
829 name := $(REQUESTED_PRODUCT)
830 ifeq ($(TARGET_BUILD_TYPE),debug)
831 name := $(name)_debug
833 name := $(name)-symbols-$(FILE_NAME_TAG)
835 SYMBOLS_ZIP := $(PRODUCT_OUT)/$(name).zip
836 $(SYMBOLS_ZIP): $(INSTALLED_SYSTEMIMAGE) $(INSTALLED_BOOTIMAGE_TARGET)
837 @echo "Package symbols: $@"
839 $(hide) mkdir -p $(dir $@)
840 $(hide) zip -qr $@ $(TARGET_OUT_UNSTRIPPED)
842 # -----------------------------------------------------------------
843 # A zip of the Android Apps. Not keeping full path so that we don't
844 # include product names when distributing
846 name := $(REQUESTED_PRODUCT)
847 ifeq ($(TARGET_BUILD_TYPE),debug)
848 name := $(name)_debug
850 name := $(name)-apps-$(FILE_NAME_TAG)
852 APPS_ZIP := $(PRODUCT_OUT)/$(name).zip
853 $(APPS_ZIP): $(INSTALLED_SYSTEMIMAGE)
854 @echo "Package apps: $@"
856 $(hide) mkdir -p $(dir $@)
857 $(hide) zip -qj $@ $(TARGET_OUT_APPS)/*
859 endif # TARGET_SIMULATOR != true
861 # -----------------------------------------------------------------
864 dalvikfiles: $(INTERNAL_DALVIK_MODULES)
866 # -----------------------------------------------------------------
869 INTERNAL_UPDATE_PACKAGE_FILES += \
870 $(INSTALLED_BOOTIMAGE_TARGET) \
871 $(INSTALLED_RECOVERYIMAGE_TARGET) \
872 $(INSTALLED_SYSTEMIMAGE) \
873 $(INSTALLED_USERDATAIMAGE_TARGET) \
874 $(INSTALLED_ANDROID_INFO_TXT_TARGET)
876 ifneq ($(strip $(INTERNAL_UPDATE_PACKAGE_FILES)),)
878 name := $(REQUESTED_PRODUCT)
879 ifeq ($(TARGET_BUILD_TYPE),debug)
880 name := $(name)_debug
882 name := $(name)-img-$(FILE_NAME_TAG)
884 INTERNAL_UPDATE_PACKAGE_TARGET := $(PRODUCT_OUT)/$(name).zip
886 $(INTERNAL_UPDATE_PACKAGE_TARGET): $(INTERNAL_UPDATE_PACKAGE_FILES)
888 $(hide) zip -qj $@ $(INTERNAL_UPDATE_PACKAGE_FILES)
891 INTERNAL_UPDATE_PACKAGE_TARGET :=
894 # -----------------------------------------------------------------
895 # The emulator package
897 ifneq ($(TARGET_SIMULATOR),true)
899 INTERNAL_EMULATOR_PACKAGE_FILES += \
900 $(HOST_OUT_EXECUTABLES)/emulator$(HOST_EXECUTABLE_SUFFIX) \
901 prebuilt/android-arm/kernel-qemu \
902 $(INSTALLED_RAMDISK_TARGET) \
903 $(INSTALLED_SYSTEMIMAGE) \
904 $(INSTALLED_USERDATAIMAGE_TARGET)
906 name := $(REQUESTED_PRODUCT)-emulator-$(FILE_NAME_TAG)
908 INTERNAL_EMULATOR_PACKAGE_TARGET := $(PRODUCT_OUT)/$(name).zip
910 $(INTERNAL_EMULATOR_PACKAGE_TARGET): $(INTERNAL_EMULATOR_PACKAGE_FILES)
912 $(hide) zip -qj $@ $(INTERNAL_EMULATOR_PACKAGE_FILES)
916 # -----------------------------------------------------------------
917 # The pdk package (Platform Development Kit)
919 ifneq (,$(filter pdk,$(MAKECMDGOALS)))
923 # -----------------------------------------------------------------
926 ifneq ($(TARGET_SIMULATOR),true)
928 # The SDK includes host-specific components, so it belongs under HOST_OUT.
929 sdk_dir := $(HOST_OUT)/sdk
931 # Build a name that looks like:
933 # linux-x86 --> android-sdk_12345_linux-x86
934 # darwin-x86 --> android-sdk_12345_mac-x86
935 # windows-x86 --> android-sdk_12345_windows
937 sdk_name := android-sdk_$(FILE_NAME_TAG)
938 ifeq ($(HOST_OS),darwin)
941 sdk_host_os := $(HOST_OS)
943 ifneq ($(HOST_OS),windows)
944 sdk_host_os := $(sdk_host_os)-$(HOST_ARCH)
946 sdk_name := $(sdk_name)_$(sdk_host_os)
948 sdk_dep_file := $(sdk_dir)/sdk_deps.mk
951 -include $(sdk_dep_file)
953 # if we don't have a real list, then use "everything"
954 ifeq ($(strip $(ATREE_FILES)),)
957 $(ALL_COPIED_HEADERS) \
958 $(ALL_GENERATED_SOURCES) \
959 $(ALL_DEFAULT_INSTALLED_MODULES) \
960 $(INSTALLED_RAMDISK_TARGET) \
965 atree_dir := development/build
968 $(atree_dir)/sdk.exclude.atree \
969 $(atree_dir)/sdk.atree \
970 $(atree_dir)/sdk-$(HOST_OS)-$(HOST_ARCH).atree
973 $(target_notice_file_txt) \
974 $(tools_notice_file_txt) \
975 $(OUT_DOCS)/framework-timestamp \
976 $(INTERNAL_UPDATE_PACKAGE_TARGET) \
977 $(INSTALLED_SDK_BUILD_PROP_TARGET) \
979 $(atree_dir)/sdk.atree \
980 $(HOST_OUT_EXECUTABLES)/atree \
981 $(HOST_OUT_EXECUTABLES)/line_endings
983 INTERNAL_SDK_TARGET := $(sdk_dir)/$(sdk_name).zip
984 $(INTERNAL_SDK_TARGET): PRIVATE_NAME := $(sdk_name)
985 $(INTERNAL_SDK_TARGET): PRIVATE_DIR := $(sdk_dir)/$(sdk_name)
986 $(INTERNAL_SDK_TARGET): PRIVATE_DEP_FILE := $(sdk_dep_file)
987 $(INTERNAL_SDK_TARGET): PRIVATE_INPUT_FILES := $(sdk_atree_files)
989 # Set SDK_GNU_ERROR to non-empty to fail when a GNU target is built.
991 #SDK_GNU_ERROR := true
993 $(INTERNAL_SDK_TARGET): $(deps)
994 @echo "Package SDK: $@"
995 $(hide) rm -rf $(PRIVATE_DIR) $@
996 $(hide) for f in $(target_gnu_MODULES); do \
997 if [ -f $$f ]; then \
998 echo SDK: $(if $(SDK_GNU_ERROR),ERROR:,warning:) \
999 including GNU target $$f >&2; \
1000 FAIL=$(SDK_GNU_ERROR); \
1003 if [ $$FAIL ]; then exit 1; fi
1005 $(HOST_OUT_EXECUTABLES)/atree \
1006 $(addprefix -f ,$(PRIVATE_INPUT_FILES)) \
1007 -m $(PRIVATE_DEP_FILE) \
1011 -I $(TARGET_COMMON_OUT_ROOT) \
1012 -o $(PRIVATE_DIR) && \
1013 mkdir -p $(PRIVATE_DIR)/tools/lib/images/ && \
1014 cp -f $(target_notice_file_txt) \
1015 $(PRIVATE_DIR)/tools/lib/images/NOTICE.txt && \
1016 cp -f $(tools_notice_file_txt) $(PRIVATE_DIR)/tools/NOTICE.txt && \
1017 HOST_OUT_EXECUTABLES=$(HOST_OUT_EXECUTABLES) HOST_OS=$(HOST_OS) \
1018 development/tools/scripts/sdk_clean.sh $(PRIVATE_DIR) && \
1019 chmod -R ug+rwX $(PRIVATE_DIR) && \
1020 cd $(dir $@) && zip -rq $(notdir $@) $(PRIVATE_NAME) \
1021 ) || ( rm -rf $(PRIVATE_DIR) $@ && exit 44 )
1025 # -----------------------------------------------------------------
1027 INTERNAL_FINDBUGS_XML_TARGET := $(PRODUCT_OUT)/findbugs.xml
1028 INTERNAL_FINDBUGS_HTML_TARGET := $(PRODUCT_OUT)/findbugs.html
1029 $(INTERNAL_FINDBUGS_XML_TARGET): $(ALL_FINDBUGS_FILES)
1031 $(hide) prebuilt/common/findbugs/bin/unionBugs $(ALL_FINDBUGS_FILES) \
1033 $(INTERNAL_FINDBUGS_HTML_TARGET): $(INTERNAL_FINDBUGS_XML_TARGET)
1034 @echo ConvertXmlToText: $@
1035 $(hide) prebuilt/common/findbugs/bin/convertXmlToText -html:fancy.xsl \
1036 $(INTERNAL_FINDBUGS_XML_TARGET) > $@
1038 # -----------------------------------------------------------------
1041 # -----------------------------------------------------------------
1042 # These are some additional build tasks that need to be run.
1043 include $(sort $(wildcard $(BUILD_SYSTEM)/tasks/*.mk))