Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8add8cb1 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "base_rules.mk optimizations"

parents 988693fb 8447b811
Loading
Loading
Loading
Loading
+16 −6
Original line number Original line Diff line number Diff line
@@ -174,11 +174,10 @@ endif
# file, tag the module as "gnu".  Search for "*_GPL*", "*_LGPL*" and "*_MPL*"
# file, tag the module as "gnu".  Search for "*_GPL*", "*_LGPL*" and "*_MPL*"
# so that we can also find files like MODULE_LICENSE_GPL_AND_AFL
# so that we can also find files like MODULE_LICENSE_GPL_AND_AFL
#
#
license_files := $(call find-parent-file,$(LOCAL_PATH),MODULE_LICENSE*)
gpl_license_file := $(call find-parent-file,$(LOCAL_PATH),MODULE_LICENSE*_GPL* MODULE_LICENSE*_MPL* MODULE_LICENSE*_LGPL*)
gpl_license_file := $(call find-parent-file,$(LOCAL_PATH),MODULE_LICENSE*_GPL* MODULE_LICENSE*_MPL* MODULE_LICENSE*_LGPL*)
ifneq ($(gpl_license_file),)
ifneq ($(gpl_license_file),)
  my_module_tags += gnu
  my_module_tags += gnu
  ALL_GPL_MODULE_LICENSE_FILES := $(sort $(ALL_GPL_MODULE_LICENSE_FILES) $(gpl_license_file))
  ALL_GPL_MODULE_LICENSE_FILES += $(gpl_license_file)
endif
endif


LOCAL_MODULE_CLASS := $(strip $(LOCAL_MODULE_CLASS))
LOCAL_MODULE_CLASS := $(strip $(LOCAL_MODULE_CLASS))
@@ -316,9 +315,19 @@ $(error $(LOCAL_PATH): $(module_id) already defined by $($(module_id)))
endif
endif
$(module_id) := $(LOCAL_PATH)
$(module_id) := $(LOCAL_PATH)


intermediates := $(call local-intermediates-dir,,$(LOCAL_2ND_ARCH_VAR_PREFIX),$(my_host_cross))
# These are the same as local-intermediates-dir / local-generated-sources dir, but faster
intermediates.COMMON := $(call local-intermediates-dir,COMMON)
intermediates.COMMON := $($(my_prefix)OUT_COMMON_INTERMEDIATES)/$(LOCAL_MODULE_CLASS)/$(LOCAL_MODULE)_intermediates
generated_sources_dir := $(call local-generated-sources-dir)
ifneq (,$(filter $(my_prefix)$(LOCAL_MODULE_CLASS),$(COMMON_MODULE_CLASSES)))
  intermediates := $($(my_prefix)OUT_COMMON_INTERMEDIATES)/$(LOCAL_MODULE_CLASS)/$(LOCAL_MODULE)_intermediates
  generated_sources_dir := $($(my_prefix)OUT_COMMON_GEN)/$(LOCAL_MODULE_CLASS)/$(LOCAL_MODULE)_intermediates
else
  ifneq (,$(filter $(LOCAL_MODULE_CLASS),$(PER_ARCH_MODULE_CLASSES)))
    intermediates := $($(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)OUT_INTERMEDIATES)/$(LOCAL_MODULE_CLASS)/$(LOCAL_MODULE)_intermediates
  else
    intermediates := $($(my_prefix)OUT_INTERMEDIATES)/$(LOCAL_MODULE_CLASS)/$(LOCAL_MODULE)_intermediates
  endif
  generated_sources_dir := $($(my_prefix)OUT_GEN)/$(LOCAL_MODULE_CLASS)/$(LOCAL_MODULE)_intermediates
endif


ifneq ($(LOCAL_OVERRIDES_MODULES),)
ifneq ($(LOCAL_OVERRIDES_MODULES),)
  ifndef LOCAL_IS_HOST_MODULE
  ifndef LOCAL_IS_HOST_MODULE
@@ -925,7 +934,7 @@ INSTALLABLE_FILES.$(LOCAL_INSTALLED_MODULE).MODULE := $(my_register_name)
# Track module-level dependencies.
# Track module-level dependencies.
# Use $(LOCAL_MODULE) instead of $(my_register_name) to ignore module's bitness.
# Use $(LOCAL_MODULE) instead of $(my_register_name) to ignore module's bitness.
ifdef RECORD_ALL_DEPS
ifdef RECORD_ALL_DEPS
ALL_DEPS.MODULES := $(ALL_DEPS.MODULES) $(LOCAL_MODULE)
ALL_DEPS.MODULES += $(LOCAL_MODULE)
ALL_DEPS.$(LOCAL_MODULE).ALL_DEPS := $(sort \
ALL_DEPS.$(LOCAL_MODULE).ALL_DEPS := $(sort \
  $(ALL_DEPS.$(LOCAL_MODULE).ALL_DEPS) \
  $(ALL_DEPS.$(LOCAL_MODULE).ALL_DEPS) \
  $(LOCAL_STATIC_LIBRARIES) \
  $(LOCAL_STATIC_LIBRARIES) \
@@ -939,6 +948,7 @@ ALL_DEPS.$(LOCAL_MODULE).ALL_DEPS := $(sort \
  $(LOCAL_JAVA_LIBRARIES) \
  $(LOCAL_JAVA_LIBRARIES) \
  $(LOCAL_JNI_SHARED_LIBRARIES))
  $(LOCAL_JNI_SHARED_LIBRARIES))


license_files := $(call find-parent-file,$(LOCAL_PATH),MODULE_LICENSE*)
ALL_DEPS.$(LOCAL_MODULE).LICENSE := $(sort $(ALL_DEPS.$(LOCAL_MODULE).LICENSE) $(license_files))
ALL_DEPS.$(LOCAL_MODULE).LICENSE := $(sort $(ALL_DEPS.$(LOCAL_MODULE).LICENSE) $(license_files))
endif
endif


+14 −9
Original line number Original line Diff line number Diff line
@@ -119,6 +119,9 @@ EXPORTS_LIST :=
# All modules already converted to Soong
# All modules already converted to Soong
SOONG_ALREADY_CONV :=
SOONG_ALREADY_CONV :=


# ALL_DEPS.*.ALL_DEPS keys
ALL_DEPS.MODULES :=

###########################################################
###########################################################
## Debugging; prints a variable list to stdout
## Debugging; prints a variable list to stdout
###########################################################
###########################################################
@@ -559,7 +562,7 @@ $(strip \
        $(error $(LOCAL_PATH): Name not defined in call to intermediates-dir-for)) \
        $(error $(LOCAL_PATH): Name not defined in call to intermediates-dir-for)) \
    $(eval _idfPrefix := $(call find-idf-prefix,$(3),$(6))) \
    $(eval _idfPrefix := $(call find-idf-prefix,$(3),$(6))) \
    $(eval _idf2ndArchPrefix := $(if $(strip $(5)),$(TARGET_2ND_ARCH_VAR_PREFIX))) \
    $(eval _idf2ndArchPrefix := $(if $(strip $(5)),$(TARGET_2ND_ARCH_VAR_PREFIX))) \
    $(if $(filter $(_idfPrefix)-$(_idfClass),$(COMMON_MODULE_CLASSES))$(4), \
    $(if $(filter $(_idfPrefix)_$(_idfClass),$(COMMON_MODULE_CLASSES))$(4), \
        $(eval _idfIntBase := $($(_idfPrefix)_OUT_COMMON_INTERMEDIATES)) \
        $(eval _idfIntBase := $($(_idfPrefix)_OUT_COMMON_INTERMEDIATES)) \
      ,$(if $(filter $(_idfClass),$(PER_ARCH_MODULE_CLASSES)),\
      ,$(if $(filter $(_idfClass),$(PER_ARCH_MODULE_CLASSES)),\
          $(eval _idfIntBase := $($(_idf2ndArchPrefix)$(_idfPrefix)_OUT_INTERMEDIATES)) \
          $(eval _idfIntBase := $($(_idf2ndArchPrefix)$(_idfPrefix)_OUT_INTERMEDIATES)) \
@@ -608,7 +611,7 @@ $(strip \
    $(if $(_idfName),, \
    $(if $(_idfName),, \
        $(error $(LOCAL_PATH): Name not defined in call to generated-sources-dir-for)) \
        $(error $(LOCAL_PATH): Name not defined in call to generated-sources-dir-for)) \
    $(eval _idfPrefix := $(call find-idf-prefix,$(3),)) \
    $(eval _idfPrefix := $(call find-idf-prefix,$(3),)) \
    $(if $(filter $(_idfPrefix)-$(_idfClass),$(COMMON_MODULE_CLASSES))$(4), \
    $(if $(filter $(_idfPrefix)_$(_idfClass),$(COMMON_MODULE_CLASSES))$(4), \
        $(eval _idfIntBase := $($(_idfPrefix)_OUT_COMMON_GEN)) \
        $(eval _idfIntBase := $($(_idfPrefix)_OUT_COMMON_GEN)) \
      , \
      , \
        $(eval _idfIntBase := $($(_idfPrefix)_OUT_GEN)) \
        $(eval _idfIntBase := $($(_idfPrefix)_OUT_GEN)) \
@@ -2805,13 +2808,15 @@ endef
#    and use my_compat_dist_$(suite) to define the others.
#    and use my_compat_dist_$(suite) to define the others.
define create-suite-dependencies
define create-suite-dependencies
$(foreach suite, $(LOCAL_COMPATIBILITY_SUITE), \
$(foreach suite, $(LOCAL_COMPATIBILITY_SUITE), \
  $(if $(filter $(suite),$(ALL_COMPATIBILITY_SUITES)),,$(eval ALL_COMPATIBILITY_SUITES += $(suite))) \
  $(if $(filter $(suite),$(ALL_COMPATIBILITY_SUITES)),,\
  $(eval COMPATIBILITY.$(suite).FILES := \
    $(eval ALL_COMPATIBILITY_SUITES += $(suite)) \
    $$(COMPATIBILITY.$(suite).FILES) $$(foreach f,$$(my_compat_dist_$(suite)),$$(call word-colon,2,$$(f))) \
    $(eval COMPATIBILITY.$(suite).FILES :=) \
    $(eval COMPATIBILITY.$(suite).MODULES :=)) \
  $(eval COMPATIBILITY.$(suite).FILES += \
    $$(foreach f,$$(my_compat_dist_$(suite)),$$(call word-colon,2,$$(f))) \
    $$(foreach f,$$(my_compat_dist_config_$(suite)),$$(call word-colon,2,$$(f))) \
    $$(foreach f,$$(my_compat_dist_config_$(suite)),$$(call word-colon,2,$$(f))) \
    $$(my_compat_dist_test_data_$(suite))) \
    $$(my_compat_dist_test_data_$(suite))) \
  $(eval COMPATIBILITY.$(suite).MODULES := \
  $(eval COMPATIBILITY.$(suite).MODULES += $$(my_register_name))) \
    $$(COMPATIBILITY.$(suite).MODULES) $$(my_register_name))) \
$(eval $(my_all_targets) : $(call copy-many-files, \
$(eval $(my_all_targets) : $(call copy-many-files, \
  $(sort $(foreach suite,$(LOCAL_COMPATIBILITY_SUITE),$(my_compat_dist_$(suite))))) \
  $(sort $(foreach suite,$(LOCAL_COMPATIBILITY_SUITE),$(my_compat_dist_$(suite))))) \
  $(call copy-many-xml-files-checked, \
  $(call copy-many-xml-files-checked, \
+1 −1
Original line number Original line Diff line number Diff line
@@ -853,7 +853,7 @@ TARGET_INSTALLER_SYSTEM_OUT := $(TARGET_INSTALLER_OUT)/root/system
  TARGET_INSTALLER_ROOT_OUT \
  TARGET_INSTALLER_ROOT_OUT \
  TARGET_INSTALLER_SYSTEM_OUT
  TARGET_INSTALLER_SYSTEM_OUT


COMMON_MODULE_CLASSES := TARGET-NOTICE_FILES HOST-NOTICE_FILES HOST-JAVA_LIBRARIES
COMMON_MODULE_CLASSES := TARGET_NOTICE_FILES HOST_NOTICE_FILES HOST_JAVA_LIBRARIES
PER_ARCH_MODULE_CLASSES := SHARED_LIBRARIES STATIC_LIBRARIES EXECUTABLES GYP RENDERSCRIPT_BITCODE NATIVE_TESTS HEADER_LIBRARIES RLIB_LIBRARIES DYLIB_LIBRARIES
PER_ARCH_MODULE_CLASSES := SHARED_LIBRARIES STATIC_LIBRARIES EXECUTABLES GYP RENDERSCRIPT_BITCODE NATIVE_TESTS HEADER_LIBRARIES RLIB_LIBRARIES DYLIB_LIBRARIES
.KATI_READONLY := COMMON_MODULE_CLASSES PER_ARCH_MODULE_CLASSES
.KATI_READONLY := COMMON_MODULE_CLASSES PER_ARCH_MODULE_CLASSES


+2 −0
Original line number Original line Diff line number Diff line
@@ -17,6 +17,8 @@
# in installclean between incremental builds on build servers.
# in installclean between incremental builds on build servers.
gpl_source_tgz := $(call intermediates-dir-for,PACKAGING,gpl_source)/gpl_source.tgz
gpl_source_tgz := $(call intermediates-dir-for,PACKAGING,gpl_source)/gpl_source.tgz


ALL_GPL_MODULE_LICENSE_FILES := $(sort $(ALL_GPL_MODULE_LICENSE_FILES))

# FORCE since we can't know whether any of the sources changed
# FORCE since we can't know whether any of the sources changed
$(gpl_source_tgz): PRIVATE_PATHS := $(sort $(patsubst %/, %, $(dir $(ALL_GPL_MODULE_LICENSE_FILES))))
$(gpl_source_tgz): PRIVATE_PATHS := $(sort $(patsubst %/, %, $(dir $(ALL_GPL_MODULE_LICENSE_FILES))))
$(gpl_source_tgz) : $(ALL_GPL_MODULE_LICENSE_FILES)
$(gpl_source_tgz) : $(ALL_GPL_MODULE_LICENSE_FILES)