diff options
27 files changed, 260 insertions, 130 deletions
diff --git a/core/Makefile b/core/Makefile index 0965fa7..35773bf 100644 --- a/core/Makefile +++ b/core/Makefile @@ -215,16 +215,9 @@ name := $(name)-apkcerts-$(FILE_NAME_TAG) intermediates := \ $(call intermediates-dir-for,PACKAGING,apkcerts) APKCERTS_FILE := $(intermediates)/$(name).txt -# Depending on the built packages isn't exactly right, -# but it should guarantee that the apkcerts file is rebuilt -# if any packages change which certs they're signed with. -all_built_packages := $(foreach p,$(PACKAGES),$(ALL_MODULES.$(p).BUILT)) -ifneq ($(TARGET_BUILD_APPS),) -# We don't need to really build all the modules for apps_only build. +# We don't need to really build all the modules. +# TODO: rebuild APKCERTS_FILE if any app change its cert. $(APKCERTS_FILE): -else -$(APKCERTS_FILE): $(all_built_packages) -endif @echo APK certs list: $@ @mkdir -p $(dir $@) @rm -f $@ @@ -238,7 +231,9 @@ endif .PHONY: apkcerts-list apkcerts-list: $(APKCERTS_FILE) -$(call dist-for-goals, apps_only, $(APKCERTS_FILE):apkcerts.txt) +ifneq (,$(TARGET_BUILD_APPS)) + $(call dist-for-goals, apps_only, $(APKCERTS_FILE):apkcerts.txt) +endif # ----------------------------------------------------------------- # module info file @@ -656,11 +651,12 @@ 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) -$(RECOVERY_INSTALL_OTA_KEYS): $(OTA_PUBLIC_KEYS) $(DUMPKEY_JAR) - @echo "DumpPublicKey: $@ <= $(PRIVATE_OTA_PUBLIC_KEYS)" +$(RECOVERY_INSTALL_OTA_KEYS): extra_keys := $(patsubst %,%.x509.pem,$(TARGET_EXTRA_RECOVERY_KEYS)) +$(RECOVERY_INSTALL_OTA_KEYS): $(OTA_PUBLIC_KEYS) $(DUMPKEY_JAR) $(extra_keys) + @echo "DumpPublicKey: $@ <= $(PRIVATE_OTA_PUBLIC_KEYS) $(extra_keys)" @rm -rf $@ @mkdir -p $(dir $@) - java -jar $(DUMPKEY_JAR) $(PRIVATE_OTA_PUBLIC_KEYS) > $@ + java -jar $(DUMPKEY_JAR) $(PRIVATE_OTA_PUBLIC_KEYS) $(extra_keys) > $@ $(INSTALLED_RECOVERYIMAGE_TARGET): $(MKBOOTFS) $(MKBOOTIMG) $(MINIGZIP) \ $(INSTALLED_RAMDISK_TARGET) \ @@ -1069,6 +1065,9 @@ endif ifdef INTERNAL_USERIMAGES_SPARSE_EXT_FLAG $(hide) echo "extfs_sparse_flag=$(INTERNAL_USERIMAGES_SPARSE_EXT_FLAG)" >> $(zip_root)/META/misc_info.txt endif +ifdef TARGET_EXTRA_RECOVERY_KEYS + $(hide) echo "extra_recovery_keys=$(TARGET_EXTRA_RECOVERY_KEYS)" >> $(zip_root)/META/misc_info.txt +endif @# Zip everything up, preserving symlinks $(hide) (cd $(zip_root) && zip -qry ../$(notdir $@) .) @# Run fs_config on all the system files in the zip, and save the output @@ -1081,7 +1080,7 @@ target-files-package: $(BUILT_TARGET_FILES_PACKAGE) ifneq ($(TARGET_SIMULATOR),true) ifneq ($(TARGET_PRODUCT),sdk) -ifneq ($(TARGET_DEVICE),generic) +ifeq ($(filter generic%,$(TARGET_DEVICE)),) ifneq ($(TARGET_NO_KERNEL),true) # ----------------------------------------------------------------- @@ -1136,7 +1135,7 @@ $(INTERNAL_UPDATE_PACKAGE_TARGET): $(BUILT_TARGET_FILES_PACKAGE) $(OTATOOLS) updatepackage: $(INTERNAL_UPDATE_PACKAGE_TARGET) endif # TARGET_NO_KERNEL != true -endif # TARGET_DEVICE != generic +endif # TARGET_DEVICE != generic* endif # TARGET_PRODUCT != sdk endif # TARGET_SIMULATOR != true diff --git a/core/base_rules.mk b/core/base_rules.mk index d0c4aaf..1178800 100644 --- a/core/base_rules.mk +++ b/core/base_rules.mk @@ -202,7 +202,7 @@ ifdef LOCAL_UNINSTALLABLE_MODULE $(error $(LOCAL_PATH): Illegal use of LOCAL_UNINSTALLABLE_MODULE) endif else - LOCAL_INSTALLED_MODULE := $(LOCAL_MODULE_PATH)/$(LOCAL_MODULE_SUBDIR)$(LOCAL_INSTALLED_MODULE_STEM) + LOCAL_INSTALLED_MODULE := $(LOCAL_MODULE_PATH)/$(LOCAL_INSTALLED_MODULE_STEM) endif # Assemble the list of targets to create PRIVATE_ variables for. @@ -416,12 +416,14 @@ $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_STATIC_JAVA_LIBRARIES := $(full_static_ja # to guarantee that the files in full_java_libs will # be up-to-date. ifdef LOCAL_IS_HOST_MODULE -# TODO: make prebuilt java libraries use the same -# intermediates path pattern as target java libraries. ifeq ($(LOCAL_BUILD_HOST_DEX),true) +$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_BOOTCLASSPATH := -bootclasspath $(call java-lib-files,core-hostdex,$(LOCAL_IS_HOST_MODULE)) + full_java_libs := $(call java-lib-files,$(LOCAL_JAVA_LIBRARIES),$(LOCAL_IS_HOST_MODULE)) full_java_lib_deps := $(call java-lib-deps,$(LOCAL_JAVA_LIBRARIES),$(LOCAL_IS_HOST_MODULE)) else +$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_BOOTCLASSPATH := + full_java_libs := $(addprefix $(HOST_OUT_JAVA_LIBRARIES)/,$(addsuffix $(COMMON_JAVA_PACKAGE_SUFFIX),$(LOCAL_JAVA_LIBRARIES))) full_java_lib_deps := $(full_java_libs) endif # LOCAL_BUILD_HOST_DEX diff --git a/core/binary.mk b/core/binary.mk index b9e884e..dcac435 100644 --- a/core/binary.mk +++ b/core/binary.mk @@ -540,6 +540,7 @@ $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_DEBUG_CFLAGS := $(debug_cflags) $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_C_INCLUDES := $(LOCAL_C_INCLUDES) $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_LDFLAGS := $(LOCAL_LDFLAGS) $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_LDLIBS := $(LOCAL_LDLIBS) +$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_NO_CRT := $(LOCAL_NO_CRT) # this is really the way to get the files onto the command line instead # of using $^, because then LOCAL_ADDITIONAL_DEPENDENCIES doesn't work diff --git a/core/build_id.mk b/core/build_id.mk index e954794..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 := OPENMASTER +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/clear_vars.mk b/core/clear_vars.mk index ca70c55..0d2e215 100644 --- a/core/clear_vars.mk +++ b/core/clear_vars.mk @@ -105,6 +105,7 @@ LOCAL_BUILD_HOST_DEX:= LOCAL_DEX_PREOPT:= LOCAL_PROTOC_OPTIMIZE_TYPE:= # lite(default),micro,full LOCAL_PROTOC_FLAGS:= +LOCAL_NO_CRT:= # Trim MAKEFILE_LIST so that $(call my-dir) doesn't need to # iterate over thousands of entries every time. diff --git a/core/combo/HOST_darwin-x86.mk b/core/combo/HOST_darwin-x86.mk index 121f89b..b829108 100644 --- a/core/combo/HOST_darwin-x86.mk +++ b/core/combo/HOST_darwin-x86.mk @@ -59,14 +59,14 @@ HOST_GLOBAL_ARFLAGS := cqs HOST_CUSTOM_LD_COMMAND := true define transform-host-o-to-shared-lib-inner - $(HOST_CXX) \ +$(hide) $(PRIVATE_CXX) \ -dynamiclib -single_module -read_only_relocs suppress \ $(HOST_GLOBAL_LD_DIRS) \ $(HOST_GLOBAL_LDFLAGS) \ $(PRIVATE_ALL_OBJECTS) \ - $(call normalize-target-libraries,$(PRIVATE_ALL_SHARED_LIBRARIES)) \ - $(call normalize-target-libraries,$(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES)) \ - $(call normalize-target-libraries,$(PRIVATE_ALL_STATIC_LIBRARIES)) \ + $(call normalize-host-libraries,$(PRIVATE_ALL_SHARED_LIBRARIES)) \ + $(call normalize-host-libraries,$(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES)) \ + $(call normalize-host-libraries,$(PRIVATE_ALL_STATIC_LIBRARIES)) \ $(PRIVATE_LDLIBS) \ -o $@ \ $(PRIVATE_LDFLAGS) \ @@ -74,15 +74,15 @@ define transform-host-o-to-shared-lib-inner endef define transform-host-o-to-executable-inner -$(HOST_CXX) \ +$(hide) $(PRIVATE_CXX) \ -o $@ \ -Wl,-dynamic -headerpad_max_install_names \ $(HOST_GLOBAL_LD_DIRS) \ $(HOST_GLOBAL_LDFLAGS) \ - $(call normalize-target-libraries,$(PRIVATE_ALL_SHARED_LIBRARIES)) \ + $(call normalize-host-libraries,$(PRIVATE_ALL_SHARED_LIBRARIES)) \ $(PRIVATE_ALL_OBJECTS) \ - $(call normalize-target-libraries,$(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES)) \ - $(call normalize-target-libraries,$(PRIVATE_ALL_STATIC_LIBRARIES)) \ + $(call normalize-host-libraries,$(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES)) \ + $(call normalize-host-libraries,$(PRIVATE_ALL_STATIC_LIBRARIES)) \ $(PRIVATE_LDFLAGS) \ $(PRIVATE_LDLIBS) \ $(HOST_LIBGCC) diff --git a/core/combo/TARGET_linux-arm.mk b/core/combo/TARGET_linux-arm.mk index abeaf95..6b351fb 100644 --- a/core/combo/TARGET_linux-arm.mk +++ b/core/combo/TARGET_linux-arm.mk @@ -231,15 +231,15 @@ ifeq ($(strip $(WITH_JIT)),) endif define transform-o-to-shared-lib-inner -$(TARGET_CXX) \ +$(hide) $(PRIVATE_CXX) \ -nostdlib -Wl,-soname,$(notdir $@) -Wl,-T,$(BUILD_SYSTEM)/armelf.xsc \ -Wl,--gc-sections \ -Wl,-shared,-Bsymbolic \ $(PRIVATE_TARGET_GLOBAL_LD_DIRS) \ $(PRIVATE_ALL_OBJECTS) \ - $(PRIVATE_TARGET_CRTBEGIN_SO_O) \ + $(if $(filter true,$(PRIVATE_NO_CRT)),,$(PRIVATE_TARGET_CRTBEGIN_SO_O)) \ -Wl,--whole-archive \ - $(call normalize-host-libraries,$(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES)) \ + $(call normalize-target-libraries,$(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES)) \ -Wl,--no-whole-archive \ $(call normalize-target-libraries,$(PRIVATE_ALL_STATIC_LIBRARIES)) \ $(call normalize-target-libraries,$(PRIVATE_ALL_SHARED_LIBRARIES)) \ @@ -248,11 +248,11 @@ $(TARGET_CXX) \ $(PRIVATE_LDFLAGS) \ $(PRIVATE_TARGET_FDO_LIB) \ $(PRIVATE_TARGET_LIBGCC) \ - $(PRIVATE_TARGET_CRTEND_SO_O) + $(if $(filter true,$(PRIVATE_NO_CRT)),,$(PRIVATE_TARGET_CRTEND_SO_O)) endef define transform-o-to-executable-inner -$(TARGET_CXX) -nostdlib -Bdynamic -Wl,-T,$(BUILD_SYSTEM)/armelf.x \ +$(hide) $(PRIVATE_CXX) -nostdlib -Bdynamic -Wl,-T,$(BUILD_SYSTEM)/armelf.x \ -Wl,-dynamic-linker,/system/bin/linker \ -Wl,--gc-sections \ -Wl,-z,nocopyreloc \ @@ -260,22 +260,22 @@ $(TARGET_CXX) -nostdlib -Bdynamic -Wl,-T,$(BUILD_SYSTEM)/armelf.x \ $(TARGET_GLOBAL_LD_DIRS) \ -Wl,-rpath-link=$(TARGET_OUT_INTERMEDIATE_LIBRARIES) \ $(call normalize-target-libraries,$(PRIVATE_ALL_SHARED_LIBRARIES)) \ - $(TARGET_CRTBEGIN_DYNAMIC_O) \ + $(if $(filter true,$(PRIVATE_NO_CRT)),,$(TARGET_CRTBEGIN_DYNAMIC_O)) \ $(PRIVATE_ALL_OBJECTS) \ $(call normalize-target-libraries,$(PRIVATE_ALL_STATIC_LIBRARIES)) \ $(TARGET_GLOBAL_LDFLAGS) \ $(PRIVATE_LDFLAGS) \ $(TARGET_FDO_LIB) \ $(TARGET_LIBGCC) \ - $(TARGET_CRTEND_O) + $(if $(filter true,$(PRIVATE_NO_CRT)),,$(TARGET_CRTEND_O)) endef define transform-o-to-static-executable-inner -$(TARGET_CXX) -nostdlib -Bstatic -Wl,-T,$(BUILD_SYSTEM)/armelf.x \ +$(hide) $(PRIVATE_CXX) -nostdlib -Bstatic -Wl,-T,$(BUILD_SYSTEM)/armelf.x \ -Wl,--gc-sections \ -o $@ \ $(TARGET_GLOBAL_LD_DIRS) \ - $(TARGET_CRTBEGIN_STATIC_O) \ + $(if $(filter true,$(PRIVATE_NO_CRT)),,$(TARGET_CRTBEGIN_STATIC_O)) \ $(TARGET_GLOBAL_LDFLAGS) \ $(PRIVATE_LDFLAGS) \ $(PRIVATE_ALL_OBJECTS) \ @@ -286,5 +286,5 @@ $(TARGET_CXX) -nostdlib -Bstatic -Wl,-T,$(BUILD_SYSTEM)/armelf.x \ $(TARGET_FDO_LIB) \ $(TARGET_LIBGCC) \ -Wl,--end-group \ - $(TARGET_CRTEND_O) + $(if $(filter true,$(PRIVATE_NO_CRT)),,$(TARGET_CRTEND_O)) endef diff --git a/core/combo/TARGET_linux-sh.mk b/core/combo/TARGET_linux-sh.mk index 2600b9e..654539c 100644 --- a/core/combo/TARGET_linux-sh.mk +++ b/core/combo/TARGET_linux-sh.mk @@ -105,6 +105,7 @@ TARGET_C_INCLUDES := \ TARGET_CRTBEGIN_STATIC_O := $(TARGET_OUT_STATIC_LIBRARIES)/crtbegin_static.o TARGET_CRTBEGIN_DYNAMIC_O := $(TARGET_OUT_STATIC_LIBRARIES)/crtbegin_dynamic.o TARGET_CRTEND_O := $(TARGET_OUT_STATIC_LIBRARIES)/crtend_android.o + TARGET_CRTBEGIN_SO_O := $(TARGET_OUT_STATIC_LIBRARIES)/sobegin.o TARGET_CRTEND_SO_O := $(TARGET_OUT_STATIC_LIBRARIES)/soend.o @@ -114,15 +115,15 @@ TARGET_DEFAULT_SYSTEM_SHARED_LIBRARIES := libc libstdc++ libm TARGET_CUSTOM_LD_COMMAND := true define transform-o-to-shared-lib-inner -$(TARGET_CXX) \ +$(hide) $(PRIVATE_CXX) \ -nostdlib -Wl,-soname,$(notdir $@) -Wl,-T,$(BUILD_SYSTEM)/shlelf.xsc \ -Wl,--gc-sections -Wl,-z,norelro \ -Wl,-shared,-Bsymbolic \ $(PRIVATE_TARGET_GLOBAL_LD_DIRS) \ - $(PRIVATE_TARGET_CRTBEGIN_SO_O) \ + $(if $(filter true,$(PRIVATE_NO_CRT)),,$(PRIVATE_TARGET_CRTBEGIN_SO_O)) \ $(PRIVATE_ALL_OBJECTS) \ -Wl,--whole-archive \ - $(call normalize-host-libraries,$(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES)) \ + $(call normalize-target-libraries,$(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES)) \ -Wl,--no-whole-archive \ $(call normalize-target-libraries,$(PRIVATE_ALL_STATIC_LIBRARIES)) \ $(call normalize-target-libraries,$(PRIVATE_ALL_SHARED_LIBRARIES)) \ @@ -130,11 +131,11 @@ $(TARGET_CXX) \ $(PRIVATE_LDFLAGS) \ $(subst -lrt,, $(subst -lpthread,,$(PRIVATE_LDLIBS))) \ $(PRIVATE_TARGET_LIBGCC) \ - $(PRIVATE_TARGET_CRTEND_SO_O) + $(if $(filter true,$(PRIVATE_NO_CRT)),,$(PRIVATE_TARGET_CRTEND_SO_O)) endef define transform-o-to-executable-inner -$(TARGET_CXX) -nostdlib -Bdynamic -Wl,-T,$(BUILD_SYSTEM)/shlelf.x \ +$(hide) $(PRIVATE_CXX) -nostdlib -Bdynamic -Wl,-T,$(BUILD_SYSTEM)/shlelf.x \ -Wl,-dynamic-linker,/system/bin/linker \ -Wl,--gc-sections -Wl,-z,norelro \ -Wl,-z,nocopyreloc \ @@ -142,25 +143,25 @@ $(TARGET_CXX) -nostdlib -Bdynamic -Wl,-T,$(BUILD_SYSTEM)/shlelf.x \ $(TARGET_GLOBAL_LD_DIRS) \ -Wl,-rpath-link=$(TARGET_OUT_INTERMEDIATE_LIBRARIES) \ $(call normalize-target-libraries,$(PRIVATE_ALL_SHARED_LIBRARIES)) \ - $(TARGET_CRTBEGIN_DYNAMIC_O) \ + $(if $(filter true,$(PRIVATE_NO_CRT)),,$(TARGET_CRTBEGIN_DYNAMIC_O)) \ $(PRIVATE_ALL_OBJECTS) \ $(call normalize-target-libraries,$(PRIVATE_ALL_STATIC_LIBRARIES)) \ $(PRIVATE_LDFLAGS) \ $(TARGET_LIBGCC) \ $(subst -lrt,, $(subst -lpthread,,$(PRIVATE_LDLIBS))) \ - $(TARGET_CRTEND_O) + $(if $(filter true,$(PRIVATE_NO_CRT)),,$(TARGET_CRTEND_O)) endef define transform-o-to-static-executable-inner -$(TARGET_CXX) -nostdlib -Bstatic -Wl,-T,$(BUILD_SYSTEM)/shlelf.x \ +$(hide) $(PRIVATE_CXX) -nostdlib -Bstatic -Wl,-T,$(BUILD_SYSTEM)/shlelf.x \ -Wl,--gc-sections -Wl,-z,norelro \ -o $@ \ $(TARGET_GLOBAL_LD_DIRS) \ - $(TARGET_CRTBEGIN_STATIC_O) \ + $(if $(filter true,$(PRIVATE_NO_CRT)),,$(TARGET_CRTBEGIN_STATIC_O)) \ $(PRIVATE_LDFLAGS) \ $(PRIVATE_ALL_OBJECTS) \ $(call normalize-target-libraries,$(PRIVATE_ALL_STATIC_LIBRARIES)) \ $(TARGET_LIBGCC) \ $(subst -lrt,, $(subst -lpthread,,$(PRIVATE_LDLIBS))) \ - $(TARGET_CRTEND_O) + $(if $(filter true,$(PRIVATE_NO_CRT)),,$(TARGET_CRTEND_O)) endef diff --git a/core/combo/TARGET_linux-x86.mk b/core/combo/TARGET_linux-x86.mk index 86695a4..412ec69 100644 --- a/core/combo/TARGET_linux-x86.mk +++ b/core/combo/TARGET_linux-x86.mk @@ -107,7 +107,6 @@ TARGET_CRTBEGIN_STATIC_O := $(TARGET_OUT_STATIC_LIBRARIES)/crtbegin_static.o TARGET_CRTBEGIN_DYNAMIC_O := $(TARGET_OUT_STATIC_LIBRARIES)/crtbegin_dynamic.o TARGET_CRTEND_O := $(TARGET_OUT_STATIC_LIBRARIES)/crtend_android.o - TARGET_CRTBEGIN_SO_O := $(TARGET_OUT_STATIC_LIBRARIES)/crtbegin_so.o TARGET_CRTEND_SO_O := $(TARGET_OUT_STATIC_LIBRARIES)/crtend_so.o @@ -117,28 +116,28 @@ TARGET_DEFAULT_SYSTEM_SHARED_LIBRARIES := libc libstdc++ libm TARGET_CUSTOM_LD_COMMAND := true define transform-o-to-shared-lib-inner -$(TARGET_CXX) \ +$(hide) $(PRIVATE_CXX) \ $(PRIVATE_TARGET_GLOBAL_LDFLAGS) \ -nostdlib -Wl,-soname,$(notdir $@) \ -shared -Bsymbolic \ $(TARGET_GLOBAL_CFLAGS) \ $(PRIVATE_TARGET_GLOBAL_LD_DIRS) \ - $(PRIVATE_TARGET_CRTBEGIN_SO_O) \ + $(if $(filter true,$(PRIVATE_NO_CRT)),,$(PRIVATE_TARGET_CRTBEGIN_SO_O)) \ $(PRIVATE_ALL_OBJECTS) \ -Wl,--whole-archive \ - $(call normalize-host-libraries,$(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES)) \ + $(call normalize-target-libraries,$(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES)) \ -Wl,--no-whole-archive \ $(call normalize-target-libraries,$(PRIVATE_ALL_STATIC_LIBRARIES)) \ $(call normalize-target-libraries,$(PRIVATE_ALL_SHARED_LIBRARIES)) \ -o $@ \ $(PRIVATE_LDFLAGS) \ $(PRIVATE_TARGET_LIBGCC) \ - $(PRIVATE_TARGET_CRTEND_SO_O) + $(if $(filter true,$(PRIVATE_NO_CRT)),,$(PRIVATE_TARGET_CRTEND_SO_O)) endef define transform-o-to-executable-inner -$(TARGET_CXX) \ +$(hide) $(PRIVATE_CXX) \ $(TARGET_GLOBAL_LDFLAGS) \ -nostdlib -Bdynamic \ -Wl,-dynamic-linker,/system/bin/linker \ @@ -147,28 +146,28 @@ $(TARGET_CXX) \ $(TARGET_GLOBAL_LD_DIRS) \ -Wl,-rpath-link=$(TARGET_OUT_INTERMEDIATE_LIBRARIES) \ $(call normalize-target-libraries,$(PRIVATE_ALL_SHARED_LIBRARIES)) \ - $(TARGET_CRTBEGIN_DYNAMIC_O) \ + $(if $(filter true,$(PRIVATE_NO_CRT)),,$(TARGET_CRTBEGIN_DYNAMIC_O)) \ $(PRIVATE_ALL_OBJECTS) \ $(call normalize-target-libraries,$(PRIVATE_ALL_STATIC_LIBRARIES)) \ $(PRIVATE_LDFLAGS) \ $(TARGET_LIBGCC) \ - $(TARGET_CRTEND_O) + $(if $(filter true,$(PRIVATE_NO_CRT)),,$(TARGET_CRTEND_O)) endef define transform-o-to-static-executable-inner -$(TARGET_CXX) \ +$(hide) $(PRIVATE_CXX) \ $(TARGET_GLOBAL_LDFLAGS) \ -nostdlib -Bstatic \ -o $@ \ $(TARGET_GLOBAL_LD_DIRS) \ - $(TARGET_CRTBEGIN_STATIC_O) \ + $(if $(filter true,$(PRIVATE_NO_CRT)),,$(TARGET_CRTBEGIN_STATIC_O)) \ $(PRIVATE_LDFLAGS) \ $(PRIVATE_ALL_OBJECTS) \ -Wl,--start-group \ $(call normalize-target-libraries,$(PRIVATE_ALL_STATIC_LIBRARIES)) \ $(TARGET_LIBGCC) \ -Wl,--end-group \ - $(TARGET_CRTEND_O) + $(if $(filter true,$(PRIVATE_NO_CRT)),,$(TARGET_CRTEND_O)) endef endif #simulator diff --git a/core/definitions.mk b/core/definitions.mk index 2b77f8e..2875e28 100644 --- a/core/definitions.mk +++ b/core/definitions.mk @@ -716,6 +716,7 @@ define dump-module-variables @echo PRIVATE_ALL_STATIC_LIBRARIES=$(PRIVATE_ALL_STATIC_LIBRARIES); @echo PRIVATE_ALL_WHOLE_STATIC_LIBRARIES=$(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES); @echo PRIVATE_ALL_OBJECTS=$(PRIVATE_ALL_OBJECTS); +@echo PRIVATE_NO_CRT=$(PRIVATE_NO_CRT); endef ########################################################### @@ -735,7 +736,7 @@ endef ########################################################### define transform-d-to-p -@cp $(@:%.o=%.d) $(@:%.o=%.P); \ +$(hide) cp $(@:%.o=%.d) $(@:%.o=%.P); \ sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \ -e '/^$$/ d' -e 's/$$/ :/' < $(@:%.o=%.d) >> $(@:%.o=%.P); \ rm -f $(@:%.o=%.d) @@ -875,7 +876,7 @@ $(hide) $(PRIVATE_CXX) \ $(PRIVATE_CPPFLAGS) \ $(PRIVATE_DEBUG_CFLAGS) \ -MD -o $@ $< -$(hide) $(transform-d-to-p) +$(transform-d-to-p) endef @@ -919,12 +920,12 @@ endef define transform-c-to-o $(transform-c-to-o-no-deps) -$(hide) $(transform-d-to-p) +$(transform-d-to-p) endef define transform-s-to-o $(transform-s-to-o-no-deps) -$(hide) $(transform-d-to-p) +$(transform-d-to-p) endef ########################################################### @@ -940,7 +941,7 @@ endef define transform-m-to-o $(transform-m-to-o-no-deps) -$(hide) $(transform-d-to-p) +$(transform-d-to-p) endef ########################################################### @@ -1056,19 +1057,24 @@ $(call _concat-if-arg2-not-empty,$(1),$(wordlist 2501,3000,$(2))) $(call _concat-if-arg2-not-empty,$(1),$(wordlist 3001,99999,$(2))) endef +# $(1): the full path of the source static library. +define _extract-and-include-single-target-whole-static-lib +@echo "preparing StaticLib: $(PRIVATE_MODULE) [including $(1)]" +$(hide) ldir=$(PRIVATE_INTERMEDIATES_DIR)/WHOLE/$(basename $(notdir $(1)))_objs;\ + rm -rf $$ldir; \ + mkdir -p $$ldir; \ + filelist=; \ + for f in `$(TARGET_AR) t $(1)`; do \ + $(TARGET_AR) p $(1) $$f > $$ldir/$$f; \ + filelist="$$filelist $$ldir/$$f"; \ + done ; \ + $(TARGET_AR) $(TARGET_GLOBAL_ARFLAGS) $(PRIVATE_ARFLAGS) $@ $$filelist + +endef + define extract-and-include-target-whole-static-libs $(foreach lib,$(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES), \ - $(hide) echo "preparing StaticLib: $(PRIVATE_MODULE) [including $(lib)]"; \ - ldir=$(PRIVATE_INTERMEDIATES_DIR)/WHOLE/$(basename $(notdir $(lib)))_objs;\ - rm -rf $$ldir; \ - mkdir -p $$ldir; \ - filelist=; \ - for f in `$(TARGET_AR) t $(lib)`; do \ - $(TARGET_AR) p $(lib) $$f > $$ldir/$$f; \ - filelist="$$filelist $$ldir/$$f"; \ - done ; \ - $(TARGET_AR) $(TARGET_GLOBAL_ARFLAGS) $(PRIVATE_ARFLAGS) $@ $$filelist;\ -) + $(call _extract-and-include-single-target-whole-static-lib, $(lib))) endef # Explicitly delete the archive first so that ar doesn't @@ -1085,19 +1091,24 @@ endef ## Commands for running host ar ########################################################### +# $(1): the full path of the source static library. +define _extract-and-include-single-host-whole-static-lib +@echo "preparing StaticLib: $(PRIVATE_MODULE) [including $(1)]" +$(hide) ldir=$(PRIVATE_INTERMEDIATES_DIR)/WHOLE/$(basename $(notdir $(1)))_objs;\ + rm -rf $$ldir; \ + mkdir -p $$ldir; \ + filelist=; \ + for f in `$(HOST_AR) t $(1) | grep '\.o$$'`; do \ + $(HOST_AR) p $(1) $$f > $$ldir/$$f; \ + filelist="$$filelist $$ldir/$$f"; \ + done ; \ + $(HOST_AR) $(HOST_GLOBAL_ARFLAGS) $(PRIVATE_ARFLAGS) $@ $$filelist + +endef + define extract-and-include-host-whole-static-libs $(foreach lib,$(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES), \ - $(hide) echo "preparing StaticLib: $(PRIVATE_MODULE) [including $(lib)]"; \ - ldir=$(PRIVATE_INTERMEDIATES_DIR)/WHOLE/$(basename $(notdir $(lib)))_objs;\ - rm -rf $$ldir; \ - mkdir -p $$ldir; \ - filelist=; \ - for f in `$(HOST_AR) t $(lib) | grep '\.o$$'`; do \ - $(HOST_AR) p $(lib) $$f > $$ldir/$$f; \ - filelist="$$filelist $$ldir/$$f"; \ - done ; \ - $(HOST_AR) $(HOST_GLOBAL_ARFLAGS) $(PRIVATE_ARFLAGS) $@ $$filelist;\ -) + $(call _extract-and-include-single-host-whole-static-lib, $(lib))) endef # Explicitly delete the archive first so that ar doesn't @@ -1119,8 +1130,8 @@ endef # it to be overriden en-masse see combo/linux-arm.make for an example. ifneq ($(HOST_CUSTOM_LD_COMMAND),true) define transform-host-o-to-shared-lib-inner -$(PRIVATE_CXX) \ - -Wl,-rpath-link=$(TARGET_OUT_INTERMEDIATE_LIBRARIES) \ +$(hide) $(PRIVATE_CXX) \ + -Wl,-rpath-link=$(HOST_OUT_INTERMEDIATE_LIBRARIES) \ -Wl,-rpath,\$$ORIGIN/../lib \ -shared -Wl,-soname,$(notdir $@) \ $(PRIVATE_LDFLAGS) \ @@ -1142,13 +1153,13 @@ endif define transform-host-o-to-shared-lib @mkdir -p $(dir $@) @echo "host SharedLib: $(PRIVATE_MODULE) ($@)" -$(hide) $(transform-host-o-to-shared-lib-inner) +$(transform-host-o-to-shared-lib-inner) endef define transform-host-o-to-package @mkdir -p $(dir $@) @echo "host Package: $(PRIVATE_MODULE) ($@)" -$(hide) $(transform-host-o-to-shared-lib-inner) +$(transform-host-o-to-shared-lib-inner) endef @@ -1169,7 +1180,7 @@ endef # it to be overriden en-masse see combo/linux-arm.make for an example. ifneq ($(TARGET_CUSTOM_LD_COMMAND),true) define transform-o-to-shared-lib-inner -$(PRIVATE_CXX) \ +$(hide) $(PRIVATE_CXX) \ $(PRIVATE_TARGET_GLOBAL_LDFLAGS) \ -Wl,-rpath-link=$(TARGET_OUT_INTERMEDIATE_LIBRARIES) \ -Wl,-rpath,\$$ORIGIN/../lib \ @@ -1178,7 +1189,7 @@ $(PRIVATE_CXX) \ $(PRIVATE_TARGET_GLOBAL_LD_DIRS) \ $(PRIVATE_ALL_OBJECTS) \ -Wl,--whole-archive \ - $(call normalize-host-libraries,$(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES)) \ + $(call normalize-target-libraries,$(PRIVATE_ALL_WHOLE_STATIC_LIBRARIES)) \ -Wl,--no-whole-archive \ $(call normalize-target-libraries,$(PRIVATE_ALL_STATIC_LIBRARIES)) \ $(call normalize-target-libraries,$(PRIVATE_ALL_SHARED_LIBRARIES)) \ @@ -1190,13 +1201,13 @@ endif define transform-o-to-shared-lib @mkdir -p $(dir $@) @echo "target SharedLib: $(PRIVATE_MODULE) ($@)" -$(hide) $(transform-o-to-shared-lib-inner) +$(transform-o-to-shared-lib-inner) endef define transform-o-to-package @mkdir -p $(dir $@) @echo "target Package: $(PRIVATE_MODULE) ($@)" -$(hide) $(transform-o-to-shared-lib-inner) +$(transform-o-to-shared-lib-inner) endef @@ -1228,7 +1239,7 @@ endef ifneq ($(TARGET_CUSTOM_LD_COMMAND),true) define transform-o-to-executable-inner -$(PRIVATE_CXX) \ +$(hide) $(PRIVATE_CXX) \ $(TARGET_GLOBAL_LDFLAGS) \ -Wl,-rpath-link=$(TARGET_OUT_INTERMEDIATE_LIBRARIES) \ $(TARGET_GLOBAL_LD_DIRS) \ @@ -1250,7 +1261,7 @@ endif define transform-o-to-executable @mkdir -p $(dir $@) @echo "target Executable: $(PRIVATE_MODULE) ($@)" -$(hide) $(transform-o-to-executable-inner) +$(transform-o-to-executable-inner) endef @@ -1269,7 +1280,7 @@ endif define transform-o-to-static-executable @mkdir -p $(dir $@) @echo "target StaticExecutable: $(PRIVATE_MODULE) ($@)" -$(hide) $(transform-o-to-static-executable-inner) +$(transform-o-to-static-executable-inner) endef @@ -1279,8 +1290,8 @@ endef ifneq ($(HOST_CUSTOM_LD_COMMAND),true) define transform-host-o-to-executable-inner -$(PRIVATE_CXX) \ - -Wl,-rpath-link=$(TARGET_OUT_INTERMEDIATE_LIBRARIES) \ +$(hide) $(PRIVATE_CXX) \ + -Wl,-rpath-link=$(HOST_OUT_INTERMEDIATE_LIBRARIES) \ -Wl,-rpath,\$$ORIGIN/../lib \ $(HOST_GLOBAL_LD_DIRS) \ $(PRIVATE_LDFLAGS) \ @@ -1301,7 +1312,7 @@ endif define transform-host-o-to-executable @mkdir -p $(dir $@) @echo "host Executable: $(PRIVATE_MODULE) ($@)" -$(hide) $(transform-host-o-to-executable-inner) +$(transform-host-o-to-executable-inner) endef @@ -1418,12 +1429,12 @@ $(hide) rm -rf $(PRIVATE_CLASS_INTERMEDIATES_DIR) $(hide) mkdir -p $(dir $@) $(hide) mkdir -p $(PRIVATE_CLASS_INTERMEDIATES_DIR) $(call unzip-jar-files,$(PRIVATE_STATIC_JAVA_LIBRARIES),$(PRIVATE_CLASS_INTERMEDIATES_DIR)) -$(call dump-words-to-file,$(PRIVATE_JAVA_SOURCES),$(dir $(PRIVATE_CLASS_INTERMEDIATES_DIR))/java-source-list) +$(call dump-words-to-file,$(PRIVATE_JAVA_SOURCES),$(PRIVATE_CLASS_INTERMEDIATES_DIR)/java-source-list) $(hide) if [ -d "$(PRIVATE_SOURCE_INTERMEDIATES_DIR)" ]; then \ - find $(PRIVATE_SOURCE_INTERMEDIATES_DIR) -name '*.java' >> $(dir $(PRIVATE_CLASS_INTERMEDIATES_DIR))/java-source-list; \ + find $(PRIVATE_SOURCE_INTERMEDIATES_DIR) -name '*.java' >> $(PRIVATE_CLASS_INTERMEDIATES_DIR)/java-source-list; \ fi -$(hide) tr ' ' '\n' < $(dir $(PRIVATE_CLASS_INTERMEDIATES_DIR))java-source-list \ - | sort -u > $(dir $(PRIVATE_CLASS_INTERMEDIATES_DIR))java-source-list-uniq +$(hide) tr ' ' '\n' < $(PRIVATE_CLASS_INTERMEDIATES_DIR)/java-source-list \ + | sort -u > $(PRIVATE_CLASS_INTERMEDIATES_DIR)/java-source-list-uniq $(hide) $(1) -encoding ascii \ $(strip $(PRIVATE_JAVAC_DEBUG_FLAGS)) \ $(if $(findstring true,$(LOCAL_WARNINGS_ENABLE)),$(xlint_unchecked),) \ @@ -1433,10 +1444,10 @@ $(hide) $(1) -encoding ascii \ $(if $(findstring true,$(LOCAL_WARNINGS_ENABLE)),$(xlint_unchecked),) \ -extdirs "" -d $(PRIVATE_CLASS_INTERMEDIATES_DIR) \ $(PRIVATE_JAVACFLAGS) \ - \@$(dir $(PRIVATE_CLASS_INTERMEDIATES_DIR))java-source-list-uniq \ + \@$(PRIVATE_CLASS_INTERMEDIATES_DIR)/java-source-list-uniq \ || ( rm -rf $(PRIVATE_CLASS_INTERMEDIATES_DIR) ; exit 41 ) -$(hide) rm -f $(dir $(PRIVATE_CLASS_INTERMEDIATES_DIR))/java-source-list -$(hide) rm -f $(dir $(PRIVATE_CLASS_INTERMEDIATES_DIR))/java-source-list-uniq +$(hide) rm -f $(PRIVATE_CLASS_INTERMEDIATES_DIR)/java-source-list +$(hide) rm -f $(PRIVATE_CLASS_INTERMEDIATES_DIR)/java-source-list-uniq $(hide) jar $(if $(strip $(PRIVATE_JAR_MANIFEST)),-cfm,-cf) \ $@ $(PRIVATE_JAR_MANIFEST) -C $(PRIVATE_CLASS_INTERMEDIATES_DIR) . endef @@ -1447,6 +1458,51 @@ $(call compile-java,$(TARGET_JAVAC),$(PRIVATE_BOOTCLASSPATH)) $(hide) rm -rf $(PRIVATE_CLASS_INTERMEDIATES_DIR) endef +# Override the above definitions if we want to do incremetal javac +ifeq (true, $(ENABLE_INCREMENTALJAVAC)) +define compile-java +$(hide) mkdir -p $(dir $@) +$(hide) mkdir -p $(PRIVATE_CLASS_INTERMEDIATES_DIR) +$(hide) touch $(PRIVATE_CLASS_INTERMEDIATES_DIR)/newstamp +$(call unzip-jar-files,$(PRIVATE_STATIC_JAVA_LIBRARIES),$(PRIVATE_CLASS_INTERMEDIATES_DIR)) +$(hide) if [ -e $(PRIVATE_CLASS_INTERMEDIATES_DIR)/stamp ] ; then \ + newerFlag=$$(echo -n "-newer $(PRIVATE_CLASS_INTERMEDIATES_DIR)/stamp") ; \ + fi ; \ + find $(PRIVATE_JAVA_SOURCES) $$newerFlag > $(PRIVATE_CLASS_INTERMEDIATES_DIR)/java-source-list ; \ + if [ -d "$(PRIVATE_SOURCE_INTERMEDIATES_DIR)" ]; then \ + find $(PRIVATE_SOURCE_INTERMEDIATES_DIR) -name '*.java' $$newerFlag >> $(PRIVATE_CLASS_INTERMEDIATES_DIR)/java-source-list; \ + fi +$(hide) tr ' ' '\n' < $(PRIVATE_CLASS_INTERMEDIATES_DIR)/java-source-list \ + | sort -u > $(PRIVATE_CLASS_INTERMEDIATES_DIR)/java-source-list-uniq +@echo "(Incremental) build source files:" +@cat $(PRIVATE_CLASS_INTERMEDIATES_DIR)/java-source-list-uniq +$(hide) if [ -s $(PRIVATE_CLASS_INTERMEDIATES_DIR)/java-source-list-uniq ] ; then \ + $(1) -encoding ascii \ + $(strip $(PRIVATE_JAVAC_DEBUG_FLAGS)) \ + $(if $(findstring true,$(LOCAL_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),) \ + -extdirs "" -d $(PRIVATE_CLASS_INTERMEDIATES_DIR) \ + $(PRIVATE_JAVACFLAGS) \ + \@$(PRIVATE_CLASS_INTERMEDIATES_DIR)/java-source-list-uniq \ + || ( exit 41 ) \ +fi +$(hide) rm -f $(PRIVATE_CLASS_INTERMEDIATES_DIR)/java-source-list +$(hide) rm -f $(PRIVATE_CLASS_INTERMEDIATES_DIR)/java-source-list-uniq +$(hide) rm -f $@ +$(hide) jar $(if $(strip $(PRIVATE_JAR_MANIFEST)),-cfm,-cf) \ + $@ $(PRIVATE_JAR_MANIFEST) -C $(PRIVATE_CLASS_INTERMEDIATES_DIR) . +$(hide) mv $(PRIVATE_CLASS_INTERMEDIATES_DIR)/newstamp $(PRIVATE_CLASS_INTERMEDIATES_DIR)/stamp +endef + +define transform-java-to-classes.jar +@echo "target Java: $(PRIVATE_MODULE) ($(PRIVATE_CLASS_INTERMEDIATES_DIR))" +$(call compile-java,$(TARGET_JAVAC),$(PRIVATE_BOOTCLASSPATH)) +endef +endif # ENABLE_INCREMENTALJAVAC + define transform-classes.jar-to-emma $(hide) java -classpath $(EMMA_JAR) emma instr -outmode fullcopy -outfile \ $(PRIVATE_EMMA_COVERAGE_FILE) -ip $< -d $(PRIVATE_EMMA_INTERMEDIATES_DIR) \ @@ -1570,7 +1626,7 @@ endef # in transform-java-to-classes for the sake of vm-tests. define transform-host-java-to-package @echo "host Java: $(PRIVATE_MODULE) ($(PRIVATE_CLASS_INTERMEDIATES_DIR))" -$(call compile-java,$(HOST_JAVAC),) +$(call compile-java,$(HOST_JAVAC),$(PRIVATE_BOOTCLASSPATH)) $(hide) if [ ! -z "$(PRIVATE_EXTRA_JAR_ARGS)" ]; then jar uf $@ $(PRIVATE_EXTRA_JAR_ARGS); fi endef @@ -1777,8 +1833,10 @@ endif # spare area for each page). # $(1): the partition data size define image-size-from-data-size -$(shell echo $$(($(1) / $(BOARD_NAND_PAGE_SIZE) * \ - ($(BOARD_NAND_PAGE_SIZE)+$(BOARD_NAND_SPARE_SIZE))))) +$(strip $(eval _isfds_value := $$(shell echo $$$$(($(1) / $(BOARD_NAND_PAGE_SIZE) * \ + ($(BOARD_NAND_PAGE_SIZE)+$(BOARD_NAND_SPARE_SIZE))))))\ +$(if $(filter 0, $(_isfds_value)),$(shell echo $$(($(BOARD_NAND_PAGE_SIZE)+$(BOARD_NAND_SPARE_SIZE)))),$(_isfds_value))\ +$(eval _isfds_value :=)) endef # $(1): The file(s) to check (often $@) diff --git a/core/dex_preopt.mk b/core/dex_preopt.mk index 4da2632..9f44c32 100644 --- a/core/dex_preopt.mk +++ b/core/dex_preopt.mk @@ -4,7 +4,7 @@ #################################### # TODO: replace it with device's BOOTCLASSPATH -DEXPREOPT_BOOT_JARS := core:bouncycastle:ext:framework:android.policy:services:core-junit +DEXPREOPT_BOOT_JARS := core:apache-xml:bouncycastle:ext:framework:android.policy:services:core-junit DEXPREOPT_BOOT_JARS_MODULES := $(subst :, ,$(DEXPREOPT_BOOT_JARS)) DEXPREOPT_BUILD_DIR := $(OUT_DIR) diff --git a/core/dynamic_binary.mk b/core/dynamic_binary.mk index 0fa7647..005ccf3 100644 --- a/core/dynamic_binary.mk +++ b/core/dynamic_binary.mk @@ -94,7 +94,7 @@ prelink_input := $(compress_output) # The output of the prelink step is the binary we want to use # for symbolic debugging; the prelink step may move sections # around, so we have to use this version. -prelink_output := $(LOCAL_UNSTRIPPED_PATH)/$(LOCAL_MODULE_SUBDIR)$(LOCAL_BUILT_MODULE_STEM) +prelink_output := $(LOCAL_UNSTRIPPED_PATH)/$(LOCAL_BUILT_MODULE_STEM) # Skip prelinker if it is FDO instrumentation build. ifneq ($(strip $(BUILD_FDO_INSTRUMENT)),) diff --git a/core/key_char_map.mk b/core/key_char_map.mk index 0f112f2..4693743 100644 --- a/core/key_char_map.mk +++ b/core/key_char_map.mk @@ -20,8 +20,14 @@ full_src_files := $(addprefix $(LOCAL_PATH)/,$(LOCAL_SRC_FILES)) $(LOCAL_BUILT_MODULE) : PRIVATE_SRC_FILES := $(full_src_files) +ifeq ($(BUILD_TINY_ANDROID),true) +$(LOCAL_BUILT_MODULE) : $(full_src_files) + @echo KeyCharMap: $@ + @mkdir -p $(dir $@) + $(hide) touch $@ +else $(LOCAL_BUILT_MODULE) : $(full_src_files) $(KCM) @echo KeyCharMap: $@ @mkdir -p $(dir $@) $(hide) $(KCM) $(PRIVATE_SRC_FILES) $@ - +endif
\ No newline at end of file diff --git a/core/main.mk b/core/main.mk index 6c53b8a..1df9a90 100644 --- a/core/main.mk +++ b/core/main.mk @@ -155,7 +155,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 @@ -298,6 +314,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 += \ @@ -318,6 +335,7 @@ ifneq ($(filter eng tests,$(TARGET_BUILD_VARIANT)),) endif endif endif +endif ADDITIONAL_BUILD_PROPERTIES += net.bt.name=Android @@ -457,11 +475,11 @@ subdirs := \ bionic \ system/core \ system/extras/ext4_utils \ + system/extras/su \ build/libs \ build/target \ build/tools/acp \ build/tools/apriori \ - build/tools/kcm \ build/tools/soslim \ external/elfcopy \ external/elfutils \ diff --git a/core/prelink-linux-arm.map b/core/prelink-linux-arm.map index 86cec55..41cd8cd 100644 --- a/core/prelink-linux-arm.map +++ b/core/prelink-linux-arm.map @@ -93,7 +93,6 @@ libjnigraphics.so 0xA9D00000 # [<64K] libskiagl.so 0xA9C00000 # [~1M] # audio -libFLAC.so 0xA9B00000 # [???] libaudiopolicy.so 0xA9A00000 # [~1M] libeffects.so 0xA9980000 # [<64K] libaudioeffect_jni.so 0xA9900000 # [<64K] @@ -182,7 +181,6 @@ libstagefright.so 0xA2B00000 # [~4M] libgsl.so 0xA2A00000 # [~1M] libhtc_acoustic.so 0xA2900000 # [<64K] libhtc_ril.so 0xA2800000 # [~1M] -liblvmxipc.so 0xA2700000 # [~1M] for vendor/nxp libreference-cdma-sms.so 0xA2600000 # [<64K] for hardware/ril # libraries for specific apps or temporary libraries diff --git a/core/version_defaults.mk b/core/version_defaults.mk index 23e45a2..7109989 100644 --- a/core/version_defaults.mk +++ b/core/version_defaults.mk @@ -59,7 +59,7 @@ endif ifeq "" "$(PLATFORM_VERSION_CODENAME)" # This is the current development code-name, if the build is not a final # release build. If this is a final release build, it is simply "REL". - PLATFORM_VERSION_CODENAME := AOSP + PLATFORM_VERSION_CODENAME := Honeycomb endif ifeq "" "$(DEFAULT_APP_TARGET_SDK)" @@ -96,3 +96,4 @@ ifeq "" "$(BUILD_NUMBER)" # anyone trying to parse it as an integer will probably get "0". BUILD_NUMBER := eng.$(USER).$(shell date +%Y%m%d.%H%M%S) endif + diff --git a/envsetup.sh b/envsetup.sh index 4b2c19e..2faeed1 100644 --- a/envsetup.sh +++ b/envsetup.sh @@ -695,6 +695,8 @@ function mmm() ARGS="$ARGS showcommands" elif [ "$DIR" = dist ]; then ARGS="$ARGS dist" + elif [ "$DIR" = incrementaljavac ]; then + ARGS="$ARGS incrementaljavac" else echo "No Android.mk in $DIR." return 1 diff --git a/target/board/generic_x86/BoardConfig.mk b/target/board/generic_x86/BoardConfig.mk index 2268d41..83a8c3e 100644 --- a/target/board/generic_x86/BoardConfig.mk +++ b/target/board/generic_x86/BoardConfig.mk @@ -20,8 +20,9 @@ TARGET_DISK_LAYOUT_CONFIG := build/target/board/generic_x86/disk_layout.conf BOARD_BOOTIMAGE_MAX_SIZE := 8388608 BOARD_SYSLOADER_MAX_SIZE := 7340032 BOARD_FLASH_BLOCK_SIZE := 512 -BOARD_USERDATAIMAGE_PARTITION_SIZE := 50M -BOARD_INSTALLERIMAGE_PARTITION_SIZE := 500M +BOARD_SYSTEMIMAGE_PARTITION_SIZE := 157286400 +BOARD_USERDATAIMAGE_PARTITION_SIZE := 52428800 +BOARD_INSTALLERIMAGE_PARTITION_SIZE := 524288000 TARGET_USERIMAGES_SPARSE_EXT_DISABLED := true diff --git a/target/board/generic_x86/AndroidBoard.mk b/target/board/generic_x86/device.mk index 01ca1b7..bbdc8f4 100644 --- a/target/board/generic_x86/AndroidBoard.mk +++ b/target/board/generic_x86/device.mk @@ -1,5 +1,3 @@ -LOCAL_PATH := $(call my-dir) - ifeq ($(TARGET_PREBUILT_KERNEL),) LOCAL_KERNEL := prebuilt/android-x86/kernel/kernel else @@ -8,4 +6,4 @@ endif PRODUCT_COPY_FILES += \ $(LOCAL_KERNEL):kernel \ - $(LOCAL_PATH)/init.rc:root/init.rc + build/target/board/generic_x86/init.rc:root/init.rc diff --git a/target/product/core.mk b/target/product/core.mk index 06b7003..7957a07 100644 --- a/target/product/core.mk +++ b/target/product/core.mk @@ -23,6 +23,7 @@ PRODUCT_PROPERTY_OVERRIDES := \ ro.config.alarm_alert=Alarm_Classic.ogg PRODUCT_PACKAGES := \ + apache-xml \ bouncycastle \ com.android.location.provider \ com.android.location.provider.xml \ diff --git a/target/product/full_x86.mk b/target/product/full_x86.mk index f137b8a..9e22bc5 100644 --- a/target/product/full_x86.mk +++ b/target/product/full_x86.mk @@ -27,8 +27,10 @@ ifdef NET_ETH0_STARTONBOOT endif $(call inherit-product, $(SRC_TARGET_DIR)/product/full_base.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/board/generic_x86/device.mk) # Overrides PRODUCT_NAME := full_x86 PRODUCT_DEVICE := generic_x86 +PRODUCT_BRAND := Android PRODUCT_MODEL := Full Android x86 diff --git a/target/product/sdk.mk b/target/product/sdk.mk index cfc518a..df96d9d 100644 --- a/target/product/sdk.mk +++ b/target/product/sdk.mk @@ -196,9 +196,9 @@ PRODUCT_LOCALES = \ zh_TW # include available languages for TTS in the system image -include external/svox/pico/lang/PicoLangDeDeInSystem.mk -include external/svox/pico/lang/PicoLangEnGBInSystem.mk -include external/svox/pico/lang/PicoLangEnUsInSystem.mk -include external/svox/pico/lang/PicoLangEsEsInSystem.mk -include external/svox/pico/lang/PicoLangFrFrInSystem.mk -include external/svox/pico/lang/PicoLangItItInSystem.mk +-include external/svox/pico/lang/PicoLangDeDeInSystem.mk +-include external/svox/pico/lang/PicoLangEnGBInSystem.mk +-include external/svox/pico/lang/PicoLangEnUsInSystem.mk +-include external/svox/pico/lang/PicoLangEsEsInSystem.mk +-include external/svox/pico/lang/PicoLangFrFrInSystem.mk +-include external/svox/pico/lang/PicoLangItItInSystem.mk diff --git a/tools/event_log_tags.py b/tools/event_log_tags.py index 81e8b39..645839e 100644 --- a/tools/event_log_tags.py +++ b/tools/event_log_tags.py @@ -90,6 +90,14 @@ class TagFile(object): else: description = None + if description: + # EventLog.java checks that the description field is + # surrounded by parens, so we should too (to avoid a runtime + # crash from badly-formatted descriptions). + if not re.match(r"\(.*\)\s*$", description): + self.AddError("tag \"%s\" has unparseable description" % (tagname,)) + continue + self.tags.append(Tag(tag, tagname, description, self.filename, self.linenum)) except (IOError, OSError), e: diff --git a/tools/releasetools/common.py b/tools/releasetools/common.py index 3cc86bf..a7413a0 100644 --- a/tools/releasetools/common.py +++ b/tools/releasetools/common.py @@ -18,6 +18,7 @@ import getopt import getpass import imp import os +import platform import re import shutil import subprocess @@ -63,6 +64,22 @@ def Run(args, **kwargs): return subprocess.Popen(args, **kwargs) +def CloseInheritedPipes(): + """ Gmake in MAC OS has file descriptor (PIPE) leak. We close those fds + before doing other work.""" + if platform.system() != "Darwin": + return + for d in range(3, 1025): + try: + stat = os.fstat(d) + if stat is not None: + pipebit = stat[0] & 0x1000 + if pipebit != 0: + os.close(d) + except OSError: + pass + + def LoadInfoDict(zip): """Read and parse the META/misc_info.txt key/value pairs from the input target files and return a dict.""" diff --git a/tools/releasetools/img_from_target_files b/tools/releasetools/img_from_target_files index 08817ca..c5b9886 100755 --- a/tools/releasetools/img_from_target_files +++ b/tools/releasetools/img_from_target_files @@ -201,6 +201,7 @@ def main(argv): if __name__ == '__main__': try: + common.CloseInheritedPipes() main(sys.argv[1:]) except common.ExternalError, e: print diff --git a/tools/releasetools/ota_from_target_files b/tools/releasetools/ota_from_target_files index 79c5465..8f5c3fe 100755 --- a/tools/releasetools/ota_from_target_files +++ b/tools/releasetools/ota_from_target_files @@ -807,6 +807,7 @@ def main(argv): if __name__ == '__main__': try: + common.CloseInheritedPipes() main(sys.argv[1:]) except common.ExternalError, e: print diff --git a/tools/releasetools/sign_target_files_apks b/tools/releasetools/sign_target_files_apks index 5fca691..5353063 100755 --- a/tools/releasetools/sign_target_files_apks +++ b/tools/releasetools/sign_target_files_apks @@ -204,6 +204,17 @@ def ReplaceOtaKeys(input_tf_zip, output_tf_zip): except KeyError: raise ExternalError("can't read META/otakeys.txt from input") + misc_info = common.LoadInfoDict(input_tf_zip) + + extra_recovery_keys = misc_info.get("extra_recovery_keys", None) + if extra_recovery_keys: + extra_recovery_keys = [OPTIONS.key_map.get(k, k) + ".x509.pem" + for k in extra_recovery_keys.split()] + if extra_recovery_keys: + print "extra recovery-only key(s): " + ", ".join(extra_recovery_keys) + else: + extra_recovery_keys = [] + mapped_keys = [] for k in keylist: m = re.match(r"^(.*)\.x509\.pem$", k) @@ -217,15 +228,18 @@ def ReplaceOtaKeys(input_tf_zip, output_tf_zip): print "for OTA package verification" else: mapped_keys.append( - OPTIONS.key_map["build/target/product/security/testkey"] + ".x509.pem") + OPTIONS.key_map.get("build/target/product/security/testkey", + "build/target/product/security/testkey") + + ".x509.pem") print "META/otakeys.txt has no keys; using", mapped_keys[0] # recovery uses a version of the key that has been slightly # predigested (by DumpPublicKey.java) and put in res/keys. + # extra_recovery_keys are used only in recovery. p = common.Run(["java", "-jar", os.path.join(OPTIONS.search_path, "framework", "dumpkey.jar")] - + mapped_keys, + + mapped_keys + extra_recovery_keys, stdout=subprocess.PIPE) data, _ = p.communicate() if p.returncode != 0: @@ -234,6 +248,7 @@ def ReplaceOtaKeys(input_tf_zip, output_tf_zip): # SystemUpdateActivity uses the x509.pem version of the keys, but # put into a zipfile system/etc/security/otacerts.zip. + # We DO NOT include the extra_recovery_keys (if any) here. tempfile = cStringIO.StringIO() certs_zip = zipfile.ZipFile(tempfile, "w") |