2009-03-04 11:28:42 +08:00
|
|
|
# Put some miscellaneous rules here
|
|
|
|
|
|
|
|
# Pick a reasonable string to use to identify files.
|
|
|
|
ifneq "" "$(filter eng.%,$(BUILD_NUMBER))"
|
|
|
|
# BUILD_NUMBER has a timestamp in it, which means that
|
|
|
|
# it will change every time. Pick a stable value.
|
|
|
|
FILE_NAME_TAG := eng.$(USER)
|
|
|
|
else
|
|
|
|
FILE_NAME_TAG := $(BUILD_NUMBER)
|
|
|
|
endif
|
|
|
|
|
2012-03-14 09:58:27 +08:00
|
|
|
is_tests_build := $(filter tests,$(MAKECMDGOALS))
|
|
|
|
|
2009-03-04 11:28:42 +08:00
|
|
|
# -----------------------------------------------------------------
|
|
|
|
# Define rules to copy PRODUCT_COPY_FILES defined by the product.
|
2012-09-21 07:35:36 +08:00
|
|
|
# PRODUCT_COPY_FILES contains words like <source file>:<dest file>[:<owner>].
|
2009-03-04 11:28:42 +08:00
|
|
|
# <dest file> is relative to $(PRODUCT_OUT), so it should look like,
|
|
|
|
# e.g., "system/etc/file.xml".
|
2010-03-02 08:18:59 +08:00
|
|
|
# The filter part means "only eval the copy-one-file rule if this
|
2010-11-03 12:31:47 +08:00
|
|
|
# src:dest pair is the first one to match the same dest"
|
2011-09-30 04:23:25 +08:00
|
|
|
#$(1): the src:dest pair
|
|
|
|
define check-product-copy-files
|
|
|
|
$(if $(filter %.apk, $(1)),$(error \
|
|
|
|
Prebuilt apk found in PRODUCT_COPY_FILES: $(1), use BUILD_PREBUILT instead!))
|
|
|
|
endef
|
2012-09-06 09:08:29 +08:00
|
|
|
# filter out the duplicate <source file>:<dest file> pairs.
|
|
|
|
unique_product_copy_files_pairs :=
|
2009-03-04 11:28:42 +08:00
|
|
|
$(foreach cf,$(PRODUCT_COPY_FILES), \
|
2012-09-06 09:08:29 +08:00
|
|
|
$(if $(filter $(unique_product_copy_files_pairs),$(cf)),,\
|
|
|
|
$(eval unique_product_copy_files_pairs += $(cf))))
|
|
|
|
unique_product_copy_files_destinations :=
|
|
|
|
$(foreach cf,$(unique_product_copy_files_pairs), \
|
2010-11-03 12:31:47 +08:00
|
|
|
$(eval _src := $(call word-colon,1,$(cf))) \
|
|
|
|
$(eval _dest := $(call word-colon,2,$(cf))) \
|
2011-09-30 04:23:25 +08:00
|
|
|
$(call check-product-copy-files,$(cf)) \
|
2011-12-17 03:54:25 +08:00
|
|
|
$(if $(filter $(unique_product_copy_files_destinations),$(_dest)), \
|
|
|
|
$(info PRODUCT_COPY_FILES $(cf) ignored.), \
|
2010-11-03 12:31:47 +08:00
|
|
|
$(eval _fulldest := $(call append-path,$(PRODUCT_OUT),$(_dest))) \
|
2012-05-15 05:39:00 +08:00
|
|
|
$(if $(filter %.xml,$(_dest)),\
|
|
|
|
$(eval $(call copy-xml-file-checked,$(_src),$(_fulldest))),\
|
|
|
|
$(eval $(call copy-one-file,$(_src),$(_fulldest)))) \
|
2010-11-03 12:31:47 +08:00
|
|
|
$(eval ALL_DEFAULT_INSTALLED_MODULES += $(_fulldest)) \
|
2011-06-18 08:05:35 +08:00
|
|
|
$(eval unique_product_copy_files_destinations += $(_dest))))
|
2012-09-06 09:08:29 +08:00
|
|
|
unique_product_copy_files_pairs :=
|
2011-06-18 08:05:35 +08:00
|
|
|
unique_product_copy_files_destinations :=
|
2009-03-04 11:28:42 +08:00
|
|
|
|
|
|
|
# -----------------------------------------------------------------
|
|
|
|
# docs/index.html
|
2012-04-03 09:21:36 +08:00
|
|
|
ifeq (,$(TARGET_BUILD_APPS))
|
2009-03-04 11:28:42 +08:00
|
|
|
gen := $(OUT_DOCS)/index.html
|
|
|
|
ALL_DOCS += $(gen)
|
|
|
|
$(gen): frameworks/base/docs/docs-redirect-index.html
|
|
|
|
@mkdir -p $(dir $@)
|
|
|
|
@cp -f $< $@
|
2012-04-03 09:21:36 +08:00
|
|
|
endif
|
2009-03-04 11:28:42 +08:00
|
|
|
|
|
|
|
# -----------------------------------------------------------------
|
|
|
|
# default.prop
|
|
|
|
INSTALLED_DEFAULT_PROP_TARGET := $(TARGET_ROOT_OUT)/default.prop
|
|
|
|
ALL_DEFAULT_INSTALLED_MODULES += $(INSTALLED_DEFAULT_PROP_TARGET)
|
|
|
|
ADDITIONAL_DEFAULT_PROPERTIES := \
|
2011-06-18 08:05:35 +08:00
|
|
|
$(call collapse-pairs, $(ADDITIONAL_DEFAULT_PROPERTIES))
|
2011-06-10 05:54:40 +08:00
|
|
|
ADDITIONAL_DEFAULT_PROPERTIES += \
|
2011-06-18 08:05:35 +08:00
|
|
|
$(call collapse-pairs, $(PRODUCT_DEFAULT_PROPERTY_OVERRIDES))
|
|
|
|
ADDITIONAL_DEFAULT_PROPERTIES := $(call uniq-pairs-by-first-component, \
|
|
|
|
$(ADDITIONAL_DEFAULT_PROPERTIES),=)
|
2009-03-04 11:28:42 +08:00
|
|
|
|
|
|
|
$(INSTALLED_DEFAULT_PROP_TARGET):
|
|
|
|
@echo Target buildinfo: $@
|
|
|
|
@mkdir -p $(dir $@)
|
|
|
|
$(hide) echo "#" > $@; \
|
|
|
|
echo "# ADDITIONAL_DEFAULT_PROPERTIES" >> $@; \
|
|
|
|
echo "#" >> $@;
|
2010-09-08 01:51:12 +08:00
|
|
|
$(hide) $(foreach line,$(ADDITIONAL_DEFAULT_PROPERTIES), \
|
|
|
|
echo "$(line)" >> $@;)
|
2011-06-09 07:04:14 +08:00
|
|
|
build/tools/post_process_props.py $@
|
2009-03-04 11:28:42 +08:00
|
|
|
|
|
|
|
# -----------------------------------------------------------------
|
|
|
|
# build.prop
|
|
|
|
INSTALLED_BUILD_PROP_TARGET := $(TARGET_OUT)/build.prop
|
|
|
|
ALL_DEFAULT_INSTALLED_MODULES += $(INSTALLED_BUILD_PROP_TARGET)
|
|
|
|
ADDITIONAL_BUILD_PROPERTIES := \
|
2011-06-18 08:05:35 +08:00
|
|
|
$(call collapse-pairs, $(ADDITIONAL_BUILD_PROPERTIES))
|
|
|
|
ADDITIONAL_BUILD_PROPERTIES := $(call uniq-pairs-by-first-component, \
|
|
|
|
$(ADDITIONAL_BUILD_PROPERTIES),=)
|
2009-03-04 11:28:42 +08:00
|
|
|
|
|
|
|
# A list of arbitrary tags describing the build configuration.
|
|
|
|
# Force ":=" so we can use +=
|
|
|
|
BUILD_VERSION_TAGS := $(BUILD_VERSION_TAGS)
|
|
|
|
ifeq ($(TARGET_BUILD_TYPE),debug)
|
|
|
|
BUILD_VERSION_TAGS += debug
|
|
|
|
endif
|
2011-10-06 03:41:56 +08:00
|
|
|
# The "test-keys" tag marks builds signed with the old test keys,
|
|
|
|
# which are available in the SDK. "dev-keys" marks builds signed with
|
|
|
|
# non-default dev keys (usually private keys from a vendor directory).
|
|
|
|
# Both of these tags will be removed and replaced with "release-keys"
|
|
|
|
# when the target-files is signed in a post-build step.
|
|
|
|
ifeq ($(DEFAULT_SYSTEM_DEV_CERTIFICATE),build/target/product/security/testkey)
|
|
|
|
BUILD_VERSION_TAGS += test-keys
|
|
|
|
else
|
2011-10-05 01:50:08 +08:00
|
|
|
BUILD_VERSION_TAGS += dev-keys
|
2011-10-06 03:41:56 +08:00
|
|
|
endif
|
2009-03-04 11:28:42 +08:00
|
|
|
BUILD_VERSION_TAGS := $(subst $(space),$(comma),$(sort $(BUILD_VERSION_TAGS)))
|
|
|
|
|
|
|
|
# A human-readable string that descibes this build in detail.
|
|
|
|
build_desc := $(TARGET_PRODUCT)-$(TARGET_BUILD_VARIANT) $(PLATFORM_VERSION) $(BUILD_ID) $(BUILD_NUMBER) $(BUILD_VERSION_TAGS)
|
|
|
|
$(INSTALLED_BUILD_PROP_TARGET): PRIVATE_BUILD_DESC := $(build_desc)
|
|
|
|
|
|
|
|
# The string used to uniquely identify this build; used by the OTA server.
|
|
|
|
ifeq (,$(strip $(BUILD_FINGERPRINT)))
|
2010-09-16 04:02:12 +08:00
|
|
|
BUILD_FINGERPRINT := $(PRODUCT_BRAND)/$(TARGET_PRODUCT)/$(TARGET_DEVICE):$(PLATFORM_VERSION)/$(BUILD_ID)/$(BUILD_NUMBER):$(TARGET_BUILD_VARIANT)/$(BUILD_VERSION_TAGS)
|
2009-03-04 11:28:42 +08:00
|
|
|
endif
|
|
|
|
ifneq ($(words $(BUILD_FINGERPRINT)),1)
|
|
|
|
$(error BUILD_FINGERPRINT cannot contain spaces: "$(BUILD_FINGERPRINT)")
|
|
|
|
endif
|
|
|
|
|
2009-03-25 13:40:59 +08:00
|
|
|
# Display parameters shown under Settings -> About Phone
|
|
|
|
ifeq ($(TARGET_BUILD_VARIANT),user)
|
|
|
|
# User builds should show:
|
|
|
|
# release build number or branch.buld_number non-release builds
|
|
|
|
|
|
|
|
# Dev. branches should have DISPLAY_BUILD_NUMBER set
|
|
|
|
ifeq "true" "$(DISPLAY_BUILD_NUMBER)"
|
|
|
|
BUILD_DISPLAY_ID := $(BUILD_ID).$(BUILD_NUMBER)
|
|
|
|
else
|
|
|
|
BUILD_DISPLAY_ID := $(BUILD_ID)
|
|
|
|
endif
|
|
|
|
else
|
|
|
|
# Non-user builds should show detailed build information
|
|
|
|
BUILD_DISPLAY_ID := $(build_desc)
|
|
|
|
endif
|
|
|
|
|
2010-04-28 06:45:35 +08:00
|
|
|
# Whether there is default locale set in PRODUCT_PROPERTY_OVERRIDES
|
2010-07-22 05:58:42 +08:00
|
|
|
product_property_override_locale_language := $(strip \
|
|
|
|
$(patsubst ro.product.locale.language=%,%,\
|
2010-04-28 06:45:35 +08:00
|
|
|
$(filter ro.product.locale.language=%,$(PRODUCT_PROPERTY_OVERRIDES))))
|
2010-07-22 05:58:42 +08:00
|
|
|
product_property_overrides_locale_region := $(strip \
|
|
|
|
$(patsubst ro.product.locale.region=%,%,\
|
2010-04-28 06:45:35 +08:00
|
|
|
$(filter ro.product.locale.region=%,$(PRODUCT_PROPERTY_OVERRIDES))))
|
|
|
|
|
2009-03-04 11:28:42 +08:00
|
|
|
# Selects the first locale in the list given as the argument,
|
|
|
|
# and splits it into language and region, which each may be
|
|
|
|
# empty.
|
|
|
|
define default-locale
|
|
|
|
$(subst _, , $(firstword $(1)))
|
|
|
|
endef
|
|
|
|
|
|
|
|
# Selects the first locale in the list given as the argument
|
2010-04-28 06:45:35 +08:00
|
|
|
# and returns the language (or the region), if it's not set in PRODUCT_PROPERTY_OVERRIDES;
|
|
|
|
# Return empty string if it's already set in PRODUCT_PROPERTY_OVERRIDES.
|
2009-03-04 11:28:42 +08:00
|
|
|
define default-locale-language
|
2010-07-22 05:58:42 +08:00
|
|
|
$(if $(product_property_override_locale_language),,$(word 1, $(call default-locale, $(1))))
|
2009-03-04 11:28:42 +08:00
|
|
|
endef
|
|
|
|
define default-locale-region
|
2010-07-22 05:58:42 +08:00
|
|
|
$(if $(product_property_overrides_locale_region),,$(word 2, $(call default-locale, $(1))))
|
2009-03-04 11:28:42 +08:00
|
|
|
endef
|
|
|
|
|
|
|
|
BUILDINFO_SH := build/tools/buildinfo.sh
|
2010-11-03 18:33:46 +08:00
|
|
|
$(INSTALLED_BUILD_PROP_TARGET): $(BUILDINFO_SH) $(INTERNAL_BUILD_ID_MAKEFILE) $(BUILD_SYSTEM)/version_defaults.mk $(wildcard $(TARGET_DEVICE_DIR)/system.prop)
|
2009-03-04 11:28:42 +08:00
|
|
|
@echo Target buildinfo: $@
|
|
|
|
@mkdir -p $(dir $@)
|
|
|
|
$(hide) TARGET_BUILD_TYPE="$(TARGET_BUILD_VARIANT)" \
|
|
|
|
TARGET_DEVICE="$(TARGET_DEVICE)" \
|
|
|
|
PRODUCT_NAME="$(TARGET_PRODUCT)" \
|
|
|
|
PRODUCT_BRAND="$(PRODUCT_BRAND)" \
|
|
|
|
PRODUCT_DEFAULT_LANGUAGE="$(call default-locale-language,$(PRODUCT_LOCALES))" \
|
|
|
|
PRODUCT_DEFAULT_REGION="$(call default-locale-region,$(PRODUCT_LOCALES))" \
|
2009-05-21 04:37:35 +08:00
|
|
|
PRODUCT_DEFAULT_WIFI_CHANNELS="$(PRODUCT_DEFAULT_WIFI_CHANNELS)" \
|
2009-03-04 11:28:42 +08:00
|
|
|
PRODUCT_MODEL="$(PRODUCT_MODEL)" \
|
|
|
|
PRODUCT_MANUFACTURER="$(PRODUCT_MANUFACTURER)" \
|
|
|
|
PRIVATE_BUILD_DESC="$(PRIVATE_BUILD_DESC)" \
|
|
|
|
BUILD_ID="$(BUILD_ID)" \
|
|
|
|
BUILD_DISPLAY_ID="$(BUILD_DISPLAY_ID)" \
|
|
|
|
BUILD_NUMBER="$(BUILD_NUMBER)" \
|
|
|
|
PLATFORM_VERSION="$(PLATFORM_VERSION)" \
|
|
|
|
PLATFORM_SDK_VERSION="$(PLATFORM_SDK_VERSION)" \
|
2009-05-09 03:06:17 +08:00
|
|
|
PLATFORM_VERSION_CODENAME="$(PLATFORM_VERSION_CODENAME)" \
|
2009-03-04 11:28:42 +08:00
|
|
|
BUILD_VERSION_TAGS="$(BUILD_VERSION_TAGS)" \
|
|
|
|
TARGET_BOOTLOADER_BOARD_NAME="$(TARGET_BOOTLOADER_BOARD_NAME)" \
|
|
|
|
BUILD_FINGERPRINT="$(BUILD_FINGERPRINT)" \
|
|
|
|
TARGET_BOARD_PLATFORM="$(TARGET_BOARD_PLATFORM)" \
|
2009-05-22 06:45:30 +08:00
|
|
|
TARGET_CPU_ABI="$(TARGET_CPU_ABI)" \
|
2009-11-07 07:12:00 +08:00
|
|
|
TARGET_CPU_ABI2="$(TARGET_CPU_ABI2)" \
|
2010-11-10 00:53:01 +08:00
|
|
|
TARGET_AAPT_CHARACTERISTICS="$(TARGET_AAPT_CHARACTERISTICS)" \
|
2009-03-04 11:28:42 +08:00
|
|
|
bash $(BUILDINFO_SH) > $@
|
|
|
|
$(hide) if [ -f $(TARGET_DEVICE_DIR)/system.prop ]; then \
|
|
|
|
cat $(TARGET_DEVICE_DIR)/system.prop >> $@; \
|
|
|
|
fi
|
|
|
|
$(if $(ADDITIONAL_BUILD_PROPERTIES), \
|
|
|
|
$(hide) echo >> $@; \
|
|
|
|
echo "#" >> $@; \
|
|
|
|
echo "# ADDITIONAL_BUILD_PROPERTIES" >> $@; \
|
|
|
|
echo "#" >> $@; )
|
2010-09-08 01:51:12 +08:00
|
|
|
$(hide) $(foreach line,$(ADDITIONAL_BUILD_PROPERTIES), \
|
|
|
|
echo "$(line)" >> $@;)
|
2011-06-09 07:04:14 +08:00
|
|
|
$(hide) build/tools/post_process_props.py $@
|
2009-03-04 11:28:42 +08:00
|
|
|
|
|
|
|
build_desc :=
|
|
|
|
|
|
|
|
# -----------------------------------------------------------------
|
|
|
|
# sdk-build.prop
|
|
|
|
#
|
|
|
|
# There are certain things in build.prop that we don't want to
|
|
|
|
# ship with the sdk; remove them.
|
|
|
|
|
|
|
|
# This must be a list of entire property keys followed by
|
|
|
|
# "=" characters, without any internal spaces.
|
|
|
|
sdk_build_prop_remove := \
|
|
|
|
ro.build.user= \
|
|
|
|
ro.build.host= \
|
|
|
|
ro.product.brand= \
|
|
|
|
ro.product.manufacturer= \
|
|
|
|
ro.product.device=
|
|
|
|
# TODO: Remove this soon-to-be obsolete property
|
|
|
|
sdk_build_prop_remove += ro.build.product=
|
|
|
|
INSTALLED_SDK_BUILD_PROP_TARGET := $(PRODUCT_OUT)/sdk/sdk-build.prop
|
|
|
|
$(INSTALLED_SDK_BUILD_PROP_TARGET): $(INSTALLED_BUILD_PROP_TARGET)
|
|
|
|
@echo SDK buildinfo: $@
|
|
|
|
@mkdir -p $(dir $@)
|
|
|
|
$(hide) grep -v "$(subst $(space),\|,$(strip \
|
|
|
|
$(sdk_build_prop_remove)))" $< > $@.tmp
|
|
|
|
$(hide) for x in $(sdk_build_prop_remove); do \
|
|
|
|
echo "$$x"generic >> $@.tmp; done
|
|
|
|
$(hide) mv $@.tmp $@
|
|
|
|
|
|
|
|
# -----------------------------------------------------------------
|
|
|
|
# package stats
|
|
|
|
PACKAGE_STATS_FILE := $(PRODUCT_OUT)/package-stats.txt
|
|
|
|
PACKAGES_TO_STAT := \
|
|
|
|
$(sort $(filter $(TARGET_OUT)/% $(TARGET_OUT_DATA)/%, \
|
|
|
|
$(filter %.jar %.apk, $(ALL_DEFAULT_INSTALLED_MODULES))))
|
|
|
|
$(PACKAGE_STATS_FILE): $(PACKAGES_TO_STAT)
|
|
|
|
@echo Package stats: $@
|
|
|
|
@mkdir -p $(dir $@)
|
|
|
|
$(hide) rm -f $@
|
|
|
|
$(hide) build/tools/dump-package-stats $^ > $@
|
|
|
|
|
|
|
|
.PHONY: package-stats
|
|
|
|
package-stats: $(PACKAGE_STATS_FILE)
|
|
|
|
|
|
|
|
# -----------------------------------------------------------------
|
|
|
|
# Cert-to-package mapping. Used by the post-build signing tools.
|
2012-10-27 00:21:28 +08:00
|
|
|
# Use a macro to add newline to each echo command
|
|
|
|
define _apkcerts_echo_with_newline
|
|
|
|
$(hide) echo $(1)
|
|
|
|
|
|
|
|
endef
|
|
|
|
|
2009-03-04 11:28:42 +08:00
|
|
|
name := $(TARGET_PRODUCT)
|
|
|
|
ifeq ($(TARGET_BUILD_TYPE),debug)
|
|
|
|
name := $(name)_debug
|
|
|
|
endif
|
|
|
|
name := $(name)-apkcerts-$(FILE_NAME_TAG)
|
|
|
|
intermediates := \
|
|
|
|
$(call intermediates-dir-for,PACKAGING,apkcerts)
|
|
|
|
APKCERTS_FILE := $(intermediates)/$(name).txt
|
2011-02-16 02:56:18 +08:00
|
|
|
# We don't need to really build all the modules.
|
|
|
|
# TODO: rebuild APKCERTS_FILE if any app change its cert.
|
2010-07-24 07:42:13 +08:00
|
|
|
$(APKCERTS_FILE):
|
2009-03-04 11:28:42 +08:00
|
|
|
@echo APK certs list: $@
|
|
|
|
@mkdir -p $(dir $@)
|
|
|
|
@rm -f $@
|
2012-10-27 00:21:28 +08:00
|
|
|
$(foreach p,$(PACKAGES),\
|
|
|
|
$(if $(PACKAGES.$(p).EXTERNAL_KEY),\
|
|
|
|
$(call _apkcerts_echo_with_newline,\
|
|
|
|
'name="$(p).apk" certificate="EXTERNAL" \
|
|
|
|
private_key=""' >> $@),\
|
|
|
|
$(call _apkcerts_echo_with_newline,\
|
|
|
|
'name="$(p).apk" certificate="$(PACKAGES.$(p).CERTIFICATE)" \
|
|
|
|
private_key="$(PACKAGES.$(p).PRIVATE_KEY)"' >> $@)))
|
|
|
|
# In case value of PACKAGES is empty.
|
2011-09-27 03:05:06 +08:00
|
|
|
$(hide) touch $@
|
2009-03-04 11:28:42 +08:00
|
|
|
|
|
|
|
.PHONY: apkcerts-list
|
|
|
|
apkcerts-list: $(APKCERTS_FILE)
|
|
|
|
|
2011-02-16 02:56:18 +08:00
|
|
|
ifneq (,$(TARGET_BUILD_APPS))
|
|
|
|
$(call dist-for-goals, apps_only, $(APKCERTS_FILE):apkcerts.txt)
|
|
|
|
endif
|
2010-07-24 07:42:13 +08:00
|
|
|
|
2009-03-04 11:28:42 +08:00
|
|
|
# -----------------------------------------------------------------
|
|
|
|
# module info file
|
|
|
|
ifdef CREATE_MODULE_INFO_FILE
|
|
|
|
MODULE_INFO_FILE := $(PRODUCT_OUT)/module-info.txt
|
|
|
|
$(info Generating $(MODULE_INFO_FILE)...)
|
|
|
|
$(shell rm -f $(MODULE_INFO_FILE))
|
|
|
|
$(foreach m,$(ALL_MODULES), \
|
|
|
|
$(shell echo "NAME=\"$(m)\"" \
|
|
|
|
"PATH=\"$(strip $(ALL_MODULES.$(m).PATH))\"" \
|
|
|
|
"TAGS=\"$(strip $(filter-out _%,$(ALL_MODULES.$(m).TAGS)))\"" \
|
|
|
|
"BUILT=\"$(strip $(ALL_MODULES.$(m).BUILT))\"" \
|
|
|
|
"INSTALLED=\"$(strip $(ALL_MODULES.$(m).INSTALLED))\"" >> $(MODULE_INFO_FILE)))
|
|
|
|
endif
|
|
|
|
|
2009-06-16 05:30:14 +08:00
|
|
|
# -----------------------------------------------------------------
|
|
|
|
|
2011-10-05 01:50:08 +08:00
|
|
|
# The dev key is used to sign this package, and as the key required
|
2009-06-16 05:30:14 +08:00
|
|
|
# for future OTA packages installed by this system. Actual product
|
|
|
|
# deliverables will be re-signed by hand. We expect this file to
|
|
|
|
# exist with the suffixes ".x509.pem" and ".pk8".
|
2011-10-05 01:50:08 +08:00
|
|
|
DEFAULT_KEY_CERT_PAIR := $(DEFAULT_SYSTEM_DEV_CERTIFICATE)
|
2009-06-16 05:30:14 +08:00
|
|
|
|
|
|
|
|
2011-07-12 13:11:46 +08:00
|
|
|
# Rules that need to be present for the all targets, even
|
2009-03-04 11:28:42 +08:00
|
|
|
# if they don't do anything.
|
|
|
|
.PHONY: systemimage
|
|
|
|
systemimage:
|
|
|
|
|
2010-02-17 08:01:43 +08:00
|
|
|
# -----------------------------------------------------------------
|
|
|
|
|
|
|
|
.PHONY: event-log-tags
|
|
|
|
|
2010-07-15 01:22:54 +08:00
|
|
|
# Produce an event logs tag file for everything we know about, in order
|
|
|
|
# to properly allocate numbers. Then produce a file that's filtered
|
|
|
|
# for what's going to be installed.
|
|
|
|
|
|
|
|
all_event_log_tags_file := $(TARGET_OUT_COMMON_INTERMEDIATES)/all-event-log-tags.txt
|
|
|
|
|
2012-04-13 04:25:54 +08:00
|
|
|
event_log_tags_file := $(TARGET_OUT)/etc/event-log-tags
|
|
|
|
|
2010-07-15 01:22:54 +08:00
|
|
|
# Include tags from all packages that we know about
|
|
|
|
all_event_log_tags_src := \
|
|
|
|
$(sort $(foreach m, $(ALL_MODULES), $(ALL_MODULES.$(m).EVENT_LOG_TAGS)))
|
|
|
|
|
2012-04-13 04:25:54 +08:00
|
|
|
# PDK builds will already have a full list of tags that needs to get merged
|
|
|
|
# in with the ones from source
|
|
|
|
pdk_fusion_log_tags_file := $(patsubst $(PRODUCT_OUT)/%,$(_pdk_fusion_intermediates)/%,$(filter $(event_log_tags_file),$(ALL_PDK_FUSION_FILES)))
|
|
|
|
|
|
|
|
$(all_event_log_tags_file): PRIVATE_SRC_FILES := $(all_event_log_tags_src) $(pdk_fusion_log_tags_file)
|
|
|
|
$(all_event_log_tags_file): $(all_event_log_tags_src) $(pdk_fusion_log_tags_file)
|
2010-07-15 01:22:54 +08:00
|
|
|
$(hide) mkdir -p $(dir $@)
|
|
|
|
$(hide) build/tools/merge-event-log-tags.py -o $@ $(PRIVATE_SRC_FILES)
|
|
|
|
|
2011-02-24 04:17:29 +08:00
|
|
|
# Include tags from all packages included in this product, plus all
|
|
|
|
# tags that are part of the system (ie, not in a vendor/ or device/
|
|
|
|
# directory).
|
2010-02-17 08:01:43 +08:00
|
|
|
event_log_tags_src := \
|
|
|
|
$(sort $(foreach m,\
|
|
|
|
$(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES) \
|
|
|
|
$(call module-names-for-tag-list,user), \
|
2011-02-24 04:17:29 +08:00
|
|
|
$(ALL_MODULES.$(m).EVENT_LOG_TAGS)) \
|
|
|
|
$(filter-out vendor/% device/% out/%,$(all_event_log_tags_src)))
|
2010-02-17 08:01:43 +08:00
|
|
|
|
2012-04-13 04:25:54 +08:00
|
|
|
$(event_log_tags_file): PRIVATE_SRC_FILES := $(event_log_tags_src) $(pdk_fusion_log_tags_file)
|
2010-07-15 01:22:54 +08:00
|
|
|
$(event_log_tags_file): PRIVATE_MERGED_FILE := $(all_event_log_tags_file)
|
2012-04-13 04:25:54 +08:00
|
|
|
$(event_log_tags_file): $(event_log_tags_src) $(all_event_log_tags_file) $(pdk_fusion_log_tags_file)
|
2010-02-17 08:01:43 +08:00
|
|
|
$(hide) mkdir -p $(dir $@)
|
2010-07-15 01:22:54 +08:00
|
|
|
$(hide) build/tools/merge-event-log-tags.py -o $@ -m $(PRIVATE_MERGED_FILE) $(PRIVATE_SRC_FILES)
|
2010-02-17 08:01:43 +08:00
|
|
|
|
|
|
|
event-log-tags: $(event_log_tags_file)
|
|
|
|
|
|
|
|
ALL_DEFAULT_INSTALLED_MODULES += $(event_log_tags_file)
|
|
|
|
|
2010-07-15 01:22:54 +08:00
|
|
|
|
2009-03-04 11:28:42 +08:00
|
|
|
# #################################################################
|
|
|
|
# Targets for boot/OS images
|
|
|
|
# #################################################################
|
|
|
|
|
|
|
|
# -----------------------------------------------------------------
|
|
|
|
# the ramdisk
|
|
|
|
INTERNAL_RAMDISK_FILES := $(filter $(TARGET_ROOT_OUT)/%, \
|
|
|
|
$(ALL_PREBUILT) \
|
|
|
|
$(ALL_COPIED_HEADERS) \
|
|
|
|
$(ALL_GENERATED_SOURCES) \
|
|
|
|
$(ALL_DEFAULT_INSTALLED_MODULES))
|
|
|
|
|
2009-04-10 10:31:12 +08:00
|
|
|
BUILT_RAMDISK_TARGET := $(PRODUCT_OUT)/ramdisk.img
|
|
|
|
|
|
|
|
# We just build this directly to the install location.
|
|
|
|
INSTALLED_RAMDISK_TARGET := $(BUILT_RAMDISK_TARGET)
|
2012-08-14 06:03:00 +08:00
|
|
|
$(INSTALLED_RAMDISK_TARGET): $(MKBOOTFS) $(INTERNAL_RAMDISK_FILES) | $(MINIGZIP)
|
2009-03-04 11:28:42 +08:00
|
|
|
$(call pretty,"Target ram disk: $@")
|
2009-05-28 00:14:25 +08:00
|
|
|
$(hide) $(MKBOOTFS) $(TARGET_ROOT_OUT) | $(MINIGZIP) > $@
|
2009-03-04 11:28:42 +08:00
|
|
|
|
|
|
|
|
|
|
|
ifneq ($(strip $(TARGET_NO_KERNEL)),true)
|
|
|
|
|
|
|
|
# -----------------------------------------------------------------
|
|
|
|
# the boot image, which is a collection of other images.
|
|
|
|
INTERNAL_BOOTIMAGE_ARGS := \
|
|
|
|
$(addprefix --second ,$(INSTALLED_2NDBOOTLOADER_TARGET)) \
|
|
|
|
--kernel $(INSTALLED_KERNEL_TARGET) \
|
|
|
|
--ramdisk $(INSTALLED_RAMDISK_TARGET)
|
|
|
|
|
|
|
|
INTERNAL_BOOTIMAGE_FILES := $(filter-out --%,$(INTERNAL_BOOTIMAGE_ARGS))
|
|
|
|
|
|
|
|
BOARD_KERNEL_CMDLINE := $(strip $(BOARD_KERNEL_CMDLINE))
|
|
|
|
ifdef BOARD_KERNEL_CMDLINE
|
|
|
|
INTERNAL_BOOTIMAGE_ARGS += --cmdline "$(BOARD_KERNEL_CMDLINE)"
|
|
|
|
endif
|
|
|
|
|
2009-05-08 10:43:08 +08:00
|
|
|
BOARD_KERNEL_BASE := $(strip $(BOARD_KERNEL_BASE))
|
|
|
|
ifdef BOARD_KERNEL_BASE
|
|
|
|
INTERNAL_BOOTIMAGE_ARGS += --base $(BOARD_KERNEL_BASE)
|
|
|
|
endif
|
|
|
|
|
2010-08-24 03:56:25 +08:00
|
|
|
BOARD_KERNEL_PAGESIZE := $(strip $(BOARD_KERNEL_PAGESIZE))
|
|
|
|
ifdef BOARD_KERNEL_PAGESIZE
|
|
|
|
INTERNAL_BOOTIMAGE_ARGS += --pagesize $(BOARD_KERNEL_PAGESIZE)
|
|
|
|
endif
|
|
|
|
|
2009-03-04 11:28:42 +08:00
|
|
|
INSTALLED_BOOTIMAGE_TARGET := $(PRODUCT_OUT)/boot.img
|
|
|
|
|
|
|
|
ifeq ($(TARGET_BOOTIMAGE_USE_EXT2),true)
|
|
|
|
tmp_dir_for_image := $(call intermediates-dir-for,EXECUTABLES,boot_img)/bootimg
|
|
|
|
INTERNAL_BOOTIMAGE_ARGS += --tmpdir $(tmp_dir_for_image)
|
|
|
|
INTERNAL_BOOTIMAGE_ARGS += --genext2fs $(MKEXT2IMG)
|
|
|
|
$(INSTALLED_BOOTIMAGE_TARGET): $(MKEXT2IMG) $(INTERNAL_BOOTIMAGE_FILES)
|
|
|
|
$(call pretty,"Target boot image: $@")
|
|
|
|
$(hide) $(MKEXT2BOOTIMG) $(INTERNAL_BOOTIMAGE_ARGS) --output $@
|
|
|
|
|
|
|
|
else # TARGET_BOOTIMAGE_USE_EXT2 != true
|
|
|
|
|
|
|
|
$(INSTALLED_BOOTIMAGE_TARGET): $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_FILES)
|
|
|
|
$(call pretty,"Target boot image: $@")
|
2012-08-03 05:46:42 +08:00
|
|
|
$(hide) $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_ARGS) $(BOARD_MKBOOTIMG_ARGS) --output $@
|
2009-08-27 00:37:07 +08:00
|
|
|
$(hide) $(call assert-max-image-size,$@,$(BOARD_BOOTIMAGE_PARTITION_SIZE),raw)
|
2009-03-04 11:28:42 +08:00
|
|
|
endif # TARGET_BOOTIMAGE_USE_EXT2
|
|
|
|
|
|
|
|
else # TARGET_NO_KERNEL
|
|
|
|
# HACK: The top-level targets depend on the bootimage. Not all targets
|
|
|
|
# can produce a bootimage, though, and emulator targets need the ramdisk
|
|
|
|
# instead. Fake it out by calling the ramdisk the bootimage.
|
|
|
|
# TODO: make the emulator use bootimages, and make mkbootimg accept
|
|
|
|
# kernel-less inputs.
|
|
|
|
INSTALLED_BOOTIMAGE_TARGET := $(INSTALLED_RAMDISK_TARGET)
|
|
|
|
endif
|
|
|
|
|
|
|
|
# -----------------------------------------------------------------
|
|
|
|
# NOTICE files
|
|
|
|
#
|
2012-03-01 19:34:41 +08:00
|
|
|
# We are required to publish the licenses for all code under BSD, GPL and
|
|
|
|
# Apache licenses (and possibly other more exotic ones as well). We err on the
|
|
|
|
# side of caution, so the licenses for other third-party code are included here
|
|
|
|
# too.
|
|
|
|
#
|
2009-03-04 11:28:42 +08:00
|
|
|
# This needs to be before the systemimage rules, because it adds to
|
|
|
|
# ALL_DEFAULT_INSTALLED_MODULES, which those use to pick which files
|
|
|
|
# go into the systemimage.
|
|
|
|
|
2012-03-01 03:18:08 +08:00
|
|
|
.PHONY: notice_files
|
|
|
|
|
2009-03-04 11:28:42 +08:00
|
|
|
# Create the rule to combine the files into text and html forms
|
2012-03-01 03:18:08 +08:00
|
|
|
# $(1) - Plain text output file
|
|
|
|
# $(2) - HTML output file
|
|
|
|
# $(3) - File title
|
|
|
|
# $(4) - Directory to use. Notice files are all $(4)/src. Other
|
2009-03-04 11:28:42 +08:00
|
|
|
# directories in there will be used for scratch
|
2012-03-01 03:18:08 +08:00
|
|
|
# $(5) - Dependencies for the output files
|
2009-03-04 11:28:42 +08:00
|
|
|
#
|
|
|
|
# The algorithm here is that we go collect a hash for each of the notice
|
|
|
|
# files and write the names of the files that match that hash. Then
|
|
|
|
# to generate the real files, we go print out all of the files and their
|
|
|
|
# hashes.
|
|
|
|
#
|
|
|
|
# These rules are fairly complex, so they depend on this makefile so if
|
|
|
|
# it changes, they'll run again.
|
|
|
|
#
|
|
|
|
# TODO: We could clean this up so that we just record the locations of the
|
|
|
|
# original notice files instead of making rules to copy them somwehere.
|
|
|
|
# Then we could traverse that without quite as much bash drama.
|
|
|
|
define combine-notice-files
|
2012-03-01 03:18:08 +08:00
|
|
|
$(1) $(2): PRIVATE_MESSAGE := $(3)
|
2012-03-29 22:33:19 +08:00
|
|
|
$(1) $(2): PRIVATE_DIR := $(4)
|
2012-04-10 03:16:23 +08:00
|
|
|
$(1) : $(2)
|
|
|
|
$(2) : $(5) $(BUILD_SYSTEM)/Makefile build/tools/generate-notice-files.py
|
2012-03-29 22:33:19 +08:00
|
|
|
build/tools/generate-notice-files.py $(1) $(2) $$(PRIVATE_MESSAGE) $$(PRIVATE_DIR)/src
|
2012-03-01 03:18:08 +08:00
|
|
|
notice_files: $(1) $(2)
|
2009-03-04 11:28:42 +08:00
|
|
|
endef
|
|
|
|
|
|
|
|
# TODO These intermediate NOTICE.txt/NOTICE.html files should go into
|
|
|
|
# TARGET_OUT_NOTICE_FILES now that the notice files are gathered from
|
|
|
|
# the src subdirectory.
|
|
|
|
|
2012-03-01 03:18:08 +08:00
|
|
|
target_notice_file_txt := $(TARGET_OUT_INTERMEDIATES)/NOTICE.txt
|
2009-03-04 11:28:42 +08:00
|
|
|
target_notice_file_html := $(TARGET_OUT_INTERMEDIATES)/NOTICE.html
|
|
|
|
target_notice_file_html_gz := $(TARGET_OUT_INTERMEDIATES)/NOTICE.html.gz
|
2012-03-01 03:18:08 +08:00
|
|
|
tools_notice_file_txt := $(HOST_OUT_INTERMEDIATES)/NOTICE.txt
|
2009-03-04 11:28:42 +08:00
|
|
|
tools_notice_file_html := $(HOST_OUT_INTERMEDIATES)/NOTICE.html
|
|
|
|
|
|
|
|
kernel_notice_file := $(TARGET_OUT_NOTICE_FILES)/src/kernel.txt
|
2012-04-10 08:04:12 +08:00
|
|
|
pdk_fusion_notice_files := $(filter $(TARGET_OUT_NOTICE_FILES)/%, $(ALL_PDK_FUSION_FILES))
|
2009-03-04 11:28:42 +08:00
|
|
|
|
|
|
|
$(eval $(call combine-notice-files, \
|
2012-03-01 03:18:08 +08:00
|
|
|
$(target_notice_file_txt), \
|
2009-03-04 11:28:42 +08:00
|
|
|
$(target_notice_file_html), \
|
|
|
|
"Notices for files contained in the filesystem images in this directory:", \
|
|
|
|
$(TARGET_OUT_NOTICE_FILES), \
|
2012-04-10 08:04:12 +08:00
|
|
|
$(ALL_DEFAULT_INSTALLED_MODULES) $(kernel_notice_file) $(pdk_fusion_notice_files)))
|
2009-03-04 11:28:42 +08:00
|
|
|
|
|
|
|
$(eval $(call combine-notice-files, \
|
2012-03-01 03:18:08 +08:00
|
|
|
$(tools_notice_file_txt), \
|
2009-03-04 11:28:42 +08:00
|
|
|
$(tools_notice_file_html), \
|
|
|
|
"Notices for files contained in the tools directory:", \
|
|
|
|
$(HOST_OUT_NOTICE_FILES), \
|
|
|
|
$(ALL_DEFAULT_INSTALLED_MODULES)))
|
|
|
|
|
|
|
|
# Install the html file at /system/etc/NOTICE.html.gz.
|
|
|
|
# This is not ideal, but this is very late in the game, after a lot of
|
|
|
|
# the module processing has already been done -- in fact, we used the
|
|
|
|
# fact that all that has been done to get the list of modules that we
|
|
|
|
# need notice files for.
|
2009-05-28 00:14:25 +08:00
|
|
|
$(target_notice_file_html_gz): $(target_notice_file_html) | $(MINIGZIP)
|
2009-06-16 05:30:14 +08:00
|
|
|
$(hide) $(MINIGZIP) -9 < $< > $@
|
2009-03-04 11:28:42 +08:00
|
|
|
installed_notice_html_gz := $(TARGET_OUT)/etc/NOTICE.html.gz
|
|
|
|
$(installed_notice_html_gz): $(target_notice_file_html_gz) | $(ACP)
|
|
|
|
$(copy-file-to-target)
|
2009-05-01 04:52:50 +08:00
|
|
|
|
|
|
|
# if we've been run my mm, mmm, etc, don't reinstall this every time
|
|
|
|
ifeq ($(ONE_SHOT_MAKEFILE),)
|
2009-03-04 11:28:42 +08:00
|
|
|
ALL_DEFAULT_INSTALLED_MODULES += $(installed_notice_html_gz)
|
2009-05-01 04:52:50 +08:00
|
|
|
endif
|
2009-03-04 11:28:42 +08:00
|
|
|
|
|
|
|
# The kernel isn't really a module, so to get its module file in there, we
|
|
|
|
# make the target NOTICE files depend on this particular file too, which will
|
|
|
|
# then be in the right directory for the find in combine-notice-files to work.
|
|
|
|
$(kernel_notice_file): \
|
2012-01-07 07:05:53 +08:00
|
|
|
prebuilts/qemu-kernel/arm/LINUX_KERNEL_COPYING \
|
2009-03-04 11:28:42 +08:00
|
|
|
| $(ACP)
|
|
|
|
@echo Copying: $@
|
|
|
|
$(hide) mkdir -p $(dir $@)
|
|
|
|
$(hide) $(ACP) $< $@
|
|
|
|
|
|
|
|
|
2009-06-16 05:30:14 +08:00
|
|
|
# -----------------------------------------------------------------
|
|
|
|
# Build a keystore with the authorized keys in it, used to verify the
|
|
|
|
# authenticity of downloaded OTA packages.
|
|
|
|
#
|
|
|
|
# This rule adds to ALL_DEFAULT_INSTALLED_MODULES, so it needs to come
|
|
|
|
# before the rules that use that variable to build the image.
|
|
|
|
ALL_DEFAULT_INSTALLED_MODULES += $(TARGET_OUT_ETC)/security/otacerts.zip
|
|
|
|
$(TARGET_OUT_ETC)/security/otacerts.zip: KEY_CERT_PAIR := $(DEFAULT_KEY_CERT_PAIR)
|
2009-06-16 06:36:16 +08:00
|
|
|
$(TARGET_OUT_ETC)/security/otacerts.zip: $(addsuffix .x509.pem,$(DEFAULT_KEY_CERT_PAIR))
|
2009-06-16 05:30:14 +08:00
|
|
|
$(hide) rm -f $@
|
|
|
|
$(hide) mkdir -p $(dir $@)
|
2009-06-16 06:36:16 +08:00
|
|
|
$(hide) zip -qj $@ $<
|
2009-06-16 05:30:14 +08:00
|
|
|
|
|
|
|
.PHONY: otacerts
|
|
|
|
otacerts: $(TARGET_OUT_ETC)/security/otacerts.zip
|
|
|
|
|
|
|
|
|
2009-03-04 11:28:42 +08:00
|
|
|
# #################################################################
|
|
|
|
# Targets for user images
|
|
|
|
# #################################################################
|
|
|
|
|
2010-06-17 05:31:34 +08:00
|
|
|
INTERNAL_USERIMAGES_EXT_VARIANT :=
|
2009-03-04 11:28:42 +08:00
|
|
|
ifeq ($(TARGET_USERIMAGES_USE_EXT2),true)
|
2010-05-07 17:23:59 +08:00
|
|
|
INTERNAL_USERIMAGES_USE_EXT := true
|
|
|
|
INTERNAL_USERIMAGES_EXT_VARIANT := ext2
|
|
|
|
else
|
|
|
|
ifeq ($(TARGET_USERIMAGES_USE_EXT3),true)
|
|
|
|
INTERNAL_USERIMAGES_USE_EXT := true
|
|
|
|
INTERNAL_USERIMAGES_EXT_VARIANT := ext3
|
|
|
|
else
|
|
|
|
ifeq ($(TARGET_USERIMAGES_USE_EXT4),true)
|
|
|
|
INTERNAL_USERIMAGES_USE_EXT := true
|
|
|
|
INTERNAL_USERIMAGES_EXT_VARIANT := ext4
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2010-11-18 07:40:38 +08:00
|
|
|
ifneq (true,$(TARGET_USERIMAGES_SPARSE_EXT_DISABLED))
|
|
|
|
INTERNAL_USERIMAGES_SPARSE_EXT_FLAG := -s
|
|
|
|
endif
|
|
|
|
|
2010-05-07 17:23:59 +08:00
|
|
|
ifeq ($(INTERNAL_USERIMAGES_USE_EXT),true)
|
2012-11-27 10:10:23 +08:00
|
|
|
INTERNAL_USERIMAGES_DEPS := $(MKEXTUSERIMG) $(MAKE_EXT4FS) $(SIMG2IMG) $(E2FSCK)
|
2009-03-04 11:28:42 +08:00
|
|
|
else
|
2010-05-11 04:04:47 +08:00
|
|
|
INTERNAL_USERIMAGES_DEPS := $(MKYAFFS2)
|
2009-03-04 11:28:42 +08:00
|
|
|
endif
|
2011-11-01 09:13:30 +08:00
|
|
|
INTERNAL_USERIMAGES_BINARY_PATHS := $(sort $(dir $(INTERNAL_USERIMAGES_DEPS)))
|
2009-03-04 11:28:42 +08:00
|
|
|
|
2012-11-22 02:47:00 +08:00
|
|
|
SELINUX_FC := $(TARGET_ROOT_OUT)/file_contexts
|
|
|
|
INTERNAL_USERIMAGES_DEPS += $(SELINUX_FC)
|
|
|
|
|
2011-10-29 08:02:30 +08:00
|
|
|
# $(1): the path of the output dictionary file
|
|
|
|
define generate-userimage-prop-dictionary
|
|
|
|
$(if $(INTERNAL_USERIMAGES_EXT_VARIANT),$(hide) echo "fs_type=$(INTERNAL_USERIMAGES_EXT_VARIANT)" >> $(1))
|
|
|
|
$(if $(BOARD_SYSTEMIMAGE_PARTITION_SIZE),$(hide) echo "system_size=$(BOARD_SYSTEMIMAGE_PARTITION_SIZE)" >> $(1))
|
|
|
|
$(if $(BOARD_USERDATAIMAGE_PARTITION_SIZE),$(hide) echo "userdata_size=$(BOARD_USERDATAIMAGE_PARTITION_SIZE)" >> $(1))
|
2011-11-05 02:37:01 +08:00
|
|
|
$(if $(BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE),$(hide) echo "cache_fs_type=$(BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE)" >> $(1))
|
|
|
|
$(if $(BOARD_CACHEIMAGE_PARTITION_SIZE),$(hide) echo "cache_size=$(BOARD_CACHEIMAGE_PARTITION_SIZE)" >> $(1))
|
2011-10-29 08:02:30 +08:00
|
|
|
$(if $(INTERNAL_USERIMAGES_SPARSE_EXT_FLAG),$(hide) echo "extfs_sparse_flag=$(INTERNAL_USERIMAGES_SPARSE_EXT_FLAG)" >> $(1))
|
|
|
|
$(if $(mkyaffs2_extra_flags),$(hide) echo "mkyaffs2_extra_flags=$(mkyaffs2_extra_flags)" >> $(1))
|
2012-11-22 02:47:00 +08:00
|
|
|
$(hide) echo "selinux_fc=$(SELINUX_FC)" >> $(1)
|
2011-10-29 08:02:30 +08:00
|
|
|
endef
|
|
|
|
|
2009-07-03 00:00:54 +08:00
|
|
|
# -----------------------------------------------------------------
|
|
|
|
# Recovery image
|
2009-07-08 08:14:25 +08:00
|
|
|
|
|
|
|
# If neither TARGET_NO_KERNEL nor TARGET_NO_RECOVERY are true
|
2012-10-19 01:17:47 +08:00
|
|
|
ifeq (,$(filter true, $(TARGET_NO_KERNEL) $(TARGET_NO_RECOVERY)))
|
2009-07-08 08:14:25 +08:00
|
|
|
|
2009-07-03 00:00:54 +08:00
|
|
|
INSTALLED_RECOVERYIMAGE_TARGET := $(PRODUCT_OUT)/recovery.img
|
|
|
|
|
|
|
|
recovery_initrc := $(call include-path-for, recovery)/etc/init.rc
|
|
|
|
recovery_kernel := $(INSTALLED_KERNEL_TARGET) # same as a non-recovery system
|
|
|
|
recovery_ramdisk := $(PRODUCT_OUT)/ramdisk-recovery.img
|
|
|
|
recovery_build_prop := $(INSTALLED_BUILD_PROP_TARGET)
|
|
|
|
recovery_binary := $(call intermediates-dir-for,EXECUTABLES,recovery)/recovery
|
|
|
|
recovery_resources_common := $(call include-path-for, recovery)/res
|
|
|
|
recovery_resources_private := $(strip $(wildcard $(TARGET_DEVICE_DIR)/recovery/res))
|
|
|
|
recovery_resource_deps := $(shell find $(recovery_resources_common) \
|
|
|
|
$(recovery_resources_private) -type f)
|
2010-09-21 09:04:41 +08:00
|
|
|
recovery_fstab := $(strip $(wildcard $(TARGET_DEVICE_DIR)/recovery.fstab))
|
2012-08-21 06:38:58 +08:00
|
|
|
# Named '.dat' so we don't attempt to use imgdiff for patching it.
|
|
|
|
RECOVERY_RESOURCE_ZIP := $(TARGET_OUT)/etc/recovery-resource.dat
|
2009-07-03 00:00:54 +08:00
|
|
|
|
|
|
|
ifeq ($(recovery_resources_private),)
|
|
|
|
$(info No private recovery resources for TARGET_DEVICE $(TARGET_DEVICE))
|
|
|
|
endif
|
|
|
|
|
2010-09-21 09:04:41 +08:00
|
|
|
ifeq ($(recovery_fstab),)
|
|
|
|
$(info No recovery.fstab for TARGET_DEVICE $(TARGET_DEVICE))
|
|
|
|
endif
|
|
|
|
|
2009-07-03 00:00:54 +08:00
|
|
|
INTERNAL_RECOVERYIMAGE_ARGS := \
|
|
|
|
$(addprefix --second ,$(INSTALLED_2NDBOOTLOADER_TARGET)) \
|
|
|
|
--kernel $(recovery_kernel) \
|
|
|
|
--ramdisk $(recovery_ramdisk)
|
|
|
|
|
|
|
|
# Assumes this has already been stripped
|
|
|
|
ifdef BOARD_KERNEL_CMDLINE
|
|
|
|
INTERNAL_RECOVERYIMAGE_ARGS += --cmdline "$(BOARD_KERNEL_CMDLINE)"
|
|
|
|
endif
|
|
|
|
ifdef BOARD_KERNEL_BASE
|
|
|
|
INTERNAL_RECOVERYIMAGE_ARGS += --base $(BOARD_KERNEL_BASE)
|
|
|
|
endif
|
2010-08-26 05:29:34 +08:00
|
|
|
BOARD_KERNEL_PAGESIZE := $(strip $(BOARD_KERNEL_PAGESIZE))
|
|
|
|
ifdef BOARD_KERNEL_PAGESIZE
|
|
|
|
INTERNAL_RECOVERYIMAGE_ARGS += --pagesize $(BOARD_KERNEL_PAGESIZE)
|
|
|
|
endif
|
2009-07-03 00:00:54 +08:00
|
|
|
|
|
|
|
# Keys authorized to sign OTA packages this build will accept. The
|
2011-10-05 01:50:08 +08:00
|
|
|
# build always uses dev-keys for this; release packaging tools will
|
2009-07-03 00:00:54 +08:00
|
|
|
# substitute other keys for this one.
|
2011-10-05 01:50:08 +08:00
|
|
|
OTA_PUBLIC_KEYS := $(DEFAULT_SYSTEM_DEV_CERTIFICATE).x509.pem
|
2009-07-03 00:00:54 +08:00
|
|
|
|
|
|
|
# Generate a file containing the keys that will be read by the
|
|
|
|
# recovery binary.
|
|
|
|
RECOVERY_INSTALL_OTA_KEYS := \
|
|
|
|
$(call intermediates-dir-for,PACKAGING,ota_keys)/keys
|
|
|
|
DUMPKEY_JAR := $(HOST_OUT_JAVA_LIBRARIES)/dumpkey.jar
|
|
|
|
$(RECOVERY_INSTALL_OTA_KEYS): PRIVATE_OTA_PUBLIC_KEYS := $(OTA_PUBLIC_KEYS)
|
2011-03-16 22:49:13 +08:00
|
|
|
$(RECOVERY_INSTALL_OTA_KEYS): extra_keys := $(patsubst %,%.x509.pem,$(PRODUCT_EXTRA_RECOVERY_KEYS))
|
2011-02-02 06:13:52 +08:00
|
|
|
$(RECOVERY_INSTALL_OTA_KEYS): $(OTA_PUBLIC_KEYS) $(DUMPKEY_JAR) $(extra_keys)
|
|
|
|
@echo "DumpPublicKey: $@ <= $(PRIVATE_OTA_PUBLIC_KEYS) $(extra_keys)"
|
2009-07-03 00:00:54 +08:00
|
|
|
@rm -rf $@
|
|
|
|
@mkdir -p $(dir $@)
|
2011-02-02 06:13:52 +08:00
|
|
|
java -jar $(DUMPKEY_JAR) $(PRIVATE_OTA_PUBLIC_KEYS) $(extra_keys) > $@
|
2009-07-03 00:00:54 +08:00
|
|
|
|
|
|
|
$(INSTALLED_RECOVERYIMAGE_TARGET): $(MKBOOTFS) $(MKBOOTIMG) $(MINIGZIP) \
|
|
|
|
$(INSTALLED_RAMDISK_TARGET) \
|
|
|
|
$(INSTALLED_BOOTIMAGE_TARGET) \
|
|
|
|
$(recovery_binary) \
|
|
|
|
$(recovery_initrc) $(recovery_kernel) \
|
|
|
|
$(INSTALLED_2NDBOOTLOADER_TARGET) \
|
|
|
|
$(recovery_build_prop) $(recovery_resource_deps) \
|
2010-09-21 09:04:41 +08:00
|
|
|
$(recovery_fstab) \
|
2009-07-03 00:00:54 +08:00
|
|
|
$(RECOVERY_INSTALL_OTA_KEYS)
|
|
|
|
@echo ----- Making recovery image ------
|
2012-08-09 07:26:17 +08:00
|
|
|
$(hide) rm -rf $(TARGET_RECOVERY_OUT)
|
|
|
|
$(hide) mkdir -p $(TARGET_RECOVERY_OUT)
|
|
|
|
$(hide) mkdir -p $(TARGET_RECOVERY_ROOT_OUT)/etc $(TARGET_RECOVERY_ROOT_OUT)/tmp
|
|
|
|
@echo Copying baseline ramdisk...
|
|
|
|
$(hide) cp -R $(TARGET_ROOT_OUT) $(TARGET_RECOVERY_OUT)
|
|
|
|
@echo Modifying ramdisk contents...
|
|
|
|
$(hide) rm -f $(TARGET_RECOVERY_ROOT_OUT)/init*.rc
|
|
|
|
$(hide) cp -f $(recovery_initrc) $(TARGET_RECOVERY_ROOT_OUT)/
|
|
|
|
$(hide) -cp $(TARGET_ROOT_OUT)/init.recovery.*.rc $(TARGET_RECOVERY_ROOT_OUT)/
|
|
|
|
$(hide) cp -f $(recovery_binary) $(TARGET_RECOVERY_ROOT_OUT)/sbin/
|
|
|
|
$(hide) cp -rf $(recovery_resources_common) $(TARGET_RECOVERY_ROOT_OUT)/
|
|
|
|
$(hide) $(foreach item,$(recovery_resources_private), \
|
2009-07-03 00:00:54 +08:00
|
|
|
cp -rf $(item) $(TARGET_RECOVERY_ROOT_OUT)/)
|
2012-08-09 07:26:17 +08:00
|
|
|
$(hide) $(foreach item,$(recovery_fstab), \
|
2010-09-21 09:04:41 +08:00
|
|
|
cp -f $(item) $(TARGET_RECOVERY_ROOT_OUT)/etc/recovery.fstab)
|
2012-08-09 07:26:17 +08:00
|
|
|
$(hide) cp $(RECOVERY_INSTALL_OTA_KEYS) $(TARGET_RECOVERY_ROOT_OUT)/res/keys
|
|
|
|
$(hide) cat $(INSTALLED_DEFAULT_PROP_TARGET) $(recovery_build_prop) \
|
2009-07-03 00:00:54 +08:00
|
|
|
> $(TARGET_RECOVERY_ROOT_OUT)/default.prop
|
2012-08-09 07:26:17 +08:00
|
|
|
$(hide) $(MKBOOTFS) $(TARGET_RECOVERY_ROOT_OUT) | $(MINIGZIP) > $(recovery_ramdisk)
|
|
|
|
$(hide) $(MKBOOTIMG) $(INTERNAL_RECOVERYIMAGE_ARGS) $(BOARD_MKBOOTIMG_ARGS) --output $@
|
2009-08-27 00:37:07 +08:00
|
|
|
$(hide) $(call assert-max-image-size,$@,$(BOARD_RECOVERYIMAGE_PARTITION_SIZE),raw)
|
2012-08-09 07:26:17 +08:00
|
|
|
@echo ----- Made recovery image: $@ --------
|
2009-07-03 00:00:54 +08:00
|
|
|
|
2012-08-21 06:38:58 +08:00
|
|
|
$(RECOVERY_RESOURCE_ZIP): $(INSTALLED_RECOVERYIMAGE_TARGET)
|
2012-09-05 05:45:11 +08:00
|
|
|
$(hide) mkdir -p $(dir $@)
|
2012-08-21 06:38:58 +08:00
|
|
|
$(hide) find $(TARGET_RECOVERY_ROOT_OUT)/res -type f | sort | zip -0qrj $@ -@
|
|
|
|
|
2009-07-03 00:00:54 +08:00
|
|
|
else
|
|
|
|
INSTALLED_RECOVERYIMAGE_TARGET :=
|
2012-08-21 06:38:58 +08:00
|
|
|
RECOVERY_RESOURCE_ZIP :=
|
2009-07-03 00:00:54 +08:00
|
|
|
endif
|
|
|
|
|
|
|
|
.PHONY: recoveryimage
|
2012-08-21 06:38:58 +08:00
|
|
|
recoveryimage: $(INSTALLED_RECOVERYIMAGE_TARGET) $(RECOVERY_RESOURCE_ZIP)
|
2009-07-03 00:00:54 +08:00
|
|
|
|
2010-02-06 05:34:34 +08:00
|
|
|
ifneq ($(BOARD_NAND_PAGE_SIZE),)
|
|
|
|
mkyaffs2_extra_flags := -c $(BOARD_NAND_PAGE_SIZE)
|
|
|
|
else
|
|
|
|
mkyaffs2_extra_flags :=
|
2010-12-06 22:24:58 +08:00
|
|
|
BOARD_NAND_PAGE_SIZE := 2048
|
2010-02-06 05:34:34 +08:00
|
|
|
endif
|
|
|
|
|
2010-08-07 03:19:29 +08:00
|
|
|
ifneq ($(BOARD_NAND_SPARE_SIZE),)
|
|
|
|
mkyaffs2_extra_flags += -s $(BOARD_NAND_SPARE_SIZE)
|
2010-12-06 22:24:58 +08:00
|
|
|
else
|
|
|
|
BOARD_NAND_SPARE_SIZE := 64
|
2010-08-07 03:19:29 +08:00
|
|
|
endif
|
|
|
|
|
2009-03-04 11:28:42 +08:00
|
|
|
# -----------------------------------------------------------------
|
2010-09-28 01:37:25 +08:00
|
|
|
# system image
|
2009-03-04 11:28:42 +08:00
|
|
|
#
|
2012-08-09 06:27:00 +08:00
|
|
|
# Remove overridden packages from $(ALL_PDK_FUSION_FILES)
|
|
|
|
PDK_FUSION_SYSIMG_FILES := \
|
|
|
|
$(filter-out $(foreach p,$(overridden_packages),$(p) %/$(p).apk), \
|
|
|
|
$(ALL_PDK_FUSION_FILES))
|
2009-03-04 11:28:42 +08:00
|
|
|
|
|
|
|
INTERNAL_SYSTEMIMAGE_FILES := $(filter $(TARGET_OUT)/%, \
|
2012-03-14 09:58:27 +08:00
|
|
|
$(ALL_PREBUILT) \
|
|
|
|
$(ALL_COPIED_HEADERS) \
|
|
|
|
$(ALL_GENERATED_SOURCES) \
|
2012-08-21 06:38:58 +08:00
|
|
|
$(ALL_DEFAULT_INSTALLED_MODULES) \
|
|
|
|
$(PDK_FUSION_SYSIMG_FILES) \
|
|
|
|
$(RECOVERY_RESOURCE_ZIP))
|
2012-03-14 09:58:27 +08:00
|
|
|
|
|
|
|
ifdef is_tests_build
|
|
|
|
# We don't want to install tests modules to the system partition
|
|
|
|
# when building "tests", because now "tests" may be built in a user, userdebug
|
|
|
|
# or eng build variant and we don't want to pollute the system partition.
|
|
|
|
# INTERNAL_SYSTEMIMAGE_FILES += $(filter $(TARGET_OUT)/%, \
|
|
|
|
# $(tests_MODULES))
|
|
|
|
endif
|
2009-03-04 11:28:42 +08:00
|
|
|
|
2012-08-14 06:03:00 +08:00
|
|
|
FULL_SYSTEMIMAGE_DEPS := $(INTERNAL_SYSTEMIMAGE_FILES) $(INTERNAL_USERIMAGES_DEPS)
|
2011-09-10 07:35:53 +08:00
|
|
|
# -----------------------------------------------------------------
|
|
|
|
# installed file list
|
|
|
|
# Depending on anything that $(BUILT_SYSTEMIMAGE) depends on.
|
|
|
|
# We put installed-files.txt ahead of image itself in the dependency graph
|
|
|
|
# so that we can get the size stat even if the build fails due to too large
|
|
|
|
# system image.
|
|
|
|
INSTALLED_FILES_FILE := $(PRODUCT_OUT)/installed-files.txt
|
|
|
|
$(INSTALLED_FILES_FILE): $(FULL_SYSTEMIMAGE_DEPS)
|
|
|
|
@echo Installed file list: $@
|
|
|
|
@mkdir -p $(dir $@)
|
|
|
|
@rm -f $@
|
|
|
|
$(hide) build/tools/fileslist.py $(TARGET_OUT) > $@
|
|
|
|
|
|
|
|
.PHONY: installed-file-list
|
|
|
|
installed-file-list: $(INSTALLED_FILES_FILE)
|
|
|
|
ifneq ($(filter sdk win_sdk,$(MAKECMDGOALS)),)
|
|
|
|
$(call dist-for-goals, sdk win_sdk, $(INSTALLED_FILES_FILE))
|
|
|
|
endif
|
|
|
|
ifneq ($(filter sdk_addon,$(MAKECMDGOALS)),)
|
|
|
|
$(call dist-for-goals, sdk_addon, $(INSTALLED_FILES_FILE))
|
|
|
|
endif
|
|
|
|
|
|
|
|
systemimage_intermediates := \
|
2011-11-05 02:37:01 +08:00
|
|
|
$(call intermediates-dir-for,PACKAGING,systemimage)
|
2011-09-10 07:35:53 +08:00
|
|
|
BUILT_SYSTEMIMAGE := $(systemimage_intermediates)/system.img
|
|
|
|
|
2009-03-04 11:28:42 +08:00
|
|
|
# $(1): output file
|
|
|
|
define build-systemimage-target
|
2011-10-29 08:02:30 +08:00
|
|
|
@echo "Target system fs image: $(1)"
|
|
|
|
@mkdir -p $(dir $(1)) $(systemimage_intermediates) && rm -rf $(systemimage_intermediates)/system_image_info.txt
|
|
|
|
$(call generate-userimage-prop-dictionary, $(systemimage_intermediates)/system_image_info.txt)
|
|
|
|
$(hide) PATH=$(foreach p,$(INTERNAL_USERIMAGES_BINARY_PATHS),$(p):)$$PATH \
|
|
|
|
./build/tools/releasetools/build_image.py \
|
|
|
|
$(TARGET_OUT) $(systemimage_intermediates)/system_image_info.txt $(1)
|
2009-03-04 11:28:42 +08:00
|
|
|
endef
|
|
|
|
|
2011-09-10 07:35:53 +08:00
|
|
|
$(BUILT_SYSTEMIMAGE): $(FULL_SYSTEMIMAGE_DEPS) $(INSTALLED_FILES_FILE)
|
2009-03-04 11:28:42 +08:00
|
|
|
$(call build-systemimage-target,$@)
|
|
|
|
|
|
|
|
INSTALLED_SYSTEMIMAGE := $(PRODUCT_OUT)/system.img
|
2010-09-28 01:37:25 +08:00
|
|
|
SYSTEMIMAGE_SOURCE_DIR := $(TARGET_OUT)
|
2009-03-04 11:28:42 +08:00
|
|
|
|
2009-07-24 06:12:53 +08:00
|
|
|
# The system partition needs room for the recovery image as well. We
|
|
|
|
# now store the recovery image as a binary patch using the boot image
|
|
|
|
# as the source (since they are very similar). Generate the patch so
|
|
|
|
# we can see how big it's going to be, and include that in the system
|
|
|
|
# image size check calculation.
|
2009-07-25 04:52:32 +08:00
|
|
|
ifneq ($(INSTALLED_RECOVERYIMAGE_TARGET),)
|
2009-07-24 06:12:53 +08:00
|
|
|
intermediates := $(call intermediates-dir-for,PACKAGING,recovery_patch)
|
|
|
|
RECOVERY_FROM_BOOT_PATCH := $(intermediates)/recovery_from_boot.p
|
|
|
|
$(RECOVERY_FROM_BOOT_PATCH): $(INSTALLED_RECOVERYIMAGE_TARGET) \
|
|
|
|
$(INSTALLED_BOOTIMAGE_TARGET) \
|
2009-07-24 09:27:43 +08:00
|
|
|
$(HOST_OUT_EXECUTABLES)/imgdiff \
|
|
|
|
$(HOST_OUT_EXECUTABLES)/bsdiff
|
2009-07-24 06:12:53 +08:00
|
|
|
@echo "Construct recovery from boot"
|
|
|
|
mkdir -p $(dir $@)
|
2009-07-24 09:48:38 +08:00
|
|
|
PATH=$(HOST_OUT_EXECUTABLES):$$PATH $(HOST_OUT_EXECUTABLES)/imgdiff $(INSTALLED_BOOTIMAGE_TARGET) $(INSTALLED_RECOVERYIMAGE_TARGET) $@
|
2009-07-25 04:52:32 +08:00
|
|
|
endif
|
|
|
|
|
2009-07-24 06:12:53 +08:00
|
|
|
|
|
|
|
$(INSTALLED_SYSTEMIMAGE): $(BUILT_SYSTEMIMAGE) $(RECOVERY_FROM_BOOT_PATCH) | $(ACP)
|
2009-03-04 11:28:42 +08:00
|
|
|
@echo "Install system fs image: $@"
|
|
|
|
$(copy-file-to-target)
|
2009-08-27 00:37:07 +08:00
|
|
|
$(hide) $(call assert-max-image-size,$@ $(RECOVERY_FROM_BOOT_PATCH),$(BOARD_SYSTEMIMAGE_PARTITION_SIZE),yaffs)
|
2009-03-04 11:28:42 +08:00
|
|
|
|
|
|
|
systemimage: $(INSTALLED_SYSTEMIMAGE)
|
|
|
|
|
|
|
|
.PHONY: systemimage-nodeps snod
|
|
|
|
systemimage-nodeps snod: $(filter-out systemimage-nodeps snod,$(MAKECMDGOALS)) \
|
2010-05-11 04:04:47 +08:00
|
|
|
| $(INTERNAL_USERIMAGES_DEPS)
|
2009-03-04 11:28:42 +08:00
|
|
|
@echo "make $@: ignoring dependencies"
|
|
|
|
$(call build-systemimage-target,$(INSTALLED_SYSTEMIMAGE))
|
2009-08-27 00:37:07 +08:00
|
|
|
$(hide) $(call assert-max-image-size,$(INSTALLED_SYSTEMIMAGE),$(BOARD_SYSTEMIMAGE_PARTITION_SIZE),yaffs)
|
2009-03-04 11:28:42 +08:00
|
|
|
|
2012-02-25 03:05:48 +08:00
|
|
|
ifneq (,$(filter systemimage-nodeps snod, $(MAKECMDGOALS)))
|
|
|
|
ifeq (true,$(WITH_DEXPREOPT))
|
|
|
|
$(warning Warning: with dexpreopt enabled, you may need a full rebuild.)
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2009-03-04 11:28:42 +08:00
|
|
|
#######
|
|
|
|
## system tarball
|
|
|
|
define build-systemtarball-target
|
|
|
|
$(call pretty,"Target system fs tarball: $(INSTALLED_SYSTEMTARBALL_TARGET)")
|
|
|
|
$(MKTARBALL) $(FS_GET_STATS) \
|
|
|
|
$(PRODUCT_OUT) system $(PRIVATE_SYSTEM_TAR) \
|
|
|
|
$(INSTALLED_SYSTEMTARBALL_TARGET)
|
|
|
|
endef
|
|
|
|
|
2010-06-12 03:05:57 +08:00
|
|
|
ifndef SYSTEM_TARBALL_FORMAT
|
|
|
|
SYSTEM_TARBALL_FORMAT := bz2
|
|
|
|
endif
|
|
|
|
|
2009-03-04 11:28:42 +08:00
|
|
|
system_tar := $(PRODUCT_OUT)/system.tar
|
2010-06-12 03:05:57 +08:00
|
|
|
INSTALLED_SYSTEMTARBALL_TARGET := $(system_tar).$(SYSTEM_TARBALL_FORMAT)
|
2009-03-04 11:28:42 +08:00
|
|
|
$(INSTALLED_SYSTEMTARBALL_TARGET): PRIVATE_SYSTEM_TAR := $(system_tar)
|
|
|
|
$(INSTALLED_SYSTEMTARBALL_TARGET): $(FS_GET_STATS) $(INTERNAL_SYSTEMIMAGE_FILES)
|
|
|
|
$(build-systemtarball-target)
|
|
|
|
|
|
|
|
.PHONY: systemtarball-nodeps
|
|
|
|
systemtarball-nodeps: $(FS_GET_STATS) \
|
|
|
|
$(filter-out systemtarball-nodeps stnod,$(MAKECMDGOALS))
|
|
|
|
$(build-systemtarball-target)
|
|
|
|
|
|
|
|
.PHONY: stnod
|
|
|
|
stnod: systemtarball-nodeps
|
|
|
|
|
2012-05-17 01:32:41 +08:00
|
|
|
# For platform-java goal, add platform as well
|
|
|
|
ifneq (,$(filter platform-java, $(MAKECMDGOALS)))
|
|
|
|
PLATFORM_ZIP_ADD_JAVA := true
|
|
|
|
endif
|
|
|
|
|
2012-03-31 04:52:54 +08:00
|
|
|
#######
|
2012-04-10 08:04:12 +08:00
|
|
|
## platform.zip: system, plus other files to be used in PDK fusion build,
|
|
|
|
## in a zip file
|
2012-05-17 01:32:41 +08:00
|
|
|
INSTALLED_PLATFORM_ZIP := $(PRODUCT_OUT)/platform.zip
|
|
|
|
$(INSTALLED_PLATFORM_ZIP) : $(INTERNAL_SYSTEMIMAGE_FILES)
|
|
|
|
$(call pretty,"Platform zip package: $(INSTALLED_PLATFORM_ZIP)")
|
2012-03-31 04:52:54 +08:00
|
|
|
$(hide) rm -f $@
|
2012-04-10 08:04:12 +08:00
|
|
|
$(hide) cd $(dir $@) && zip -qry $(notdir $@) \
|
|
|
|
$(TARGET_COPY_OUT_SYSTEM) \
|
2012-08-01 08:13:20 +08:00
|
|
|
$(patsubst $(PRODUCT_OUT)/%, %, $(TARGET_OUT_NOTICE_FILES)) \
|
|
|
|
$(addprefix symbols/,$(PDK_SYMBOL_FILES_LIST))
|
2012-05-17 01:32:41 +08:00
|
|
|
ifeq (true,$(PLATFORM_ZIP_ADD_JAVA))
|
2012-06-03 00:22:31 +08:00
|
|
|
$(hide) cd $(OUT_DIR) && zip -qry $(patsubst $(OUT_DIR)/%,%,$@) $(PDK_PLATFORM_JAVA_ZIP_CONTENTS)
|
2012-05-17 01:32:41 +08:00
|
|
|
endif
|
|
|
|
|
2012-03-31 04:52:54 +08:00
|
|
|
|
|
|
|
.PHONY: platform
|
2012-05-17 01:32:41 +08:00
|
|
|
platform: $(INSTALLED_PLATFORM_ZIP)
|
|
|
|
|
|
|
|
.PHONY: platform-java
|
|
|
|
platform-java: platform
|
2012-03-31 04:52:54 +08:00
|
|
|
|
|
|
|
# Dist the platform.zip
|
2012-05-30 08:55:46 +08:00
|
|
|
ifneq (,$(filter platform platform-java, $(MAKECMDGOALS)))
|
|
|
|
$(call dist-for-goals, platform platform-java, $(INSTALLED_PLATFORM_ZIP))
|
2012-03-31 04:52:54 +08:00
|
|
|
endif
|
2009-03-04 11:28:42 +08:00
|
|
|
|
2010-06-05 06:24:49 +08:00
|
|
|
#######
|
|
|
|
## boot tarball
|
|
|
|
define build-boottarball-target
|
2010-06-25 05:02:00 +08:00
|
|
|
$(hide) echo "Target boot fs tarball: $(INSTALLED_BOOTTARBALL_TARGET)"
|
2010-06-05 06:24:49 +08:00
|
|
|
$(hide) mkdir -p $(PRODUCT_OUT)/boot
|
|
|
|
$(hide) cp -f $(INTERNAL_BOOTIMAGE_FILES) $(PRODUCT_OUT)/boot/.
|
|
|
|
$(hide) echo $(BOARD_KERNEL_CMDLINE) > $(PRODUCT_OUT)/boot/cmdline
|
|
|
|
$(hide) $(MKTARBALL) $(FS_GET_STATS) \
|
|
|
|
$(PRODUCT_OUT) boot $(PRIVATE_BOOT_TAR) \
|
|
|
|
$(INSTALLED_BOOTTARBALL_TARGET)
|
|
|
|
endef
|
|
|
|
|
|
|
|
ifndef BOOT_TARBALL_FORMAT
|
|
|
|
BOOT_TARBALL_FORMAT := bz2
|
|
|
|
endif
|
|
|
|
|
|
|
|
boot_tar := $(PRODUCT_OUT)/boot.tar
|
|
|
|
INSTALLED_BOOTTARBALL_TARGET := $(boot_tar).$(BOOT_TARBALL_FORMAT)
|
|
|
|
$(INSTALLED_BOOTTARBALL_TARGET): PRIVATE_BOOT_TAR := $(boot_tar)
|
|
|
|
$(INSTALLED_BOOTTARBALL_TARGET): $(FS_GET_STATS) $(INTERNAL_BOOTIMAGE_FILES)
|
|
|
|
$(build-boottarball-target)
|
|
|
|
|
|
|
|
.PHONY: boottarball-nodeps btnod
|
|
|
|
boottarball-nodeps btnod: $(FS_GET_STATS) \
|
|
|
|
$(filter-out boottarball-nodeps btnod,$(MAKECMDGOALS))
|
|
|
|
$(build-boottarball-target)
|
|
|
|
|
|
|
|
|
2009-03-04 11:28:42 +08:00
|
|
|
# -----------------------------------------------------------------
|
|
|
|
# data partition image
|
|
|
|
INTERNAL_USERDATAIMAGE_FILES := \
|
2011-11-05 02:37:01 +08:00
|
|
|
$(filter $(TARGET_OUT_DATA)/%,$(ALL_DEFAULT_INSTALLED_MODULES))
|
2009-03-04 11:28:42 +08:00
|
|
|
|
2012-03-14 09:58:27 +08:00
|
|
|
# If we build "tests" at the same time, make sure $(tests_MODULES) get covered.
|
|
|
|
ifdef is_tests_build
|
|
|
|
INTERNAL_USERDATAIMAGE_FILES += \
|
|
|
|
$(filter $(TARGET_OUT_DATA)/%,$(tests_MODULES))
|
|
|
|
endif
|
|
|
|
|
2012-10-16 05:36:22 +08:00
|
|
|
ifneq (true,$(BOARD_DONT_BUILD_USERDATA_IMG))
|
2011-10-29 08:02:30 +08:00
|
|
|
userdataimage_intermediates := \
|
2011-11-05 02:37:01 +08:00
|
|
|
$(call intermediates-dir-for,PACKAGING,userdata)
|
2011-10-29 08:02:30 +08:00
|
|
|
BUILT_USERDATAIMAGE_TARGET := $(PRODUCT_OUT)/userdata.img
|
2009-03-04 11:28:42 +08:00
|
|
|
|
|
|
|
define build-userdataimage-target
|
2011-10-29 08:02:30 +08:00
|
|
|
$(call pretty,"Target userdata fs image: $(INSTALLED_USERDATAIMAGE_TARGET)")
|
|
|
|
@mkdir -p $(TARGET_OUT_DATA)
|
|
|
|
@mkdir -p $(userdataimage_intermediates) && rm -rf $(userdataimage_intermediates)/userdata_image_info.txt
|
|
|
|
$(call generate-userimage-prop-dictionary, $(userdataimage_intermediates)/userdata_image_info.txt)
|
|
|
|
$(hide) PATH=$(foreach p,$(INTERNAL_USERIMAGES_BINARY_PATHS),$(p):)$$PATH \
|
|
|
|
./build/tools/releasetools/build_image.py \
|
2011-11-01 09:13:30 +08:00
|
|
|
$(TARGET_OUT_DATA) $(userdataimage_intermediates)/userdata_image_info.txt $(INSTALLED_USERDATAIMAGE_TARGET)
|
2011-10-29 08:02:30 +08:00
|
|
|
$(hide) $(call assert-max-image-size,$(INSTALLED_USERDATAIMAGE_TARGET),$(BOARD_USERDATAIMAGE_PARTITION_SIZE),yaffs)
|
2009-03-04 11:28:42 +08:00
|
|
|
endef
|
2009-04-10 10:31:12 +08:00
|
|
|
|
|
|
|
# We just build this directly to the install location.
|
|
|
|
INSTALLED_USERDATAIMAGE_TARGET := $(BUILT_USERDATAIMAGE_TARGET)
|
2010-05-11 04:04:47 +08:00
|
|
|
$(INSTALLED_USERDATAIMAGE_TARGET): $(INTERNAL_USERIMAGES_DEPS) \
|
2009-03-04 11:28:42 +08:00
|
|
|
$(INTERNAL_USERDATAIMAGE_FILES)
|
|
|
|
$(build-userdataimage-target)
|
|
|
|
|
|
|
|
.PHONY: userdataimage-nodeps
|
2010-05-11 04:04:47 +08:00
|
|
|
userdataimage-nodeps: | $(INTERNAL_USERIMAGES_DEPS)
|
2009-03-04 11:28:42 +08:00
|
|
|
$(build-userdataimage-target)
|
|
|
|
|
2012-10-16 05:36:22 +08:00
|
|
|
endif # no BOARD_DONT_BUILD_USERDATA_IMG
|
|
|
|
|
2009-03-04 11:28:42 +08:00
|
|
|
#######
|
|
|
|
## data partition tarball
|
|
|
|
define build-userdatatarball-target
|
|
|
|
$(call pretty,"Target userdata fs tarball: " \
|
|
|
|
"$(INSTALLED_USERDATATARBALL_TARGET)")
|
|
|
|
$(MKTARBALL) $(FS_GET_STATS) \
|
|
|
|
$(PRODUCT_OUT) data $(PRIVATE_USERDATA_TAR) \
|
|
|
|
$(INSTALLED_USERDATATARBALL_TARGET)
|
|
|
|
endef
|
|
|
|
|
|
|
|
userdata_tar := $(PRODUCT_OUT)/userdata.tar
|
|
|
|
INSTALLED_USERDATATARBALL_TARGET := $(userdata_tar).bz2
|
|
|
|
$(INSTALLED_USERDATATARBALL_TARGET): PRIVATE_USERDATA_TAR := $(userdata_tar)
|
|
|
|
$(INSTALLED_USERDATATARBALL_TARGET): $(FS_GET_STATS) $(INTERNAL_USERDATAIMAGE_FILES)
|
|
|
|
$(build-userdatatarball-target)
|
|
|
|
|
|
|
|
.PHONY: userdatatarball-nodeps
|
|
|
|
userdatatarball-nodeps: $(FS_GET_STATS)
|
|
|
|
$(build-userdatatarball-target)
|
|
|
|
|
|
|
|
|
2011-11-05 02:37:01 +08:00
|
|
|
# -----------------------------------------------------------------
|
|
|
|
# cache partition image
|
|
|
|
ifdef BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE
|
|
|
|
INTERNAL_CACHEIMAGE_FILES := \
|
|
|
|
$(filter $(TARGET_OUT_CACHE)/%,$(ALL_DEFAULT_INSTALLED_MODULES))
|
|
|
|
|
|
|
|
cacheimage_intermediates := \
|
|
|
|
$(call intermediates-dir-for,PACKAGING,cache)
|
|
|
|
BUILT_CACHEIMAGE_TARGET := $(PRODUCT_OUT)/cache.img
|
|
|
|
|
|
|
|
define build-cacheimage-target
|
|
|
|
$(call pretty,"Target cache fs image: $(INSTALLED_CACHEIMAGE_TARGET)")
|
|
|
|
@mkdir -p $(TARGET_OUT_CACHE)
|
|
|
|
@mkdir -p $(cacheimage_intermediates) && rm -rf $(cacheimage_intermediates)/cache_image_info.txt
|
|
|
|
$(call generate-userimage-prop-dictionary, $(cacheimage_intermediates)/cache_image_info.txt)
|
|
|
|
$(hide) PATH=$(foreach p,$(INTERNAL_USERIMAGES_BINARY_PATHS),$(p):)$$PATH \
|
|
|
|
./build/tools/releasetools/build_image.py \
|
|
|
|
$(TARGET_OUT_CACHE) $(cacheimage_intermediates)/cache_image_info.txt $(INSTALLED_CACHEIMAGE_TARGET)
|
|
|
|
$(hide) $(call assert-max-image-size,$(INSTALLED_CACHEIMAGE_TARGET),$(BOARD_CACHEIMAGE_PARTITION_SIZE),yaffs)
|
|
|
|
endef
|
|
|
|
|
|
|
|
# We just build this directly to the install location.
|
|
|
|
INSTALLED_CACHEIMAGE_TARGET := $(BUILT_CACHEIMAGE_TARGET)
|
|
|
|
$(INSTALLED_CACHEIMAGE_TARGET): $(INTERNAL_USERIMAGES_DEPS) $(INTERNAL_CACHEIMAGE_FILES)
|
|
|
|
$(build-cacheimage-target)
|
|
|
|
|
|
|
|
.PHONY: cacheimage-nodeps
|
|
|
|
cacheimage-nodeps: | $(INTERNAL_USERIMAGES_DEPS)
|
|
|
|
$(build-cacheimage-target)
|
|
|
|
|
|
|
|
endif # BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE
|
|
|
|
|
2009-03-04 11:28:42 +08:00
|
|
|
# -----------------------------------------------------------------
|
|
|
|
# bring in the installer image generation defines if necessary
|
|
|
|
ifeq ($(TARGET_USE_DISKINSTALLER),true)
|
|
|
|
include bootable/diskinstaller/config.mk
|
|
|
|
endif
|
|
|
|
|
|
|
|
# -----------------------------------------------------------------
|
2012-04-20 04:54:39 +08:00
|
|
|
# host tools needed to build dist and OTA packages
|
2009-06-16 05:30:14 +08:00
|
|
|
|
2012-04-20 04:54:39 +08:00
|
|
|
DISTTOOLS := $(HOST_OUT_EXECUTABLES)/minigzip \
|
2009-06-16 05:30:14 +08:00
|
|
|
$(HOST_OUT_EXECUTABLES)/mkbootfs \
|
|
|
|
$(HOST_OUT_EXECUTABLES)/mkbootimg \
|
|
|
|
$(HOST_OUT_EXECUTABLES)/fs_config \
|
|
|
|
$(HOST_OUT_EXECUTABLES)/mkyaffs2image \
|
|
|
|
$(HOST_OUT_EXECUTABLES)/zipalign \
|
|
|
|
$(HOST_OUT_EXECUTABLES)/bsdiff \
|
2009-06-18 23:43:44 +08:00
|
|
|
$(HOST_OUT_EXECUTABLES)/imgdiff \
|
2009-06-16 05:30:14 +08:00
|
|
|
$(HOST_OUT_JAVA_LIBRARIES)/dumpkey.jar \
|
2010-06-17 05:31:34 +08:00
|
|
|
$(HOST_OUT_JAVA_LIBRARIES)/signapk.jar \
|
|
|
|
$(HOST_OUT_EXECUTABLES)/mkuserimg.sh \
|
2010-11-30 07:51:20 +08:00
|
|
|
$(HOST_OUT_EXECUTABLES)/make_ext4fs
|
2009-03-04 11:28:42 +08:00
|
|
|
|
2012-04-20 04:54:39 +08:00
|
|
|
OTATOOLS := $(DISTTOOLS) \
|
|
|
|
$(HOST_OUT_EXECUTABLES)/aapt
|
|
|
|
|
2010-06-18 08:52:18 +08:00
|
|
|
.PHONY: otatools
|
|
|
|
otatools: $(OTATOOLS)
|
|
|
|
|
2009-03-04 11:28:42 +08:00
|
|
|
# -----------------------------------------------------------------
|
|
|
|
# A zip of the directories that map to the target filesystem.
|
|
|
|
# This zip can be used to create an OTA package or filesystem image
|
|
|
|
# as a post-build step.
|
|
|
|
#
|
|
|
|
name := $(TARGET_PRODUCT)
|
|
|
|
ifeq ($(TARGET_BUILD_TYPE),debug)
|
|
|
|
name := $(name)_debug
|
|
|
|
endif
|
|
|
|
name := $(name)-target_files-$(FILE_NAME_TAG)
|
|
|
|
|
|
|
|
intermediates := $(call intermediates-dir-for,PACKAGING,target_files)
|
|
|
|
BUILT_TARGET_FILES_PACKAGE := $(intermediates)/$(name).zip
|
|
|
|
$(BUILT_TARGET_FILES_PACKAGE): intermediates := $(intermediates)
|
|
|
|
$(BUILT_TARGET_FILES_PACKAGE): \
|
|
|
|
zip_root := $(intermediates)/$(name)
|
|
|
|
|
|
|
|
# $(1): Directory to copy
|
|
|
|
# $(2): Location to copy it to
|
|
|
|
# The "ls -A" is to prevent "acp s/* d" from failing if s is empty.
|
|
|
|
define package_files-copy-root
|
|
|
|
if [ -d "$(strip $(1))" -a "$$(ls -A $(1))" ]; then \
|
|
|
|
mkdir -p $(2) && \
|
|
|
|
$(ACP) -rd $(strip $(1))/* $(2); \
|
|
|
|
fi
|
|
|
|
endef
|
|
|
|
|
|
|
|
built_ota_tools := \
|
2009-04-02 06:48:46 +08:00
|
|
|
$(call intermediates-dir-for,EXECUTABLES,applypatch)/applypatch \
|
2009-07-23 09:27:31 +08:00
|
|
|
$(call intermediates-dir-for,EXECUTABLES,applypatch_static)/applypatch_static \
|
2009-06-13 07:57:08 +08:00
|
|
|
$(call intermediates-dir-for,EXECUTABLES,check_prereq)/check_prereq \
|
2011-09-20 06:02:03 +08:00
|
|
|
$(call intermediates-dir-for,EXECUTABLES,sqlite3)/sqlite3 \
|
2009-06-13 07:57:08 +08:00
|
|
|
$(call intermediates-dir-for,EXECUTABLES,updater)/updater
|
2009-03-04 11:28:42 +08:00
|
|
|
$(BUILT_TARGET_FILES_PACKAGE): PRIVATE_OTA_TOOLS := $(built_ota_tools)
|
|
|
|
|
2009-06-18 08:09:40 +08:00
|
|
|
$(BUILT_TARGET_FILES_PACKAGE): PRIVATE_RECOVERY_API_VERSION := $(RECOVERY_API_VERSION)
|
|
|
|
|
2009-10-01 00:20:32 +08:00
|
|
|
ifeq ($(TARGET_RELEASETOOLS_EXTENSIONS),)
|
|
|
|
# default to common dir for device vendor
|
|
|
|
$(BUILT_TARGET_FILES_PACKAGE): tool_extensions := $(TARGET_DEVICE_DIR)/../common
|
|
|
|
else
|
|
|
|
$(BUILT_TARGET_FILES_PACKAGE): tool_extensions := $(TARGET_RELEASETOOLS_EXTENSIONS)
|
|
|
|
endif
|
|
|
|
|
2009-03-04 11:28:42 +08:00
|
|
|
# Depending on the various images guarantees that the underlying
|
|
|
|
# directories are up-to-date.
|
|
|
|
$(BUILT_TARGET_FILES_PACKAGE): \
|
|
|
|
$(INSTALLED_BOOTIMAGE_TARGET) \
|
|
|
|
$(INSTALLED_RADIOIMAGE_TARGET) \
|
|
|
|
$(INSTALLED_RECOVERYIMAGE_TARGET) \
|
2009-07-03 00:00:54 +08:00
|
|
|
$(INSTALLED_SYSTEMIMAGE) \
|
2009-03-04 11:28:42 +08:00
|
|
|
$(INSTALLED_USERDATAIMAGE_TARGET) \
|
2011-11-05 02:37:01 +08:00
|
|
|
$(INSTALLED_CACHEIMAGE_TARGET) \
|
2009-03-04 11:28:42 +08:00
|
|
|
$(INSTALLED_ANDROID_INFO_TXT_TARGET) \
|
|
|
|
$(built_ota_tools) \
|
|
|
|
$(APKCERTS_FILE) \
|
2010-03-16 08:52:32 +08:00
|
|
|
$(HOST_OUT_EXECUTABLES)/fs_config \
|
2009-03-04 11:28:42 +08:00
|
|
|
| $(ACP)
|
|
|
|
@echo "Package target files: $@"
|
|
|
|
$(hide) rm -rf $@ $(zip_root)
|
|
|
|
$(hide) mkdir -p $(dir $@) $(zip_root)
|
|
|
|
@# Components of the recovery image
|
|
|
|
$(hide) mkdir -p $(zip_root)/RECOVERY
|
|
|
|
$(hide) $(call package_files-copy-root, \
|
|
|
|
$(TARGET_RECOVERY_ROOT_OUT),$(zip_root)/RECOVERY/RAMDISK)
|
|
|
|
ifdef INSTALLED_KERNEL_TARGET
|
|
|
|
$(hide) $(ACP) $(INSTALLED_KERNEL_TARGET) $(zip_root)/RECOVERY/kernel
|
|
|
|
endif
|
|
|
|
ifdef INSTALLED_2NDBOOTLOADER_TARGET
|
|
|
|
$(hide) $(ACP) \
|
|
|
|
$(INSTALLED_2NDBOOTLOADER_TARGET) $(zip_root)/RECOVERY/second
|
|
|
|
endif
|
|
|
|
ifdef BOARD_KERNEL_CMDLINE
|
|
|
|
$(hide) echo "$(BOARD_KERNEL_CMDLINE)" > $(zip_root)/RECOVERY/cmdline
|
2009-06-18 00:07:09 +08:00
|
|
|
endif
|
|
|
|
ifdef BOARD_KERNEL_BASE
|
|
|
|
$(hide) echo "$(BOARD_KERNEL_BASE)" > $(zip_root)/RECOVERY/base
|
2010-08-26 05:29:34 +08:00
|
|
|
endif
|
|
|
|
ifdef BOARD_KERNEL_PAGESIZE
|
|
|
|
$(hide) echo "$(BOARD_KERNEL_PAGESIZE)" > $(zip_root)/RECOVERY/pagesize
|
2009-03-04 11:28:42 +08:00
|
|
|
endif
|
|
|
|
@# Components of the boot image
|
|
|
|
$(hide) mkdir -p $(zip_root)/BOOT
|
|
|
|
$(hide) $(call package_files-copy-root, \
|
|
|
|
$(TARGET_ROOT_OUT),$(zip_root)/BOOT/RAMDISK)
|
|
|
|
ifdef INSTALLED_KERNEL_TARGET
|
|
|
|
$(hide) $(ACP) $(INSTALLED_KERNEL_TARGET) $(zip_root)/BOOT/kernel
|
|
|
|
endif
|
|
|
|
ifdef INSTALLED_2NDBOOTLOADER_TARGET
|
|
|
|
$(hide) $(ACP) \
|
|
|
|
$(INSTALLED_2NDBOOTLOADER_TARGET) $(zip_root)/BOOT/second
|
|
|
|
endif
|
|
|
|
ifdef BOARD_KERNEL_CMDLINE
|
|
|
|
$(hide) echo "$(BOARD_KERNEL_CMDLINE)" > $(zip_root)/BOOT/cmdline
|
|
|
|
endif
|
2009-06-18 00:07:09 +08:00
|
|
|
ifdef BOARD_KERNEL_BASE
|
|
|
|
$(hide) echo "$(BOARD_KERNEL_BASE)" > $(zip_root)/BOOT/base
|
2010-08-26 05:29:34 +08:00
|
|
|
endif
|
|
|
|
ifdef BOARD_KERNEL_PAGESIZE
|
|
|
|
$(hide) echo "$(BOARD_KERNEL_PAGESIZE)" > $(zip_root)/BOOT/pagesize
|
2009-06-18 00:07:09 +08:00
|
|
|
endif
|
2009-06-20 08:12:18 +08:00
|
|
|
$(hide) $(foreach t,$(INSTALLED_RADIOIMAGE_TARGET),\
|
|
|
|
mkdir -p $(zip_root)/RADIO; \
|
|
|
|
$(ACP) $(t) $(zip_root)/RADIO/$(notdir $(t));)
|
2009-03-04 11:28:42 +08:00
|
|
|
@# Contents of the system image
|
|
|
|
$(hide) $(call package_files-copy-root, \
|
|
|
|
$(SYSTEMIMAGE_SOURCE_DIR),$(zip_root)/SYSTEM)
|
|
|
|
@# Contents of the data image
|
|
|
|
$(hide) $(call package_files-copy-root, \
|
|
|
|
$(TARGET_OUT_DATA),$(zip_root)/DATA)
|
|
|
|
@# Extra contents of the OTA package
|
|
|
|
$(hide) mkdir -p $(zip_root)/OTA/bin
|
|
|
|
$(hide) $(ACP) $(INSTALLED_ANDROID_INFO_TXT_TARGET) $(zip_root)/OTA/
|
|
|
|
$(hide) $(ACP) $(PRIVATE_OTA_TOOLS) $(zip_root)/OTA/bin/
|
2009-06-16 05:30:14 +08:00
|
|
|
@# Files that do not end up in any images, but are necessary to
|
2009-03-04 11:28:42 +08:00
|
|
|
@# build them.
|
|
|
|
$(hide) mkdir -p $(zip_root)/META
|
|
|
|
$(hide) $(ACP) $(APKCERTS_FILE) $(zip_root)/META/apkcerts.txt
|
2009-04-02 06:48:46 +08:00
|
|
|
$(hide) echo "$(PRODUCT_OTA_PUBLIC_KEYS)" > $(zip_root)/META/otakeys.txt
|
2010-09-17 08:44:38 +08:00
|
|
|
$(hide) echo "recovery_api_version=$(PRIVATE_RECOVERY_API_VERSION)" > $(zip_root)/META/misc_info.txt
|
2010-07-02 06:30:11 +08:00
|
|
|
ifdef BOARD_FLASH_BLOCK_SIZE
|
2010-09-17 08:44:38 +08:00
|
|
|
$(hide) echo "blocksize=$(BOARD_FLASH_BLOCK_SIZE)" >> $(zip_root)/META/misc_info.txt
|
2010-07-02 06:30:11 +08:00
|
|
|
endif
|
|
|
|
ifdef BOARD_BOOTIMAGE_PARTITION_SIZE
|
2011-01-15 03:30:56 +08:00
|
|
|
$(hide) echo "boot_size=$(BOARD_BOOTIMAGE_PARTITION_SIZE)" >> $(zip_root)/META/misc_info.txt
|
2010-07-02 06:30:11 +08:00
|
|
|
endif
|
|
|
|
ifdef BOARD_RECOVERYIMAGE_PARTITION_SIZE
|
2011-01-15 03:30:56 +08:00
|
|
|
$(hide) echo "recovery_size=$(BOARD_RECOVERYIMAGE_PARTITION_SIZE)" >> $(zip_root)/META/misc_info.txt
|
2010-07-02 06:30:11 +08:00
|
|
|
endif
|
2010-09-17 08:44:38 +08:00
|
|
|
$(hide) echo "tool_extensions=$(tool_extensions)" >> $(zip_root)/META/misc_info.txt
|
2011-10-05 01:50:08 +08:00
|
|
|
$(hide) echo "default_system_dev_certificate=$(DEFAULT_SYSTEM_DEV_CERTIFICATE)" >> $(zip_root)/META/misc_info.txt
|
2011-03-16 22:49:13 +08:00
|
|
|
ifdef PRODUCT_EXTRA_RECOVERY_KEYS
|
|
|
|
$(hide) echo "extra_recovery_keys=$(PRODUCT_EXTRA_RECOVERY_KEYS)" >> $(zip_root)/META/misc_info.txt
|
2010-08-26 11:39:41 +08:00
|
|
|
endif
|
2012-08-03 05:46:42 +08:00
|
|
|
$(hide) echo "mkbootimg_args=$(BOARD_MKBOOTIMG_ARGS)" >> $(zip_root)/META/misc_info.txt
|
2011-10-29 08:02:30 +08:00
|
|
|
$(call generate-userimage-prop-dictionary, $(zip_root)/META/misc_info.txt)
|
2009-03-04 11:28:42 +08:00
|
|
|
@# Zip everything up, preserving symlinks
|
|
|
|
$(hide) (cd $(zip_root) && zip -qry ../$(notdir $@) .)
|
2011-09-08 05:11:51 +08:00
|
|
|
@# Run fs_config on all the system, boot ramdisk, and recovery ramdisk files in the zip, and save the output
|
|
|
|
$(hide) zipinfo -1 $@ | awk 'BEGIN { FS="SYSTEM/" } /^SYSTEM\// {print "system/" $$2}' | $(HOST_OUT_EXECUTABLES)/fs_config > $(zip_root)/META/filesystem_config.txt
|
|
|
|
$(hide) zipinfo -1 $@ | awk 'BEGIN { FS="BOOT/RAMDISK/" } /^BOOT\/RAMDISK\// {print $$2}' | $(HOST_OUT_EXECUTABLES)/fs_config > $(zip_root)/META/boot_filesystem_config.txt
|
|
|
|
$(hide) zipinfo -1 $@ | awk 'BEGIN { FS="RECOVERY/RAMDISK/" } /^RECOVERY\/RAMDISK\// {print $$2}' | $(HOST_OUT_EXECUTABLES)/fs_config > $(zip_root)/META/recovery_filesystem_config.txt
|
|
|
|
$(hide) (cd $(zip_root) && zip -q ../$(notdir $@) META/*filesystem_config.txt)
|
2010-03-16 08:52:32 +08:00
|
|
|
|
2009-03-04 11:28:42 +08:00
|
|
|
|
|
|
|
target-files-package: $(BUILT_TARGET_FILES_PACKAGE)
|
|
|
|
|
2009-06-16 09:56:51 +08:00
|
|
|
|
|
|
|
ifneq ($(TARGET_PRODUCT),sdk)
|
2011-02-10 04:26:42 +08:00
|
|
|
ifeq ($(filter generic%,$(TARGET_DEVICE)),)
|
2010-08-26 07:06:06 +08:00
|
|
|
ifneq ($(TARGET_NO_KERNEL),true)
|
2011-03-04 13:52:08 +08:00
|
|
|
ifneq ($(recovery_fstab),)
|
2009-06-16 09:56:51 +08:00
|
|
|
|
2010-10-21 05:01:09 +08:00
|
|
|
# -----------------------------------------------------------------
|
|
|
|
# OTA update package
|
|
|
|
|
2009-06-16 05:30:14 +08:00
|
|
|
name := $(TARGET_PRODUCT)
|
|
|
|
ifeq ($(TARGET_BUILD_TYPE),debug)
|
|
|
|
name := $(name)_debug
|
|
|
|
endif
|
|
|
|
name := $(name)-ota-$(FILE_NAME_TAG)
|
|
|
|
|
|
|
|
INTERNAL_OTA_PACKAGE_TARGET := $(PRODUCT_OUT)/$(name).zip
|
|
|
|
|
|
|
|
$(INTERNAL_OTA_PACKAGE_TARGET): KEY_CERT_PAIR := $(DEFAULT_KEY_CERT_PAIR)
|
|
|
|
|
2012-08-14 06:03:00 +08:00
|
|
|
$(INTERNAL_OTA_PACKAGE_TARGET): $(BUILT_TARGET_FILES_PACKAGE) $(DISTTOOLS)
|
2009-06-16 05:30:14 +08:00
|
|
|
@echo "Package OTA: $@"
|
2010-08-26 06:23:21 +08:00
|
|
|
$(hide) ./build/tools/releasetools/ota_from_target_files -v \
|
2009-06-18 23:35:12 +08:00
|
|
|
-p $(HOST_OUT) \
|
2012-02-10 02:36:21 +08:00
|
|
|
-k $(KEY_CERT_PAIR) \
|
|
|
|
$(BUILT_TARGET_FILES_PACKAGE) $@
|
2009-06-16 05:30:14 +08:00
|
|
|
|
|
|
|
.PHONY: otapackage
|
|
|
|
otapackage: $(INTERNAL_OTA_PACKAGE_TARGET)
|
|
|
|
|
2010-10-21 05:01:09 +08:00
|
|
|
# -----------------------------------------------------------------
|
|
|
|
# The update package
|
|
|
|
|
|
|
|
name := $(TARGET_PRODUCT)
|
|
|
|
ifeq ($(TARGET_BUILD_TYPE),debug)
|
|
|
|
name := $(name)_debug
|
|
|
|
endif
|
|
|
|
name := $(name)-img-$(FILE_NAME_TAG)
|
|
|
|
|
|
|
|
INTERNAL_UPDATE_PACKAGE_TARGET := $(PRODUCT_OUT)/$(name).zip
|
|
|
|
|
|
|
|
ifeq ($(TARGET_RELEASETOOLS_EXTENSIONS),)
|
|
|
|
# default to common dir for device vendor
|
|
|
|
$(INTERNAL_UPDATE_PACKAGE_TARGET): extensions := $(TARGET_DEVICE_DIR)/../common
|
|
|
|
else
|
|
|
|
$(INTERNAL_UPDATE_PACKAGE_TARGET): extensions := $(TARGET_RELEASETOOLS_EXTENSIONS)
|
|
|
|
endif
|
|
|
|
|
2012-08-14 06:03:00 +08:00
|
|
|
$(INTERNAL_UPDATE_PACKAGE_TARGET): $(BUILT_TARGET_FILES_PACKAGE) $(DISTTOOLS)
|
2010-10-21 05:01:09 +08:00
|
|
|
@echo "Package: $@"
|
|
|
|
$(hide) ./build/tools/releasetools/img_from_target_files -v \
|
|
|
|
-s $(extensions) \
|
|
|
|
-p $(HOST_OUT) \
|
|
|
|
$(BUILT_TARGET_FILES_PACKAGE) $@
|
|
|
|
|
|
|
|
.PHONY: updatepackage
|
|
|
|
updatepackage: $(INTERNAL_UPDATE_PACKAGE_TARGET)
|
|
|
|
|
2011-03-04 13:52:08 +08:00
|
|
|
endif # recovery_fstab is defined
|
2010-08-26 07:06:06 +08:00
|
|
|
endif # TARGET_NO_KERNEL != true
|
2011-02-10 04:26:42 +08:00
|
|
|
endif # TARGET_DEVICE != generic*
|
2009-06-16 09:56:51 +08:00
|
|
|
endif # TARGET_PRODUCT != sdk
|
2009-06-16 05:30:14 +08:00
|
|
|
|
2011-11-18 06:51:12 +08:00
|
|
|
ifdef is_tests_build
|
2009-03-04 11:28:42 +08:00
|
|
|
# -----------------------------------------------------------------
|
|
|
|
# A zip of the tests that are built when running "make tests".
|
|
|
|
# This is very similar to BUILT_TARGET_FILES_PACKAGE, but we
|
2012-03-14 02:22:04 +08:00
|
|
|
# only grab DATA, and it's called "*-tests-*.zip".
|
2009-03-04 11:28:42 +08:00
|
|
|
#
|
|
|
|
name := $(TARGET_PRODUCT)
|
|
|
|
ifeq ($(TARGET_BUILD_TYPE),debug)
|
|
|
|
name := $(name)_debug
|
|
|
|
endif
|
|
|
|
name := $(name)-tests-$(FILE_NAME_TAG)
|
|
|
|
|
|
|
|
intermediates := $(call intermediates-dir-for,PACKAGING,tests_zip)
|
|
|
|
BUILT_TESTS_ZIP_PACKAGE := $(intermediates)/$(name).zip
|
|
|
|
$(BUILT_TESTS_ZIP_PACKAGE): intermediates := $(intermediates)
|
|
|
|
$(BUILT_TESTS_ZIP_PACKAGE): zip_root := $(intermediates)/$(name)
|
|
|
|
|
2012-06-12 07:43:40 +08:00
|
|
|
# Depending on the image dependency files, instead of the image files itself,
|
|
|
|
# guarantees that the underlying directories are up-to-date,
|
|
|
|
# but don't really build the image.
|
2009-03-04 11:28:42 +08:00
|
|
|
$(BUILT_TESTS_ZIP_PACKAGE): \
|
2012-06-12 07:43:40 +08:00
|
|
|
$(INTERNAL_USERDATAIMAGE_FILES) \
|
2012-03-14 09:58:27 +08:00
|
|
|
| $(ACP)
|
2009-03-04 11:28:42 +08:00
|
|
|
@echo "Package test files: $@"
|
|
|
|
$(hide) rm -rf $@ $(zip_root)
|
|
|
|
$(hide) mkdir -p $(dir $@) $(zip_root)
|
|
|
|
@# Contents of the data image
|
|
|
|
$(hide) $(call package_files-copy-root, \
|
|
|
|
$(TARGET_OUT_DATA),$(zip_root)/DATA)
|
|
|
|
$(hide) (cd $(zip_root) && zip -qry ../$(notdir $@) .)
|
|
|
|
|
2012-03-14 09:58:27 +08:00
|
|
|
.PHONY: tests
|
|
|
|
tests: $(BUILT_TESTS_ZIP_PACKAGE)
|
2011-11-18 06:51:12 +08:00
|
|
|
|
2012-03-14 09:58:27 +08:00
|
|
|
ifneq (,$(filter tests, $(MAKECMDGOALS)))
|
2011-11-18 06:51:12 +08:00
|
|
|
$(call dist-for-goals, tests, $(BUILT_TESTS_ZIP_PACKAGE))
|
2012-03-14 09:58:27 +08:00
|
|
|
endif
|
2011-11-18 06:51:12 +08:00
|
|
|
endif # is_tests_build
|
2012-03-14 09:58:27 +08:00
|
|
|
|
2009-03-04 11:28:42 +08:00
|
|
|
# -----------------------------------------------------------------
|
|
|
|
# A zip of the symbols directory. Keep the full paths to make it
|
|
|
|
# more obvious where these files came from.
|
|
|
|
#
|
|
|
|
name := $(TARGET_PRODUCT)
|
|
|
|
ifeq ($(TARGET_BUILD_TYPE),debug)
|
|
|
|
name := $(name)_debug
|
|
|
|
endif
|
|
|
|
name := $(name)-symbols-$(FILE_NAME_TAG)
|
|
|
|
|
|
|
|
SYMBOLS_ZIP := $(PRODUCT_OUT)/$(name).zip
|
|
|
|
$(SYMBOLS_ZIP): $(INSTALLED_SYSTEMIMAGE) $(INSTALLED_BOOTIMAGE_TARGET)
|
|
|
|
@echo "Package symbols: $@"
|
|
|
|
$(hide) rm -rf $@
|
|
|
|
$(hide) mkdir -p $(dir $@)
|
|
|
|
$(hide) zip -qr $@ $(TARGET_OUT_UNSTRIPPED)
|
|
|
|
|
|
|
|
# -----------------------------------------------------------------
|
|
|
|
# A zip of the Android Apps. Not keeping full path so that we don't
|
|
|
|
# include product names when distributing
|
|
|
|
#
|
|
|
|
name := $(TARGET_PRODUCT)
|
|
|
|
ifeq ($(TARGET_BUILD_TYPE),debug)
|
|
|
|
name := $(name)_debug
|
|
|
|
endif
|
|
|
|
name := $(name)-apps-$(FILE_NAME_TAG)
|
|
|
|
|
|
|
|
APPS_ZIP := $(PRODUCT_OUT)/$(name).zip
|
|
|
|
$(APPS_ZIP): $(INSTALLED_SYSTEMIMAGE)
|
|
|
|
@echo "Package apps: $@"
|
|
|
|
$(hide) rm -rf $@
|
|
|
|
$(hide) mkdir -p $(dir $@)
|
|
|
|
$(hide) zip -qj $@ $(TARGET_OUT_APPS)/*
|
|
|
|
|
2010-04-24 02:54:37 +08:00
|
|
|
|
|
|
|
#------------------------------------------------------------------
|
|
|
|
# A zip of emma code coverage meta files. Generated for fully emma
|
|
|
|
# instrumented build.
|
|
|
|
#
|
2012-08-16 03:22:44 +08:00
|
|
|
ifeq (true,$(EMMA_INSTRUMENT))
|
2010-04-24 02:54:37 +08:00
|
|
|
EMMA_META_ZIP := $(PRODUCT_OUT)/emma_meta.zip
|
2012-08-16 03:22:44 +08:00
|
|
|
# the dependency will be set up later in build/core/main.mk.
|
|
|
|
$(EMMA_META_ZIP) :
|
2010-04-24 02:54:37 +08:00
|
|
|
@echo "Collecting Emma coverage meta files."
|
|
|
|
$(hide) find $(TARGET_COMMON_OUT_ROOT) -name "coverage.em" | \
|
|
|
|
zip -@ -q $@
|
|
|
|
|
2012-08-16 03:22:44 +08:00
|
|
|
endif # EMMA_INSTRUMENT=true
|
|
|
|
|
2009-03-04 11:28:42 +08:00
|
|
|
# -----------------------------------------------------------------
|
|
|
|
# dalvik something
|
|
|
|
.PHONY: dalvikfiles
|
|
|
|
dalvikfiles: $(INTERNAL_DALVIK_MODULES)
|
|
|
|
|
|
|
|
# -----------------------------------------------------------------
|
|
|
|
# The emulator package
|
2012-07-27 01:15:21 +08:00
|
|
|
ifeq ($(BUILD_EMULATOR),true)
|
2009-03-04 11:28:42 +08:00
|
|
|
INTERNAL_EMULATOR_PACKAGE_FILES += \
|
|
|
|
$(HOST_OUT_EXECUTABLES)/emulator$(HOST_EXECUTABLE_SUFFIX) \
|
2012-01-07 08:44:06 +08:00
|
|
|
prebuilts/qemu-kernel/$(TARGET_ARCH)/kernel-qemu \
|
2009-03-04 11:28:42 +08:00
|
|
|
$(INSTALLED_RAMDISK_TARGET) \
|
|
|
|
$(INSTALLED_SYSTEMIMAGE) \
|
|
|
|
$(INSTALLED_USERDATAIMAGE_TARGET)
|
|
|
|
|
|
|
|
name := $(TARGET_PRODUCT)-emulator-$(FILE_NAME_TAG)
|
|
|
|
|
|
|
|
INTERNAL_EMULATOR_PACKAGE_TARGET := $(PRODUCT_OUT)/$(name).zip
|
|
|
|
|
|
|
|
$(INTERNAL_EMULATOR_PACKAGE_TARGET): $(INTERNAL_EMULATOR_PACKAGE_FILES)
|
|
|
|
@echo "Package: $@"
|
|
|
|
$(hide) zip -qj $@ $(INTERNAL_EMULATOR_PACKAGE_FILES)
|
|
|
|
|
2012-07-27 01:15:21 +08:00
|
|
|
endif
|
2009-03-04 11:28:42 +08:00
|
|
|
# -----------------------------------------------------------------
|
2012-02-28 07:49:23 +08:00
|
|
|
# Old PDK stuffs, retired
|
2009-03-04 11:28:42 +08:00
|
|
|
# The pdk package (Platform Development Kit)
|
|
|
|
|
2012-02-28 07:49:23 +08:00
|
|
|
#ifneq (,$(filter pdk,$(MAKECMDGOALS)))
|
|
|
|
# include development/pdk/Pdk.mk
|
|
|
|
#endif
|
|
|
|
|
2009-03-04 11:28:42 +08:00
|
|
|
|
|
|
|
# -----------------------------------------------------------------
|
|
|
|
# The SDK
|
|
|
|
|
|
|
|
# The SDK includes host-specific components, so it belongs under HOST_OUT.
|
|
|
|
sdk_dir := $(HOST_OUT)/sdk
|
|
|
|
|
|
|
|
# Build a name that looks like:
|
|
|
|
#
|
|
|
|
# linux-x86 --> android-sdk_12345_linux-x86
|
|
|
|
# darwin-x86 --> android-sdk_12345_mac-x86
|
|
|
|
# windows-x86 --> android-sdk_12345_windows
|
|
|
|
#
|
|
|
|
sdk_name := android-sdk_$(FILE_NAME_TAG)
|
|
|
|
ifeq ($(HOST_OS),darwin)
|
2009-04-13 23:31:16 +08:00
|
|
|
INTERNAL_SDK_HOST_OS_NAME := mac
|
2009-03-04 11:28:42 +08:00
|
|
|
else
|
2009-04-13 23:31:16 +08:00
|
|
|
INTERNAL_SDK_HOST_OS_NAME := $(HOST_OS)
|
2009-03-04 11:28:42 +08:00
|
|
|
endif
|
|
|
|
ifneq ($(HOST_OS),windows)
|
2009-04-13 23:31:16 +08:00
|
|
|
INTERNAL_SDK_HOST_OS_NAME := $(INTERNAL_SDK_HOST_OS_NAME)-$(HOST_ARCH)
|
2009-03-04 11:28:42 +08:00
|
|
|
endif
|
2009-04-13 23:31:16 +08:00
|
|
|
sdk_name := $(sdk_name)_$(INTERNAL_SDK_HOST_OS_NAME)
|
2009-03-04 11:28:42 +08:00
|
|
|
|
|
|
|
sdk_dep_file := $(sdk_dir)/sdk_deps.mk
|
|
|
|
|
|
|
|
ATREE_FILES :=
|
|
|
|
-include $(sdk_dep_file)
|
|
|
|
|
|
|
|
# if we don't have a real list, then use "everything"
|
|
|
|
ifeq ($(strip $(ATREE_FILES)),)
|
|
|
|
ATREE_FILES := \
|
|
|
|
$(ALL_PREBUILT) \
|
|
|
|
$(ALL_COPIED_HEADERS) \
|
|
|
|
$(ALL_GENERATED_SOURCES) \
|
|
|
|
$(ALL_DEFAULT_INSTALLED_MODULES) \
|
|
|
|
$(INSTALLED_RAMDISK_TARGET) \
|
|
|
|
$(ALL_DOCS) \
|
|
|
|
$(ALL_SDK_FILES)
|
|
|
|
endif
|
|
|
|
|
|
|
|
atree_dir := development/build
|
|
|
|
|
2011-03-23 18:20:14 +08:00
|
|
|
# sdk/build/tools.atree contains the generic rules, while
|
|
|
|
#
|
|
|
|
# sdk/build/tools.$(TARGET_ARCH).atree contains target-specific rules
|
|
|
|
# the latter is optional.
|
|
|
|
#
|
|
|
|
sdk_tools_atree_files := sdk/build/tools.atree
|
|
|
|
ifneq (,$(strip $(wildcard sdk/build/tools.$(TARGET_ARCH).atree)))
|
|
|
|
sdk_tools_atree_files += sdk/build/tools.$(TARGET_ARCH).atree
|
|
|
|
endif
|
2012-03-03 04:40:04 +08:00
|
|
|
ifneq (,$(strip $(wildcard sdk/build/tools.$(HOST_OS).atree)))
|
|
|
|
sdk_tools_atree_files += sdk/build/tools.$(HOST_OS).atree
|
|
|
|
endif
|
|
|
|
ifneq (,$(strip $(wildcard sdk/build/tools.$(HOST_OS)-$(HOST_ARCH).atree)))
|
|
|
|
sdk_tools_atree_files += sdk/build/tools.$(HOST_OS)-$(HOST_ARCH).atree
|
|
|
|
endif
|
2011-03-23 18:20:14 +08:00
|
|
|
|
2009-03-04 11:28:42 +08:00
|
|
|
sdk_atree_files := \
|
|
|
|
$(atree_dir)/sdk.exclude.atree \
|
|
|
|
$(atree_dir)/sdk.atree \
|
2010-09-28 06:51:32 +08:00
|
|
|
$(atree_dir)/sdk-$(HOST_OS)-$(HOST_ARCH).atree \
|
2011-03-23 18:20:14 +08:00
|
|
|
$(sdk_tools_atree_files)
|
2009-03-04 11:28:42 +08:00
|
|
|
|
2011-06-23 18:49:02 +08:00
|
|
|
# development/build/sdk-android-<abi>.atree is used to differentiate
|
|
|
|
# between architecture models (e.g. ARMv5TE versus ARMv7) when copying
|
|
|
|
# files like the kernel image. We use TARGET_CPU_ABI because we don't
|
|
|
|
# have a better way to distinguish between CPU models.
|
|
|
|
ifneq (,$(strip $(wildcard $(atree_dir)/sdk-android-$(TARGET_CPU_ABI).atree)))
|
|
|
|
sdk_atree_files += $(atree_dir)/sdk-android-$(TARGET_CPU_ABI).atree
|
|
|
|
endif
|
|
|
|
|
2009-03-04 11:28:42 +08:00
|
|
|
deps := \
|
|
|
|
$(target_notice_file_txt) \
|
|
|
|
$(tools_notice_file_txt) \
|
|
|
|
$(OUT_DOCS)/offline-sdk-timestamp \
|
2010-04-01 08:29:04 +08:00
|
|
|
$(SYMBOLS_ZIP) \
|
2009-06-16 12:25:32 +08:00
|
|
|
$(INSTALLED_SYSTEMIMAGE) \
|
|
|
|
$(INSTALLED_USERDATAIMAGE_TARGET) \
|
|
|
|
$(INSTALLED_RAMDISK_TARGET) \
|
2009-03-04 11:28:42 +08:00
|
|
|
$(INSTALLED_SDK_BUILD_PROP_TARGET) \
|
2010-04-01 08:29:04 +08:00
|
|
|
$(INSTALLED_BUILD_PROP_TARGET) \
|
2009-03-04 11:28:42 +08:00
|
|
|
$(ATREE_FILES) \
|
|
|
|
$(atree_dir)/sdk.atree \
|
2011-03-23 18:20:14 +08:00
|
|
|
$(sdk_tools_atree_files) \
|
2009-03-04 11:28:42 +08:00
|
|
|
$(HOST_OUT_EXECUTABLES)/atree \
|
2012-08-17 19:19:38 +08:00
|
|
|
$(HOST_OUT_EXECUTABLES)/line_endings
|
2009-03-04 11:28:42 +08:00
|
|
|
|
|
|
|
INTERNAL_SDK_TARGET := $(sdk_dir)/$(sdk_name).zip
|
|
|
|
$(INTERNAL_SDK_TARGET): PRIVATE_NAME := $(sdk_name)
|
|
|
|
$(INTERNAL_SDK_TARGET): PRIVATE_DIR := $(sdk_dir)/$(sdk_name)
|
|
|
|
$(INTERNAL_SDK_TARGET): PRIVATE_DEP_FILE := $(sdk_dep_file)
|
|
|
|
$(INTERNAL_SDK_TARGET): PRIVATE_INPUT_FILES := $(sdk_atree_files)
|
|
|
|
|
|
|
|
# Set SDK_GNU_ERROR to non-empty to fail when a GNU target is built.
|
|
|
|
#
|
|
|
|
#SDK_GNU_ERROR := true
|
|
|
|
|
|
|
|
$(INTERNAL_SDK_TARGET): $(deps)
|
|
|
|
@echo "Package SDK: $@"
|
|
|
|
$(hide) rm -rf $(PRIVATE_DIR) $@
|
|
|
|
$(hide) for f in $(target_gnu_MODULES); do \
|
|
|
|
if [ -f $$f ]; then \
|
|
|
|
echo SDK: $(if $(SDK_GNU_ERROR),ERROR:,warning:) \
|
|
|
|
including GNU target $$f >&2; \
|
|
|
|
FAIL=$(SDK_GNU_ERROR); \
|
|
|
|
fi; \
|
|
|
|
done; \
|
|
|
|
if [ $$FAIL ]; then exit 1; fi
|
|
|
|
$(hide) ( \
|
2012-06-07 10:33:31 +08:00
|
|
|
ATREE_STRIP="strip -x" \
|
2009-03-04 11:28:42 +08:00
|
|
|
$(HOST_OUT_EXECUTABLES)/atree \
|
|
|
|
$(addprefix -f ,$(PRIVATE_INPUT_FILES)) \
|
|
|
|
-m $(PRIVATE_DEP_FILE) \
|
|
|
|
-I . \
|
|
|
|
-I $(PRODUCT_OUT) \
|
|
|
|
-I $(HOST_OUT) \
|
|
|
|
-I $(TARGET_COMMON_OUT_ROOT) \
|
|
|
|
-v "PLATFORM_NAME=android-$(PLATFORM_VERSION)" \
|
2011-01-06 06:58:17 +08:00
|
|
|
-v "OUT_DIR=$(OUT_DIR)" \
|
2011-11-16 08:29:16 +08:00
|
|
|
-v "HOST_OUT=$(HOST_OUT)" \
|
2011-02-19 07:06:20 +08:00
|
|
|
-v "TARGET_ARCH=$(TARGET_ARCH)" \
|
|
|
|
-v "TARGET_CPU_ABI=$(TARGET_CPU_ABI)" \
|
2011-08-25 20:28:03 +08:00
|
|
|
-v "DLL_EXTENSION=$(HOST_SHLIB_SUFFIX)" \
|
2009-03-04 11:28:42 +08:00
|
|
|
-o $(PRIVATE_DIR) && \
|
|
|
|
cp -f $(target_notice_file_txt) \
|
2011-09-22 01:22:19 +08:00
|
|
|
$(PRIVATE_DIR)/system-images/android-$(PLATFORM_VERSION)/$(TARGET_CPU_ABI)/NOTICE.txt && \
|
2009-03-04 11:28:42 +08:00
|
|
|
cp -f $(tools_notice_file_txt) $(PRIVATE_DIR)/tools/NOTICE.txt && \
|
2011-03-16 04:28:40 +08:00
|
|
|
cp -f $(tools_notice_file_txt) $(PRIVATE_DIR)/platform-tools/NOTICE.txt && \
|
2009-03-04 11:28:42 +08:00
|
|
|
HOST_OUT_EXECUTABLES=$(HOST_OUT_EXECUTABLES) HOST_OS=$(HOST_OS) \
|
2011-02-02 05:30:00 +08:00
|
|
|
development/build/tools/sdk_clean.sh $(PRIVATE_DIR) && \
|
2009-03-04 11:28:42 +08:00
|
|
|
chmod -R ug+rwX $(PRIVATE_DIR) && \
|
|
|
|
cd $(dir $@) && zip -rq $(notdir $@) $(PRIVATE_NAME) \
|
|
|
|
) || ( rm -rf $(PRIVATE_DIR) $@ && exit 44 )
|
|
|
|
|
2010-04-17 08:50:09 +08:00
|
|
|
|
|
|
|
# Is a Windows SDK requested? If so, we need some definitions from here
|
|
|
|
# in order to find the Linux SDK used to create the Windows one.
|
2011-02-16 08:09:36 +08:00
|
|
|
MAIN_SDK_NAME := $(sdk_name)
|
|
|
|
MAIN_SDK_DIR := $(sdk_dir)
|
|
|
|
MAIN_SDK_ZIP := $(INTERNAL_SDK_TARGET)
|
2010-04-17 08:50:09 +08:00
|
|
|
ifneq ($(filter win_sdk,$(MAKECMDGOALS)),)
|
|
|
|
include $(TOPDIR)development/build/tools/windows_sdk.mk
|
|
|
|
endif
|
|
|
|
|
2009-03-04 11:28:42 +08:00
|
|
|
# -----------------------------------------------------------------
|
|
|
|
# Findbugs
|
|
|
|
INTERNAL_FINDBUGS_XML_TARGET := $(PRODUCT_OUT)/findbugs.xml
|
|
|
|
INTERNAL_FINDBUGS_HTML_TARGET := $(PRODUCT_OUT)/findbugs.html
|
|
|
|
$(INTERNAL_FINDBUGS_XML_TARGET): $(ALL_FINDBUGS_FILES)
|
|
|
|
@echo UnionBugs: $@
|
|
|
|
$(hide) prebuilt/common/findbugs/bin/unionBugs $(ALL_FINDBUGS_FILES) \
|
|
|
|
> $@
|
|
|
|
$(INTERNAL_FINDBUGS_HTML_TARGET): $(INTERNAL_FINDBUGS_XML_TARGET)
|
|
|
|
@echo ConvertXmlToText: $@
|
|
|
|
$(hide) prebuilt/common/findbugs/bin/convertXmlToText -html:fancy.xsl \
|
|
|
|
$(INTERNAL_FINDBUGS_XML_TARGET) > $@
|
|
|
|
|
|
|
|
# -----------------------------------------------------------------
|
|
|
|
# Findbugs
|
|
|
|
|
|
|
|
# -----------------------------------------------------------------
|
|
|
|
# These are some additional build tasks that need to be run.
|
|
|
|
include $(sort $(wildcard $(BUILD_SYSTEM)/tasks/*.mk))
|
2010-11-12 22:46:00 +08:00
|
|
|
-include $(sort $(wildcard vendor/*/build/tasks/*.mk))
|
2012-04-17 01:03:16 +08:00
|
|
|
-include $(sort $(wildcard device/*/build/tasks/*.mk))
|
2011-02-16 08:09:36 +08:00
|
|
|
|
|
|
|
# -----------------------------------------------------------------
|
|
|
|
# Create SDK repository packages. Must be done after tasks/* since
|
|
|
|
# we need the addon rules defined.
|
|
|
|
ifneq ($(sdk_repo_goal),)
|
|
|
|
include $(TOPDIR)development/build/tools/sdk_repo.mk
|
|
|
|
endif
|