summaryrefslogtreecommitdiffstats
path: root/core/main.mk
diff options
context:
space:
mode:
Diffstat (limited to 'core/main.mk')
-rw-r--r--core/main.mk107
1 files changed, 84 insertions, 23 deletions
diff --git a/core/main.mk b/core/main.mk
index 518fd99..b6c7d1a 100644
--- a/core/main.mk
+++ b/core/main.mk
@@ -61,6 +61,9 @@ $(DEFAULT_GOAL):
.PHONY: FORCE
FORCE:
+# Targets that provide quick help on the build system.
+include $(BUILD_SYSTEM)/help.mk
+
# Set up various standard variables based on configuration
# and host information.
include $(BUILD_SYSTEM)/config.mk
@@ -148,7 +151,23 @@ endif
# These are the modifier targets that don't do anything themselves, but
# change the behavior of the build.
# (must be defined before including definitions.make)
-INTERNAL_MODIFIER_TARGETS := showcommands checkbuild all
+INTERNAL_MODIFIER_TARGETS := showcommands checkbuild all incrementaljavac
+
+.PHONY: incrementaljavac
+incrementaljavac: ;
+
+# WARNING:
+# ENABLE_INCREMENTALJAVAC should NOT be enabled by default, because change of
+# a Java source file won't trigger rebuild of its dependent Java files.
+# You can only enable it by adding "incrementaljavac" to your make command line.
+# You are responsible for the correctness of the incremental build.
+# This may decrease incremental build time dramatically for large Java libraries,
+# such as core.jar, framework.jar, etc.
+ENABLE_INCREMENTALJAVAC :=
+ifneq (,$(filter incrementaljavac, $(MAKECMDGOALS)))
+ENABLE_INCREMENTALJAVAC := true
+MAKECMDGOALS := $(filter-out incrementaljavac, $(MAKECMDGOALS))
+endif
# Bring in standard build system definitions.
include $(BUILD_SYSTEM)/definitions.mk
@@ -291,6 +310,7 @@ ifneq ($(filter dalvik.gc.type-precise,$(PRODUCT_TAGS)),)
ADDITIONAL_BUILD_PROPERTIES += dalvik.vm.dexopt-flags=m=y
endif
+ifneq ($(BUILD_TINY_ANDROID),true)
# Install an apns-conf.xml file if one's not already being installed.
ifeq (,$(filter %:system/etc/apns-conf.xml, $(PRODUCT_COPY_FILES)))
PRODUCT_COPY_FILES += \
@@ -299,17 +319,6 @@ ifeq (,$(filter %:system/etc/apns-conf.xml, $(PRODUCT_COPY_FILES)))
$(warning implicitly installing apns-conf_sdk.xml)
endif
endif
-# If we're on an eng or tests build, but not on the sdk, and we have
-# a better one, use that instead.
-ifneq ($(filter eng tests,$(TARGET_BUILD_VARIANT)),)
- ifndef is_sdk_build
- apns_to_use := $(wildcard vendor/google/etc/apns-conf.xml)
- ifneq ($(strip $(apns_to_use)),)
- PRODUCT_COPY_FILES := \
- $(filter-out %:system/etc/apns-conf.xml,$(PRODUCT_COPY_FILES)) \
- $(strip $(apns_to_use)):system/etc/apns-conf.xml
- endif
- endif
endif
ADDITIONAL_BUILD_PROPERTIES += net.bt.name=Android
@@ -390,13 +399,16 @@ subdirs := \
development/host \
development/tools/etc1tool \
development/tools/line_endings \
+ external/clang \
external/easymock \
external/expat \
external/libpng \
+ external/llvm \
external/qemu \
external/sqlite/dist \
external/zlib \
frameworks/base \
+ frameworks/compile \
sdk/emulator/mksdcard \
sdk/sdklauncher \
system/core/adb \
@@ -454,7 +466,6 @@ subdirs := \
build/target \
build/tools/acp \
build/tools/apriori \
- build/tools/kcm \
build/tools/soslim \
external/elfcopy \
external/elfutils \
@@ -473,6 +484,13 @@ endif # !BUILD_TINY_ANDROID
endif # !SDK_ONLY
+# Before we go and include all of the module makefiles, stash away
+# the PRODUCT_* values so that later we can verify they are not modified.
+stash_product_vars:=true
+ifeq ($(stash_product_vars),true)
+ $(call stash-product-vars, __STASHED)
+endif
+
ifneq ($(ONE_SHOT_MAKEFILE),)
# We've probably been invoked by the "mm" shell function
# with a subdirectory's makefile.
@@ -503,6 +521,26 @@ subdir_makefiles := \
include $(subdir_makefiles)
endif # ONE_SHOT_MAKEFILE
+ifeq ($(stash_product_vars),true)
+ $(call assert-product-vars, __STASHED)
+endif
+
+include $(BUILD_SYSTEM)/legacy_prebuilts.mk
+ifneq ($(filter-out $(GRANDFATHERED_ALL_PREBUILT),$(strip $(notdir $(ALL_PREBUILT)))),)
+ $(warning *** Some files have been added to ALL_PREBUILT.)
+ $(warning *)
+ $(warning * ALL_PREBUILT is a deprecated mechanism that)
+ $(warning * should not be used for new files.)
+ $(warning * As an alternative, use PRODUCT_COPY_FILES in)
+ $(warning * the appropriate product definition.)
+ $(warning * build/target/product/core.mk is the product)
+ $(warning * definition used in all products.)
+ $(warning *)
+ $(foreach bad_prebuilt,$(filter-out $(GRANDFATHERED_ALL_PREBUILT),$(strip $(notdir $(ALL_PREBUILT)))),$(warning * unexpected $(bad_prebuilt) in ALL_PREBUILT))
+ $(warning *)
+ $(error ALL_PREBUILT contains unexpected files)
+endif
+
# -------------------------------------------------------------------
# All module makefiles have been included at this point.
# -------------------------------------------------------------------
@@ -549,6 +587,7 @@ $(foreach m,$(ALL_MODULES), \
)
m :=
r :=
+i :=
add-required-deps :=
# -------------------------------------------------------------------
@@ -686,6 +725,10 @@ boottarball: $(INSTALLED_BOOTTARBALL_TARGET)
.PHONY: userdataimage
userdataimage: $(INSTALLED_USERDATAIMAGE_TARGET)
+ifneq (,$(filter userdataimage, $(MAKECMDGOALS)))
+$(call dist-for-goals, userdataimage, $(BUILT_USERDATAIMAGE_TARGET))
+endif
+
.PHONY: userdatatarball
userdatatarball: $(INSTALLED_USERDATATARBALL_TARGET)
@@ -705,12 +748,15 @@ droidcore: files \
$(INSTALLED_USERDATAIMAGE_TARGET) \
$(INSTALLED_FILES_FILE)
+# dist_files only for putting your library into the dist directory with a full build.
+.PHONY: dist_files
+
ifeq ($(EMMA_INSTRUMENT),true)
- $(call dist-for-goals, droid, $(EMMA_META_ZIP))
+ $(call dist-for-goals, dist_files, $(EMMA_META_ZIP))
endif
-# dist_libraries only for putting your library into the dist directory with a full build.
-.PHONY: dist_libraries
+# Dist for droid if droid is among the cmd goals, or no cmd goal is given.
+ifneq ($(filter droid,$(MAKECMDGOALS))$(filter ||,|$(filter-out $(INTERNAL_MODIFIER_TARGETS),$(MAKECMDGOALS))|),)
ifneq ($(TARGET_BUILD_APPS),)
# If this build is just for apps, only build apps and not the full system by default.
@@ -749,9 +795,10 @@ else # TARGET_BUILD_APPS
)
# Building a full system-- the default is to build droidcore
-droid: droidcore dist_libraries
+droid: droidcore dist_files
-endif
+endif # TARGET_BUILD_APPS
+endif # droid in $(MAKECMDGOALS)
.PHONY: droid tests
@@ -769,11 +816,25 @@ ALL_SDK_TARGETS := $(INTERNAL_SDK_TARGET)
sdk: $(ALL_SDK_TARGETS)
ifneq ($(filter sdk win_sdk,$(MAKECMDGOALS)),)
$(call dist-for-goals,sdk win_sdk, \
- $(ALL_SDK_TARGETS) \
- $(SYMBOLS_ZIP) \
- $(INSTALLED_BUILD_PROP_TARGET) \
- )
-endif
+ $(ALL_SDK_TARGETS) \
+ $(SYMBOLS_ZIP) \
+ $(INSTALLED_BUILD_PROP_TARGET) \
+)
+endif
+
+.PHONY: samplecode
+sample_MODULES := $(sort $(call get-tagged-modules,samples))
+sample_APKS_DEST_PATH := $(TARGET_COMMON_OUT_ROOT)/samples
+sample_APKS_COLLECTION := \
+ $(foreach module,$(sample_MODULES),$(sample_APKS_DEST_PATH)/$(notdir $(module)))
+$(foreach module,$(sample_MODULES),$(eval $(call \
+ copy-one-file,$(module),$(sample_APKS_DEST_PATH)/$(notdir $(module)))))
+sample_ADDITIONAL_INSTALLED := \
+ $(filter-out $(modules_to_install) $(modules_to_check) $(ALL_PREBUILT),$(sample_MODULES))
+samplecode: $(sample_APKS_COLLECTION)
+ @echo "Collect sample code apks: $^"
+ # remove apks that are not intended to be installed.
+ rm -f $(sample_ADDITIONAL_INSTALLED)
.PHONY: findbugs
findbugs: $(INTERNAL_FINDBUGS_HTML_TARGET) $(INTERNAL_FINDBUGS_XML_TARGET)