diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/Makefile | 21 | ||||
-rw-r--r-- | core/base_rules.mk | 21 | ||||
-rw-r--r-- | core/binary.mk | 59 | ||||
-rw-r--r-- | core/build_id.mk | 2 | ||||
-rw-r--r-- | core/cleanbuild.mk | 5 | ||||
-rw-r--r-- | core/clear_vars.mk | 1 | ||||
-rw-r--r-- | core/combo/TARGET_linux-arm.mk | 1 | ||||
-rw-r--r-- | core/config.mk | 2 | ||||
-rw-r--r-- | core/definitions.mk | 49 | ||||
-rw-r--r-- | core/droiddoc.mk | 4 | ||||
-rw-r--r-- | core/envsetup.mk | 4 | ||||
-rw-r--r-- | core/java.mk | 1 | ||||
-rw-r--r-- | core/llvm_config.mk | 12 | ||||
-rw-r--r-- | core/main.mk | 25 | ||||
-rw-r--r-- | core/native_test.mk | 8 | ||||
-rw-r--r-- | core/notice_files.mk | 14 | ||||
-rw-r--r-- | core/prebuilt.mk | 4 | ||||
-rw-r--r-- | core/product_config.mk | 11 |
18 files changed, 154 insertions, 90 deletions
diff --git a/core/Makefile b/core/Makefile index 49a94c8..63f96a4 100644 --- a/core/Makefile +++ b/core/Makefile @@ -907,6 +907,7 @@ INTERNAL_USERDATAIMAGE_FILES += \ $(filter $(TARGET_OUT_DATA)/%,$(tests_MODULES)) endif +ifneq (true,$(BOARD_DONT_BUILD_USERDATA_IMG)) userdataimage_intermediates := \ $(call intermediates-dir-for,PACKAGING,userdata) BUILT_USERDATAIMAGE_TARGET := $(PRODUCT_OUT)/userdata.img @@ -932,6 +933,8 @@ $(INSTALLED_USERDATAIMAGE_TARGET): $(INTERNAL_USERIMAGES_DEPS) \ userdataimage-nodeps: | $(INTERNAL_USERIMAGES_DEPS) $(build-userdataimage-target) +endif # no BOARD_DONT_BUILD_USERDATA_IMG + ####### ## data partition tarball define build-userdatatarball-target @@ -1222,6 +1225,7 @@ endif # TARGET_NO_KERNEL != true endif # TARGET_DEVICE != generic* endif # TARGET_PRODUCT != sdk +ifdef is_tests_build # ----------------------------------------------------------------- # A zip of the tests that are built when running "make tests". # This is very similar to BUILT_TARGET_FILES_PACKAGE, but we @@ -1252,23 +1256,13 @@ $(BUILT_TESTS_ZIP_PACKAGE): \ $(TARGET_OUT_DATA),$(zip_root)/DATA) $(hide) (cd $(zip_root) && zip -qry ../$(notdir $@) .) -.PHONY: tests-zip-package -tests-zip-package: $(BUILT_TESTS_ZIP_PACKAGE) - -# Target needed by tests build -.PHONY: tests-build-target -tests-build-target: $(BUILT_TESTS_ZIP_PACKAGE) - -ifneq (,$(filter $(MAKECMDGOALS),tests-build-target)) - $(call dist-for-goals, tests-build-target, \ - $(BUILT_TESTS_ZIP_PACKAGE)) -endif - .PHONY: tests tests: $(BUILT_TESTS_ZIP_PACKAGE) + ifneq (,$(filter tests, $(MAKECMDGOALS))) -$(call dist-for-goals, tests, $(BUILT_TESTS_ZIP_PACKAGE)) + $(call dist-for-goals, tests, $(BUILT_TESTS_ZIP_PACKAGE)) endif +endif # is_tests_build # ----------------------------------------------------------------- # A zip of the symbols directory. Keep the full paths to make it @@ -1438,7 +1432,6 @@ deps := \ $(atree_dir)/sdk.atree \ $(sdk_tools_atree_files) \ $(HOST_OUT_EXECUTABLES)/atree \ - $(ALL_HOST_INSTALLED_FILES) \ $(HOST_OUT_EXECUTABLES)/line_endings INTERNAL_SDK_TARGET := $(sdk_dir)/$(sdk_name).zip diff --git a/core/base_rules.mk b/core/base_rules.mk index 186c4db..76c059b 100644 --- a/core/base_rules.mk +++ b/core/base_rules.mk @@ -34,11 +34,11 @@ ifdef LOCAL_IS_HOST_MODULE ifneq ($(LOCAL_IS_HOST_MODULE),true) $(error $(LOCAL_PATH): LOCAL_IS_HOST_MODULE must be "true" or empty, not "$(LOCAL_IS_HOST_MODULE)") endif - my_prefix:=HOST_ - my_host:=host- + my_prefix := HOST_ + my_host := host- else - my_prefix:=TARGET_ - my_host:= + my_prefix := TARGET_ + my_host := endif ########################################################### @@ -501,17 +501,6 @@ $(installed_odex) : $(built_odex) | $(ACP) $(LOCAL_INSTALLED_MODULE) : $(installed_odex) endif - -# All host modules that are not tagged with optional are automatically installed. -# Save the installed files in ALL_HOST_INSTALLED_FILES. -ifeq ($(LOCAL_IS_HOST_MODULE),true) - ALL_HOST_INSTALLED_FILES += $(LOCAL_INSTALLED_MODULE) - ifneq ($(filter debug eng tests, $(LOCAL_MODULE_TAGS)),) - $(warning $(LOCAL_MODULE_MAKEFILE): Module "$(LOCAL_MODULE)" has useless module tags: $(filter debug eng tests, $(LOCAL_MODULE_TAGS)). It will be installed anyway.) - LOCAL_MODULE_TAGS := $(filter-out debug eng tests, $(LOCAL_MODULE_TAGS)) - endif -endif - endif # !LOCAL_UNINSTALLABLE_MODULE @@ -593,6 +582,6 @@ $(foreach tag,$(LOCAL_MODULE_TAGS),\ ## NOTICE files ########################################################### -include $(BUILD_SYSTEM)/notice_files.mk +include $(BUILD_NOTICE_FILE) #:vi noexpandtab diff --git a/core/binary.mk b/core/binary.mk index 57c85c2..b635de0 100644 --- a/core/binary.mk +++ b/core/binary.mk @@ -126,6 +126,7 @@ endif my_compiler_dependencies := ifeq ($(strip $(LOCAL_CLANG)),true) LOCAL_CFLAGS += $(CLANG_CONFIG_EXTRA_CFLAGS) + LOCAL_ASFLAGS += $(CLANG_CONFIG_EXTRA_ASFLAGS) LOCAL_LDFLAGS += $(CLANG_CONFIG_EXTRA_LDFLAGS) my_compiler_dependencies := $(CLANG) $(CLANG_CXX) endif @@ -265,6 +266,63 @@ else debug_cflags := endif +#################################################### +## Compile RenderScript with reflected C++ +#################################################### + +renderscript_sources := $(filter %.rs %.fs,$(LOCAL_SRC_FILES)) + +ifneq (,$(renderscript_sources)) + +renderscript_sources_fullpath := $(addprefix $(LOCAL_PATH)/, $(renderscript_sources)) +RenderScript_file_stamp := $(intermediates)/RenderScriptCPP.stamp +renderscript_intermediate := $(intermediates)/renderscript + +ifeq ($(LOCAL_RENDERSCRIPT_CC),) +LOCAL_RENDERSCRIPT_CC := $(LLVM_RS_CC) +endif + +# Turn on all warnings and warnings as errors for RS compiles. +# This can be disabled with LOCAL_RENDERSCRIPT_FLAGS := -Wno-error +renderscript_flags := -Wall -Werror +renderscript_flags += $(LOCAL_RENDERSCRIPT_FLAGS) + +LOCAL_RENDERSCRIPT_INCLUDES := \ + $(TOPDIR)external/clang/lib/Headers \ + $(TOPDIR)frameworks/rs/scriptc \ + $(LOCAL_RENDERSCRIPT_INCLUDES) + +ifneq ($(LOCAL_RENDERSCRIPT_INCLUDES_OVERRIDE),) +LOCAL_RENDERSCRIPT_INCLUDES := $(LOCAL_RENDERSCRIPT_INCLUDES_OVERRIDE) +endif + +$(RenderScript_file_stamp): PRIVATE_RS_INCLUDES := $(LOCAL_RENDERSCRIPT_INCLUDES) +$(RenderScript_file_stamp): PRIVATE_RS_CC := $(LOCAL_RENDERSCRIPT_CC) +$(RenderScript_file_stamp): PRIVATE_RS_FLAGS := $(renderscript_flags) +$(RenderScript_file_stamp): PRIVATE_RS_SOURCE_FILES := $(renderscript_sources_fullpath) +$(RenderScript_file_stamp): PRIVATE_RS_OUTPUT_DIR := $(renderscript_intermediate) +$(RenderScript_file_stamp): $(renderscript_sources_fullpath) $(LOCAL_RENDERSCRIPT_CC) + $(transform-renderscripts-to-cpp-and-bc) + +# include the dependency files (.d) generated by llvm-rs-cc. +renderscript_generated_dep_files := $(addprefix $(renderscript_intermediate)/, \ + $(patsubst %.fs,%.d, $(patsubst %.rs,%.d, $(notdir $(renderscript_sources))))) +-include $(renderscript_generated_dep_files) + +LOCAL_INTERMEDIATE_TARGETS += $(RenderScript_file_stamp) + +rs_generated_cpps := $(addprefix \ + $(renderscript_intermediate)/ScriptC_,$(patsubst %.fs,%.cpp, $(patsubst %.rs,%.cpp, \ + $(notdir $(renderscript_sources))))) + +$(rs_generated_cpps) : $(RenderScript_file_stamp) + +LOCAL_C_INCLUDES += $(renderscript_intermediate) +LOCAL_GENERATED_SOURCES += $(rs_generated_cpps) + +endif + + ########################################################### ## Stuff source generated from one-off tools ########################################################### @@ -654,6 +712,7 @@ endif ########################################################### $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_YACCFLAGS := $(LOCAL_YACCFLAGS) $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_ASFLAGS := $(LOCAL_ASFLAGS) +$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_CONLYFLAGS := $(LOCAL_CONLYFLAGS) $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_CFLAGS := $(LOCAL_CFLAGS) $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_CPPFLAGS := $(LOCAL_CPPFLAGS) $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_RTTI_FLAG := $(LOCAL_RTTI_FLAG) diff --git a/core/build_id.mk b/core/build_id.mk index cfff307..40bb35d 100644 --- a/core/build_id.mk +++ b/core/build_id.mk @@ -23,7 +23,7 @@ # (like "TC1-RC5"). It must be a single word, and is # capitalized by convention. # -BUILD_ID := JB_MR1 +BUILD_ID := MASTER # DISPLAY_BUILD_NUMBER should only be set for development branches, # If set, the BUILD_NUMBER (cl) is appended to the BUILD_ID for diff --git a/core/cleanbuild.mk b/core/cleanbuild.mk index 1b662b9..c17902d 100644 --- a/core/cleanbuild.mk +++ b/core/cleanbuild.mk @@ -191,7 +191,10 @@ installclean_files := \ $(PRODUCT_OUT)/system \ $(PRODUCT_OUT)/dex_bootjars \ $(PRODUCT_OUT)/obj/JAVA_LIBRARIES \ - $(PRODUCT_OUT)/obj/FAKE + $(PRODUCT_OUT)/obj/FAKE \ + $(PRODUCT_OUT)/obj/EXECUTABLES/adbd_intermediates \ + $(PRODUCT_OUT)/obj/EXECUTABLES/init_intermediates + # The files/dirs to delete during a dataclean, which removes any files # in the staging and emulator data partitions. diff --git a/core/clear_vars.mk b/core/clear_vars.mk index dd852a1..e7edbf3 100644 --- a/core/clear_vars.mk +++ b/core/clear_vars.mk @@ -42,6 +42,7 @@ LOCAL_YACCFLAGS:= LOCAL_ASFLAGS:= LOCAL_CFLAGS:= LOCAL_CPPFLAGS:= +LOCAL_CONLYFLAGS:= LOCAL_RTTI_FLAG:= LOCAL_C_INCLUDES:= LOCAL_EXPORT_C_INCLUDE_DIRS:= diff --git a/core/combo/TARGET_linux-arm.mk b/core/combo/TARGET_linux-arm.mk index dd7a8f0..56604df 100644 --- a/core/combo/TARGET_linux-arm.mk +++ b/core/combo/TARGET_linux-arm.mk @@ -138,6 +138,7 @@ TARGET_GLOBAL_LDFLAGS += \ -Wl,-z,relro \ -Wl,-z,now \ -Wl,--warn-shared-textrel \ + -Wl,--fatal-warnings \ -Wl,--icf=safe \ $(arch_variant_ldflags) diff --git a/core/config.mk b/core/config.mk index 1af5a2a..61f72d2 100644 --- a/core/config.mk +++ b/core/config.mk @@ -79,6 +79,7 @@ BUILD_DROIDDOC:= $(BUILD_SYSTEM)/droiddoc.mk BUILD_COPY_HEADERS := $(BUILD_SYSTEM)/copy_headers.mk BUILD_NATIVE_TEST := $(BUILD_SYSTEM)/native_test.mk BUILD_HOST_NATIVE_TEST := $(BUILD_SYSTEM)/host_native_test.mk +BUILD_NOTICE_FILE := $(BUILD_SYSTEM)/notice_files.mk -include cts/build/config.mk @@ -286,7 +287,6 @@ DOXYGEN:= doxygen AAPT := $(HOST_OUT_EXECUTABLES)/aapt$(HOST_EXECUTABLE_SUFFIX) AIDL := $(HOST_OUT_EXECUTABLES)/aidl$(HOST_EXECUTABLE_SUFFIX) PROTOC := $(HOST_OUT_EXECUTABLES)/aprotoc$(HOST_EXECUTABLE_SUFFIX) -ICUDATA := $(HOST_OUT_EXECUTABLES)/icudata$(HOST_EXECUTABLE_SUFFIX) SIGNAPK_JAR := $(HOST_OUT_JAVA_LIBRARIES)/signapk$(COMMON_JAVA_PACKAGE_SUFFIX) MKBOOTFS := $(HOST_OUT_EXECUTABLES)/mkbootfs$(HOST_EXECUTABLE_SUFFIX) MINIGZIP := $(HOST_OUT_EXECUTABLES)/minigzip$(HOST_EXECUTABLE_SUFFIX) diff --git a/core/definitions.mk b/core/definitions.mk index a524b2f..97a909b 100644 --- a/core/definitions.mk +++ b/core/definitions.mk @@ -55,11 +55,6 @@ ALL_MODULE_TAGS:= # its sub-variables.) ALL_MODULE_NAME_TAGS:= -# All host modules are automatically installed (i.e. outside -# of the product configuration scheme). This is a list of the -# install targets (LOCAL_INSTALLED_MODULE). -ALL_HOST_INSTALLED_FILES:= - # Full paths to all prebuilt files that will be copied # (used to make the dependency on acp) ALL_PREBUILT:= @@ -801,7 +796,7 @@ rm -f $(@:$1=$(YACC_HEADER_SUFFIX)) endef ########################################################### -## Commands to compile RenderScript +## Commands to compile RenderScript to Java ########################################################### define transform-renderscripts-to-java-and-bc @@ -824,6 +819,26 @@ $(hide) mkdir -p $(dir $@) $(hide) touch $@ endef +########################################################### +## Commands to compile RenderScript to C++ +########################################################### + +define transform-renderscripts-to-cpp-and-bc +@echo "RenderScript: $(PRIVATE_MODULE) <= $(PRIVATE_RS_SOURCE_FILES)" +$(hide) rm -rf $(PRIVATE_RS_OUTPUT_DIR) +$(hide) mkdir -p $(PRIVATE_RS_OUTPUT_DIR)/ +$(hide) $(PRIVATE_RS_CC) \ + -o $(PRIVATE_RS_OUTPUT_DIR)/ \ + -d $(PRIVATE_RS_OUTPUT_DIR) \ + -a $@ -MD \ + -reflect-c++ \ + $(PRIVATE_RS_FLAGS) \ + $(foreach inc,$(PRIVATE_RS_INCLUDES),$(addprefix -I , $(inc))) \ + $(PRIVATE_RS_SOURCE_FILES) +$(hide) mkdir -p $(dir $@) +$(hide) touch $@ +endef + ########################################################### ## Commands for running aidl @@ -930,15 +945,13 @@ $(hide) $(PRIVATE_CC) \ $(PRIVATE_TARGET_GLOBAL_CFLAGS) \ $(PRIVATE_ARM_CFLAGS) \ ) \ - $(PRIVATE_CFLAGS) \ - $(1) \ - $(PRIVATE_DEBUG_CFLAGS) \ + $(1) \ -MD -MF $(patsubst %.o,%.d,$@) -o $@ $< endef define transform-c-to-o-no-deps @echo "target $(PRIVATE_ARM_MODE) C: $(PRIVATE_MODULE) <= $<" -$(call transform-c-or-s-to-o-no-deps, ) +$(call transform-c-or-s-to-o-no-deps, $(PRIVATE_CFLAGS) $(PRIVATE_CONLYFLAGS) $(PRIVATE_DEBUG_CFLAGS)) endef define transform-s-to-o-no-deps @@ -964,7 +977,7 @@ endef define transform-m-to-o-no-deps @echo "target ObjC: $(PRIVATE_MODULE) <= $<" -$(call transform-c-or-s-to-o-no-deps) +$(call transform-c-or-s-to-o-no-deps, $(PRIVATE_CFLAGS) $(PRIVATE_DEBUG_CFLAGS)) endef define transform-m-to-o @@ -1019,15 +1032,13 @@ $(hide) $(PRIVATE_CC) \ $(if $(PRIVATE_NO_DEFAULT_COMPILER_FLAGS),, \ $(HOST_GLOBAL_CFLAGS) \ ) \ - $(PRIVATE_CFLAGS) \ $(1) \ - $(PRIVATE_DEBUG_CFLAGS) \ -MD -MF $(patsubst %.o,%.d,$@) -o $@ $< endef define transform-host-c-to-o-no-deps @echo "host C: $(PRIVATE_MODULE) <= $<" -$(call transform-host-c-or-s-to-o-no-deps, ) +$(call transform-host-c-or-s-to-o-no-deps, $(PRIVATE_CFLAGS) $(PRIVATE_CONLYFLAGS) $(PRIVATE_DEBUG_CFLAGS)) endef define transform-host-s-to-o-no-deps @@ -1051,7 +1062,7 @@ endef define transform-host-m-to-o-no-deps @echo "host ObjC: $(PRIVATE_MODULE) <= $<" -$(call transform-host-c-or-s-to-o-no-deps) +$(call transform-host-c-or-s-to-o-no-deps, $(PRIVATE_CFLAGS) $(PRIVATE_DEBUG_CFLAGS)) endef define transform-host-m-to-o @@ -1465,11 +1476,11 @@ $(hide) tr ' ' '\n' < $(PRIVATE_CLASS_INTERMEDIATES_DIR)/java-source-list \ $(hide) if [ -s $(PRIVATE_CLASS_INTERMEDIATES_DIR)/java-source-list-uniq ] ; then \ $(1) -encoding UTF-8 \ $(strip $(PRIVATE_JAVAC_DEBUG_FLAGS)) \ - $(if $(findstring true,$(LOCAL_WARNINGS_ENABLE)),$(xlint_unchecked),) \ + $(if $(findstring true,$(PRIVATE_WARNINGS_ENABLE)),$(xlint_unchecked),) \ $(2) \ $(addprefix -classpath ,$(strip \ $(call normalize-path-list,$(PRIVATE_ALL_JAVA_LIBRARIES)))) \ - $(if $(findstring true,$(LOCAL_WARNINGS_ENABLE)),$(xlint_unchecked),) \ + $(if $(findstring true,$(PRIVATE_WARNINGS_ENABLE)),$(xlint_unchecked),) \ -extdirs "" -d $(PRIVATE_CLASS_INTERMEDIATES_DIR) \ $(PRIVATE_JAVACFLAGS) \ \@$(PRIVATE_CLASS_INTERMEDIATES_DIR)/java-source-list-uniq \ @@ -1513,11 +1524,11 @@ $(hide) tr ' ' '\n' < $(PRIVATE_CLASS_INTERMEDIATES_DIR)/java-source-list \ $(hide) if [ -s $(PRIVATE_CLASS_INTERMEDIATES_DIR)/java-source-list-uniq ] ; then \ $(1) -encoding UTF-8 \ $(strip $(PRIVATE_JAVAC_DEBUG_FLAGS)) \ - $(if $(findstring true,$(LOCAL_WARNINGS_ENABLE)),$(xlint_unchecked),) \ + $(if $(findstring true,$(PRIVATE_WARNINGS_ENABLE)),$(xlint_unchecked),) \ $(2) \ $(addprefix -classpath ,$(strip \ $(call normalize-path-list,$(PRIVATE_ALL_JAVA_LIBRARIES) $(PRIVATE_CLASS_INTERMEDIATES_DIR)))) \ - $(if $(findstring true,$(LOCAL_WARNINGS_ENABLE)),$(xlint_unchecked),) \ + $(if $(findstring true,$(PRIVATE_WARNINGS_ENABLE)),$(xlint_unchecked),) \ -extdirs "" -d $(PRIVATE_CLASS_INTERMEDIATES_DIR) \ $(PRIVATE_JAVACFLAGS) \ \@$(PRIVATE_CLASS_INTERMEDIATES_DIR)/java-source-list-uniq \ diff --git a/core/droiddoc.mk b/core/droiddoc.mk index 9f42933..88031ba 100644 --- a/core/droiddoc.mk +++ b/core/droiddoc.mk @@ -22,9 +22,9 @@ LOCAL_IS_HOST_MODULE := $(call true-or-empty,$(LOCAL_IS_HOST_MODULE)) ifeq ($(LOCAL_IS_HOST_MODULE),true) -my_prefix:=HOST_ +my_prefix := HOST_ else -my_prefix:=TARGET_ +my_prefix := TARGET_ endif LOCAL_MODULE_CLASS := $(strip $(LOCAL_MODULE_CLASS)) diff --git a/core/envsetup.mk b/core/envsetup.mk index 2ad6801..7ede47d 100644 --- a/core/envsetup.mk +++ b/core/envsetup.mk @@ -114,10 +114,10 @@ TARGET_COPY_OUT_RECOVERY := recovery # variables that we need in order to locate the output files. include $(BUILD_SYSTEM)/product_config.mk -build_variant := $(filter-out user userdebug eng tests,$(TARGET_BUILD_VARIANT)) +build_variant := $(filter-out eng user userdebug,$(TARGET_BUILD_VARIANT)) ifneq ($(build_variant)-$(words $(TARGET_BUILD_VARIANT)),-1) $(warning bad TARGET_BUILD_VARIANT: $(TARGET_BUILD_VARIANT)) -$(error must be empty or one of: user userdebug eng tests) +$(error must be empty or one of: eng user userdebug) endif # --------------------------------------------------------------- diff --git a/core/java.mk b/core/java.mk index 65c9be9..222106c 100644 --- a/core/java.mk +++ b/core/java.mk @@ -258,6 +258,7 @@ ALL_MODULES.$(LOCAL_MODULE).STUBS := $(full_classes_stubs_jar) # Run build/tools/java-layers.py for more details. layers_file := $(addprefix $(LOCAL_PATH)/, $(LOCAL_JAVA_LAYERS_FILE)) $(full_classes_compiled_jar): PRIVATE_JAVA_LAYERS_FILE := $(layers_file) +$(full_classes_compiled_jar): PRIVATE_WARNINGS_ENABLE := $(LOCAL_WARNINGS_ENABLE) # Compile the java files to a .jar file. # This intentionally depends on java_sources, not all_java_sources. diff --git a/core/llvm_config.mk b/core/llvm_config.mk index 0308b28..93f5f22 100644 --- a/core/llvm_config.mk +++ b/core/llvm_config.mk @@ -21,10 +21,12 @@ CLANG_CONFIG_UNKNOWN_CFLAGS := \ -funswitch-loops ifeq ($(TARGET_ARCH),arm) - CLANG_CONFIG_EXTRA_CFLAGS += \ + CLANG_CONFIG_EXTRA_ASFLAGS += \ -target arm-linux-androideabi \ -nostdlibinc \ - -B$(TARGET_TOOLCHAIN_ROOT)/arm-linux-androideabi/bin \ + -B$(TARGET_TOOLCHAIN_ROOT)/arm-linux-androideabi/bin + CLANG_CONFIG_EXTRA_CFLAGS += \ + $(CLANG_CONFIG_EXTRA_ASFLAGS) \ -mllvm -arm-enable-ehabi CLANG_CONFIG_EXTRA_LDFLAGS += \ -target arm-linux-androideabi \ @@ -40,10 +42,11 @@ ifeq ($(TARGET_ARCH),arm) -Wa,--noexecstack endif ifeq ($(TARGET_ARCH),mips) - CLANG_CONFIG_EXTRA_CFLAGS += \ + CLANG_CONFIG_EXTRA_ASFLAGS += \ -target mipsel-linux-androideabi \ -nostdlibinc \ -B$(TARGET_TOOLCHAIN_ROOT)/mipsel-linux-android/bin + CLANG_CONFIG_EXTRA_CFLAGS += $(CLANG_CONFIG_EXTRA_ASFLAGS) CLANG_CONFIG_EXTRA_LDFLAGS += \ -target mipsel-linux-androideabi \ -B$(TARGET_TOOLCHAIN_ROOT)/mipsel-linux-android/bin @@ -62,10 +65,11 @@ ifeq ($(TARGET_ARCH),mips) -mtune=mips32 endif ifeq ($(TARGET_ARCH),x86) - CLANG_CONFIG_EXTRA_CFLAGS += \ + CLANG_CONFIG_EXTRA_ASFLAGS += \ -target i686-linux-android \ -nostdlibinc \ -B$(TARGET_TOOLCHAIN_ROOT)/i686-linux-android/bin + CLANG_CONFIG_EXTRA_CFLAGS += $(CLANG_CONFIG_EXTRA_ASFLAGS) CLANG_CONFIG_EXTRA_LDFLAGS += \ -target i686-linux-android \ -B$(TARGET_TOOLCHAIN_ROOT)/i686-linux-android/bin diff --git a/core/main.mk b/core/main.mk index e2adb00..ecea8de 100644 --- a/core/main.mk +++ b/core/main.mk @@ -232,8 +232,8 @@ include $(BUILD_SYSTEM)/dex_preopt.mk ifneq ($(filter user userdebug eng,$(MAKECMDGOALS)),) $(info ***************************************************************) $(info ***************************************************************) -$(info Do not pass '$(filter user userdebug eng tests,$(MAKECMDGOALS))' on \ - the make command line.) +$(info Do not pass '$(filter user userdebug eng,$(MAKECMDGOALS))' on \ + the make command line.) $(info Set TARGET_BUILD_VARIANT in buildspec.mk, or use lunch or) $(info choosecombo.) $(info ***************************************************************) @@ -340,12 +340,6 @@ ifneq ($(filter ro.setupwizard.mode=ENABLED, $(call collapse-pairs, $(ADDITIONAL endif endif -## tests ## - -ifeq ($(TARGET_BUILD_VARIANT),tests) -tags_to_install := debug eng tests -endif - ## sdk ## ifdef is_sdk_build @@ -596,16 +590,14 @@ else product_FILES := endif -# When modules are tagged with debug eng or tests, they are installed -# for those variants regardless of what the product spec says. -debug_MODULES := $(sort \ - $(call get-tagged-modules,debug) \ - $(call module-installed-files, $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES_DEBUG)) \ - ) eng_MODULES := $(sort \ $(call get-tagged-modules,eng) \ $(call module-installed-files, $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES_ENG)) \ ) +debug_MODULES := $(sort \ + $(call get-tagged-modules,debug) \ + $(call module-installed-files, $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES_DEBUG)) \ + ) tests_MODULES := $(sort \ $(call get-tagged-modules,tests) \ $(call module-installed-files, $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES_TESTS)) \ @@ -652,7 +644,7 @@ ifdef is_sdk_build # TODO: Should we do this for all builds and not just the sdk? $(foreach m, $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES), \ $(if $(strip $(ALL_MODULES.$(m).INSTALLED)),,\ - $(warning $(ALL_MODULES.$(m).MAKEFILE): Module '$(m)' in PRODUCT_PACKAGES has nothing to install!))) + $(error $(ALL_MODULES.$(m).MAKEFILE): Module '$(m)' in PRODUCT_PACKAGES has nothing to install!))) $(foreach m, $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES_DEBUG), \ $(if $(strip $(ALL_MODULES.$(m).INSTALLED)),,\ $(warning $(ALL_MODULES.$(m).MAKEFILE): Module '$(m)' in PRODUCT_PACKAGES_DEBUG has nothing to install!))) @@ -664,9 +656,6 @@ ifdef is_sdk_build $(warning $(ALL_MODULES.$(m).MAKEFILE): Module '$(m)' in PRODUCT_PACKAGES_TESTS has nothing to install!))) endif -# Install all of the host modules -modules_to_install += $(sort $(modules_to_install) $(ALL_HOST_INSTALLED_FILES)) - # build/core/Makefile contains extra stuff that we don't want to pollute this # top-level makefile with. It expects that ALL_DEFAULT_INSTALLED_MODULES # contains everything that's built during the current make, but it also further diff --git a/core/native_test.mk b/core/native_test.mk index ebe5edf..12cf4af 100644 --- a/core/native_test.mk +++ b/core/native_test.mk @@ -4,12 +4,16 @@ ########################################### LOCAL_CFLAGS += -DGTEST_OS_LINUX_ANDROID -DGTEST_HAS_STD_STRING + +LOCAL_C_INCLUDES += external/gtest/include +LOCAL_STATIC_LIBRARIES += libgtest libgtest_main + +ifndef LOCAL_SDK_VERSION LOCAL_C_INCLUDES += bionic \ bionic/libstdc++/include \ - external/gtest/include \ external/stlport/stlport -LOCAL_STATIC_LIBRARIES += libgtest libgtest_main LOCAL_SHARED_LIBRARIES += libstlport +endif ifndef LOCAL_MODULE_PATH LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_NATIVE_TESTS)/$(LOCAL_MODULE) diff --git a/core/notice_files.mk b/core/notice_files.mk index ee50394..2c0a3d3 100644 --- a/core/notice_files.mk +++ b/core/notice_files.mk @@ -4,11 +4,21 @@ notice_file:=$(strip $(wildcard $(LOCAL_PATH)/NOTICE)) -ifeq ($(LOCAL_MODULE_CLASS),NONE) - # We ignore NOTICE files for modules of type NONE. +ifeq ($(LOCAL_MODULE_CLASS),GYP) + # We ignore NOTICE files for modules of type GYP. notice_file := endif +ifeq ($(LOCAL_MODULE_CLASS),NOTICE_FILES) +# If this is a NOTICE-only module, we don't include base_rule.mk, +# so my_prefix is not set at this point. +ifeq ($(LOCAL_IS_HOST_MODULE),true) + my_prefix := HOST_ +else + my_prefix := TARGET_ +endif +endif + ifdef notice_file # This relies on the name of the directory in PRODUCT_OUT matching where diff --git a/core/prebuilt.mk b/core/prebuilt.mk index f59a17b..05fe758 100644 --- a/core/prebuilt.mk +++ b/core/prebuilt.mk @@ -17,9 +17,9 @@ $(error dont use LOCAL_PREBUILT_JAVA_LIBRARIES anymore LOCAL_PATH=$(LOCAL_PATH)) endif ifdef LOCAL_IS_HOST_MODULE - my_prefix:=HOST_ + my_prefix := HOST_ else - my_prefix:=TARGET_ + my_prefix := TARGET_ endif ifeq (SHARED_LIBRARIES,$(LOCAL_MODULE_CLASS)) # Put the built targets of all shared libraries in a common directory diff --git a/core/product_config.mk b/core/product_config.mk index e05907d..bfbdf78 100644 --- a/core/product_config.mk +++ b/core/product_config.mk @@ -82,7 +82,7 @@ endef # These are the valid values of TARGET_BUILD_VARIANT. Also, if anything else is passed # as the variant in the PRODUCT-$TARGET_BUILD_PRODUCT-$TARGET_BUILD_VARIANT form, # it will be treated as a goal, and the eng variant will be used. -INTERNAL_VALID_VARIANTS := user userdebug eng tests +INTERNAL_VALID_VARIANTS := user userdebug eng # --------------------------------------------------------------- # Provide "PRODUCT-<prodname>-<goal>" targets, which lets you build @@ -109,6 +109,10 @@ ifdef product_goals # The variant they want TARGET_BUILD_VARIANT := $(word 2,$(product_goals)) + ifeq ($(TARGET_BUILD_VARIANT),tests) + $(error "tests" has been deprecated as a build variant. Use it as a build goal instead.) + endif + # The build server wants to do make PRODUCT-dream-installclean # which really means TARGET_PRODUCT=dream make installclean. ifneq ($(filter-out $(INTERNAL_VALID_VARIANTS),$(TARGET_BUILD_VARIANT)),) @@ -119,11 +123,6 @@ ifdef product_goals default_goal_substitution := $(DEFAULT_GOAL) endif - # For tests build, only build tests-build-target - ifeq (tests,$(TARGET_BUILD_VARIANT)) - default_goal_substitution := tests-build-target - endif - # Replace the PRODUCT-* goal with the build goal that it refers to. # Note that this will ensure that it appears in the same relative # position, in case it matters. |