OSDN Git Service

merge from open-source master
[android-x86/build.git] / core / main.mk
index 5cb160b..4caae0f 100644 (file)
@@ -1,8 +1,13 @@
-
+# Only use ANDROID_BUILD_SHELL to wrap around bash.
+# DO NOT use other shells such as zsh.
+ifdef ANDROID_BUILD_SHELL
+SHELL := $(ANDROID_BUILD_SHELL)
+else
 # Use bash, not whatever shell somebody has installed as /bin/sh
 # This is repeated in config.mk, since envsetup.sh runs that file
 # directly.
 SHELL := /bin/bash
+endif
 
 # this turns off the suffix rules built into make
 .SUFFIXES:
@@ -174,6 +179,9 @@ is_sdk_build :=
 ifneq ($(filter sdk,$(MAKECMDGOALS)),)
 is_sdk_build := true
 endif
+ifneq ($(filter win_sdk,$(MAKECMDGOALS)),)
+is_sdk_build := true
+endif
 ifneq ($(filter sdk_addon,$(MAKECMDGOALS)),)
 is_sdk_build := true
 endif
@@ -191,6 +199,9 @@ ifneq (,$(user_variant))
   ifeq ($(user_variant),userdebug)
     # Pick up some extra useful tools
     tags_to_install += debug
+
+    # Enable Dalvik lock contention logging for userdebug builds.
+    ADDITIONAL_BUILD_PROPERTIES += dalvik.vm.lockprof.threshold=500
   else
     # Disable debugging in plain user builds.
     enable_target_debugging :=
@@ -246,6 +257,7 @@ ifdef is_sdk_build
 ifneq ($(words $(filter-out $(INTERNAL_MODIFIER_TARGETS),$(MAKECMDGOALS))),1)
 $(error The 'sdk' target may not be specified with any other targets)
 endif
+
 # TODO: this should be eng I think.  Since the sdk is built from the eng
 # variant.
 tags_to_install := user debug eng
@@ -254,6 +266,11 @@ ADDITIONAL_BUILD_PROPERTIES += ro.config.nocheckin=yes
 else # !sdk
 endif
 
+# build the full stagefright library
+ifneq ($(strip BUILD_WITH_FULL_STAGEFRIGHT),)
+BUILD_WITH_FULL_STAGEFRIGHT := true
+endif
+
 ## precise GC ##
 
 ifneq ($(filter dalvik.gc.type-precise,$(PRODUCT_TAGS)),)
@@ -286,13 +303,11 @@ ifneq ($(filter eng tests,$(TARGET_BUILD_VARIANT)),)
 endif
 
 ADDITIONAL_BUILD_PROPERTIES += net.bt.name=Android
-ADDITIONAL_BUILD_PROPERTIES += ro.config.sync=yes
 
 # enable vm tracing in files for now to help track
 # the cause of ANRs in the content process
 ADDITIONAL_BUILD_PROPERTIES += dalvik.vm.stack-trace-file=/data/anr/traces.txt
 
-
 # ------------------------------------------------------------
 # Define a function that, given a list of module tags, returns
 # non-empty if that module should be installed in /system.
@@ -385,7 +400,7 @@ ifneq (,$(shell which javac 2>/dev/null))
 subdirs += \
        build/tools/signapk \
        dalvik/dx \
-       dalvik/libcore \
+       libcore \
        sdk/archquery \
        sdk/androidprefs \
        sdk/apkbuilder \
@@ -398,7 +413,6 @@ subdirs += \
        sdk/layoutopt \
        development/apps \
        development/tools/mkstubs \
-       external/googleclient \
        packages
 else
 $(warning SDK_ONLY: javac not available.)
@@ -450,7 +464,7 @@ include $(ONE_SHOT_MAKEFILE)
 # modules as a side-effect.  Do this after including ONE_SHOT_MAKEFILE
 # so that the modules will be installed in the same place they
 # would have been with a normal make.
-CUSTOM_MODULES := $(sort $(call get-tagged-modules,$(ALL_MODULE_TAGS),))
+CUSTOM_MODULES := $(sort $(call get-tagged-modules,$(ALL_MODULE_TAGS)))
 FULL_BUILD :=
 # Stub out the notice targets, which probably aren't defined
 # when using ONE_SHOT_MAKEFILE.
@@ -524,9 +538,6 @@ add-required-deps :=
 
 # Of the modules defined by the component makefiles,
 # determine what we actually want to build.
-# If a module has the "restricted" tag on it, it
-# poisons the rest of the tags and shouldn't appear
-# on any list.
 Default_MODULES := $(sort $(ALL_DEFAULT_INSTALLED_MODULES) \
                           $(CUSTOM_MODULES))
 # TODO: Remove the 3 places in the tree that use
@@ -552,12 +563,12 @@ else
 endif
 # Use tags to get the non-APPS user modules.  Use the product
 # definition files to get the APPS user modules.
-user_MODULES := $(sort $(call get-tagged-modules,user,_class@APPS restricted))
+user_MODULES := $(sort $(call get-tagged-modules,user))
 user_MODULES := $(user_MODULES) $(user_PACKAGES)
 
-eng_MODULES := $(sort $(call get-tagged-modules,eng,restricted))
-debug_MODULES := $(sort $(call get-tagged-modules,debug,restricted))
-tests_MODULES := $(sort $(call get-tagged-modules,tests,restricted))
+eng_MODULES := $(sort $(call get-tagged-modules,eng))
+debug_MODULES := $(sort $(call get-tagged-modules,debug))
+tests_MODULES := $(sort $(call get-tagged-modules,tests))
 
 ifeq ($(strip $(tags_to_install)),)
 $(error ASSERTION FAILED: tags_to_install should not be empty)
@@ -688,6 +699,7 @@ $(call dist-for-goals, droid, \
        $(INSTALLED_FILES_FILE) \
        $(INSTALLED_BUILD_PROP_TARGET) \
        $(BUILT_TARGET_FILES_PACKAGE) \
+       $(INSTALLED_ANDROID_INFO_TXT_TARGET) \
  )
 
 # Tests are installed in userdata.img.  If we're building the tests
@@ -707,7 +719,10 @@ docs: $(ALL_DOCS)
 .PHONY: sdk
 ALL_SDK_TARGETS := $(INTERNAL_SDK_TARGET)
 sdk: $(ALL_SDK_TARGETS)
-$(call dist-for-goals,sdk,$(ALL_SDK_TARGETS))
+$(call dist-for-goals,sdk, \
+       $(ALL_SDK_TARGETS) \
+       $(SYMBOLS_ZIP) \
+ )
 
 .PHONY: findbugs
 findbugs: $(INTERNAL_FINDBUGS_HTML_TARGET) $(INTERNAL_FINDBUGS_XML_TARGET)
@@ -742,4 +757,3 @@ modules:
 .PHONY: showcommands
 showcommands:
        @echo >/dev/null
-