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