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