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

Commit f72e34eb authored by Joe Onorato's avatar Joe Onorato Committed by android code review
Browse files

Merge changes...

Merge changes I9d3a3c16,I17b5d441,I29e27505,Ia5ca233e,I0a0b200b,I6f412ed4,I623821df,Ifec8e63e,I12d0a847,Idac551e5,I59a88027,I2498139d,I6bd93a87

* changes:
  Move the old user tagged modules over to base.mk so mini and core both share them.
  More product debugging.
  build system changes for jb-aah-dev merge
  Fail when a non-vendor product references a vendor module.
  Remove support for user tags in the build system.
  List the user modules explicitly, and we can get rid of the support for the user tag!
  Dump the user tagged modules.
  host modules don't need LOCAL_MODULE_TAGS
  Don't give the user tag to host modules automatically.
  Add a phony "nothing" goal that reads the makefiles but doesn't try to build anything.
  Add tool to parse make dependency info from new --deps flag.
  Use a more modern -j flag.
  make product-graph now filtered
parents 6020d698 22273e6c
Loading
Loading
Loading
Loading
+29 −52
Original line number Diff line number Diff line
@@ -58,51 +58,31 @@ endif
LOCAL_UNINSTALLABLE_MODULE := $(strip $(LOCAL_UNINSTALLABLE_MODULE))
LOCAL_MODULE_TAGS := $(sort $(LOCAL_MODULE_TAGS))
ifeq (,$(LOCAL_MODULE_TAGS))
ifeq (true,$(LOCAL_UNINSTALLABLE_MODULE))
  LOCAL_MODULE_TAGS := optional
else
# Installable modules without tags fall back to user (which is changed to user eng below)
LOCAL_MODULE_TAGS := user
endif
#$(warning default tags: $(lastword $(filter-out config/% out/%,$(MAKEFILE_LIST))))

# User tags are not allowed anymore.  Fail early because it will not be installed
# like it used to be.
ifneq ($(filter $(LOCAL_MODULE_TAGS),user),)
  $(warning *** Module name: $(LOCAL_MODULE))
  $(warning *** Makefile location: $(LOCAL_MODULE_MAKEFILE))
  $(warning * )
  $(warning * Module is attempting to use the 'user' tag.  This)
  $(warning * used to cause the module to be installed automatically.)
  $(warning * Now, the module must be listed in the PRODUCT_PACKAGES)
  $(warning * section of a product makefile to have it installed.)
  $(warning * )
  $(error user tag detected on module.)
endif

# Only the tags mentioned in this test are expected to be set by module
# makefiles. Anything else is either a typo or a source of unexpected
# behaviors.
ifneq ($(filter-out user debug eng tests optional samples shell_ash shell_mksh,$(LOCAL_MODULE_TAGS)),)
ifneq ($(filter-out debug eng tests optional samples shell_ash shell_mksh,$(LOCAL_MODULE_TAGS)),)
$(warning unusual tags $(LOCAL_MODULE_TAGS) on $(LOCAL_MODULE) at $(LOCAL_PATH))
endif

ifneq ($(filter $(LOCAL_MODULE_TAGS),user),)
  ifeq ($(filter $(GRANDFATHERED_USER_MODULES),$(LOCAL_MODULE)),)
    $(warning *** Module name: $(LOCAL_MODULE))
    $(warning *** Makefile location: $(LOCAL_PATH))
    $(warning * )
    $(warning * Each module must use a LOCAL_MODULE_TAGS in its)
    $(warning * Android.mk. Possible tags declared by a module:)
    $(warning * )
    $(warning *     optional, debug, eng, tests, samples)
    $(warning * )
    $(warning * If the module is expected to be in all builds)
    $(warning * of a product, then it should use the)
    $(warning * "optional" tag: )
    $(warning * )
    $(warning *    Add "LOCAL_MODULE_TAGS := optional" in the)
    $(warning *    Android.mk for the affected module, and add)
    $(warning *    the LOCAL_MODULE value for that component)
    $(warning *    into the PRODUCT_PACKAGES section of product)
    $(warning *    makefile(s) where it's necessary, if)
    $(warning *    appropriate.)
    $(warning * )
    $(warning * If the component should be in EVERY build of ALL)
    $(warning * products, then add its LOCAL_MODULE value to the)
    $(warning * PRODUCT_PACKAGES section of)
    $(warning * build/target/product/core.mk)
    $(warning * )
    $(error user tag detected on new module - user tags are only supported on legacy modules)
  endif
endif


# Add implicit tags.
#
@@ -117,27 +97,11 @@ ifneq ($(gpl_license_file),)
  ALL_GPL_MODULE_LICENSE_FILES := $(sort $(ALL_GPL_MODULE_LICENSE_FILES) $(gpl_license_file))
endif

#
# If this module is listed on CUSTOM_MODULES, promote it to "user"
# so that it will be installed in $(TARGET_OUT).
#
ifneq (,$(filter $(LOCAL_MODULE),$(CUSTOM_MODULES)))
  LOCAL_MODULE_TAGS := $(sort $(LOCAL_MODULE_TAGS) user)
endif

LOCAL_MODULE_CLASS := $(strip $(LOCAL_MODULE_CLASS))
ifneq ($(words $(LOCAL_MODULE_CLASS)),1)
  $(error $(LOCAL_PATH): LOCAL_MODULE_CLASS must contain exactly one word, not "$(LOCAL_MODULE_CLASS)")
endif

# Those used to be implicitly ignored, but aren't any more.
# As of 20100110 there are no apps with the user tag.
ifeq ($(LOCAL_MODULE_CLASS),APPS)
  ifneq ($(filter $(LOCAL_MODULE_TAGS),user),)
    $(warning user tag on app $(LOCAL_MODULE) at $(LOCAL_PATH) - add your app to core.mk instead)
  endif
endif

ifneq (true,$(LOCAL_UNINSTALLABLE_MODULE))
ifdef LOCAL_IS_HOST_MODULE
  partition_tag :=
@@ -544,6 +508,17 @@ $(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)
  ifneq ($(filter optional,$(LOCAL_MODULE_TAGS)),optional)
    ALL_HOST_INSTALLED_FILES += $(LOCAL_INSTALLED_MODULE)
  endif
  ifneq ($(filter debug eng tests, $(LOCAL_MODULE_TAGS)),)
    $(error $(LOCAL_MODULE_MAKEFILE): Module "$(LOCAL_MODULE)" has useless module tags: $(filter debug eng tests, $(LOCAL_MODULE_TAGS)). It will be installed anyway.)
  endif
endif

endif # !LOCAL_UNINSTALLABLE_MODULE


@@ -593,6 +568,8 @@ ALL_MODULES.$(LOCAL_MODULE).EVENT_LOG_TAGS := \
    $(ALL_MODULES.$(LOCAL_MODULE).EVENT_LOG_TAGS) $(event_log_tags)
ALL_MODULES.$(LOCAL_MODULE).INTERMEDIATE_SOURCE_DIR := \
    $(ALL_MODULES.$(LOCAL_MODULE).INTERMEDIATE_SOURCE_DIR) $(LOCAL_INTERMEDIATE_SOURCE_DIR)
ALL_MODULES.$(LOCAL_MODULE).MAKEFILE := \
    $(ALL_MODULES.$(LOCAL_MODULE).MAKEFILE) $(LOCAL_MODULE_MAKEFILE)
ifdef LOCAL_MODULE_OWNER
ALL_MODULES.$(LOCAL_MODULE).OWNER := \
    $(strip $(ALL_MODULES.$(LOCAL_MODULE).OWNER) $(LOCAL_MODULE_OWNER))
+5 −4
Original line number Diff line number Diff line
@@ -55,6 +55,11 @@ 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:=
@@ -2040,10 +2045,6 @@ endef
# when requested.
include $(BUILD_SYSTEM)/distdir.mk

# -----------------------------------------------------------------
# The modules allowed to use a user tag
include $(BUILD_SYSTEM)/user_tags.mk

# broken:
#	$(foreach file,$^,$(if $(findstring,.a,$(suffix $file)),-l$(file),$(file)))

+2 −2
Original line number Diff line number Diff line
@@ -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 eng user userdebug tests,$(TARGET_BUILD_VARIANT))
build_variant := $(filter-out user userdebug eng tests,$(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: eng user userdebug tests)
$(error must be empty or one of: user userdebug eng tests)
endif

# ---------------------------------------------------------------
+38 −29
Original line number Diff line number Diff line
@@ -224,13 +224,11 @@ include $(BUILD_SYSTEM)/definitions.mk
# Bring in dex_preopt.mk
include $(BUILD_SYSTEM)/dex_preopt.mk

ifneq ($(filter eng user userdebug,$(MAKECMDGOALS)),)
ifneq ($(filter user userdebug eng,$(MAKECMDGOALS)),)
$(info ***************************************************************)
$(info ***************************************************************)
$(info Don't pass '$(filter eng user userdebug tests,$(MAKECMDGOALS))' on \
$(info Do not pass '$(filter user userdebug eng tests,$(MAKECMDGOALS))' on \
		the make command line.)
# XXX The single quote on this line fixes gvim's syntax highlighting.
# Without which, the rest of this file is impossible to read.
$(info Set TARGET_BUILD_VARIANT in buildspec.mk, or use lunch or)
$(info choosecombo.)
$(info ***************************************************************)
@@ -279,13 +277,13 @@ endif # HAVE_SELINUX

## user/userdebug ##

user_variant := $(filter userdebug user,$(TARGET_BUILD_VARIANT))
user_variant := $(filter user userdebug,$(TARGET_BUILD_VARIANT))
enable_target_debugging := true
tags_to_install :=
ifneq (,$(user_variant))
  # Target is secure in user builds.
  ADDITIONAL_DEFAULT_PROPERTIES += ro.secure=1

  tags_to_install := user
  ifeq ($(user_variant),userdebug)
    # Pick up some extra useful tools
    tags_to_install += debug
@@ -333,7 +331,7 @@ endif # !enable_target_debugging
## eng ##

ifeq ($(TARGET_BUILD_VARIANT),eng)
tags_to_install := user debug eng
tags_to_install := debug eng
ifneq ($(filter ro.setupwizard.mode=ENABLED, $(call collapse-pairs, $(ADDITIONAL_BUILD_PROPERTIES))),)
  # Don't require the setup wizard on eng builds
  ADDITIONAL_BUILD_PROPERTIES := $(filter-out ro.setupwizard.mode=%,\
@@ -345,7 +343,7 @@ endif
## tests ##

ifeq ($(TARGET_BUILD_VARIANT),tests)
tags_to_install := user debug eng tests
tags_to_install := debug eng tests
endif

## sdk ##
@@ -362,7 +360,7 @@ endif

# TODO: this should be eng I think.  Since the sdk is built from the eng
# variant.
tags_to_install := user debug eng
tags_to_install := debug eng
ADDITIONAL_BUILD_PROPERTIES += xmpp.auto-presence=true
ADDITIONAL_BUILD_PROPERTIES += ro.config.nocheckin=yes
else # !sdk
@@ -591,42 +589,46 @@ add-required-deps :=

# -------------------------------------------------------------------
# Figure out our module sets.

#
# Of the modules defined by the component makefiles,
# determine what we actually want to build.
Default_MODULES := $(sort $(ALL_DEFAULT_INSTALLED_MODULES) \
                          $(CUSTOM_MODULES))
# TODO: Remove the 3 places in the tree that use
# ALL_DEFAULT_INSTALLED_MODULES and get rid of it from this list.

ifdef FULL_BUILD
  # The base list of modules to build for this product is specified
  # by the appropriate product definition file, which was included
  # by product_config.make.
  user_PACKAGES := $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES)
  $(call expand-required-modules,user_PACKAGES,$(user_PACKAGES))
  user_PACKAGES := $(call module-installed-files, $(user_PACKAGES))
  product_MODULES := $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES)
  $(call expand-required-modules,product_MODULES,$(product_MODULES))
  product_FILES := $(call module-installed-files, $(product_MODULES))
  ifeq (0,1)
    $(info product_FILES for $(TARGET_DEVICE) ($(INTERNAL_PRODUCT)):)
    $(foreach p,$(product_FILES),$(info :   $(p)))
    $(error done)
  endif
else
  # We're not doing a full build, and are probably only including
  # a subset of the module makefiles.  Don't try to build any modules
  # requested by the product, because we probably won't have rules
  # to build them.
  user_PACKAGES :=
  product_FILES :=
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 shell_$(TARGET_SHELL)))
user_MODULES := $(user_MODULES) $(user_PACKAGES)

eng_MODULES := $(sort $(call get-tagged-modules,eng))
# 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))
eng_MODULES := $(sort $(call get-tagged-modules,eng))
tests_MODULES := $(sort $(call get-tagged-modules,tests))

ifeq ($(strip $(tags_to_install)),)
$(error ASSERTION FAILED: tags_to_install should not be empty)
endif
modules_to_install := $(sort $(Default_MODULES) \
          $(foreach tag,$(tags_to_install),$($(tag)_MODULES)))
# TODO: Remove the 3 places in the tree that use ALL_DEFAULT_INSTALLED_MODULES
# and get rid of it from this list.
# TODO: The shell is chosen by magic.  Do we still need this?
modules_to_install := $(sort \
    $(ALL_DEFAULT_INSTALLED_MODULES) \
    $(product_FILES) \
    $(foreach tag,$(tags_to_install),$($(tag)_MODULES)) \
    $(call get-tagged-modules, shell_$(TARGET_SHELL)) \
    $(CUSTOM_MODULES) \
  )

# Some packages may override others using LOCAL_OVERRIDES_PACKAGES.
# Filter out (do not install) any overridden packages.
@@ -657,9 +659,11 @@ ifdef is_sdk_build
  # Ensure every module listed in PRODUCT_PACKAGES gets something installed
  $(foreach m, $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGES), \
      $(if $(strip $(ALL_MODULES.$(m).INSTALLED)),,\
          $(error Module '$(m)' in PRODUCT_PACKAGES has nothing to install!)))
          $(error $(ALL_MODULES.$(m).MAKEFILE): Module '$(m)' in PRODUCT_PACKAGES 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
@@ -672,6 +676,7 @@ ALL_DEFAULT_INSTALLED_MODULES :=

endif # dont_bother


# These are additional goals that we build, in order to make sure that there
# is as little code as possible in the tree that doesn't build.
modules_to_check := $(foreach m,$(ALL_MODULES),$(ALL_MODULES.$(m).CHECKED))
@@ -871,3 +876,7 @@ modules:
.PHONY: showcommands
showcommands:
	@echo >/dev/null

.PHONY: nothing
nothing:
	@echo Successfully read the makefiles.
+6 −0
Original line number Diff line number Diff line
@@ -199,6 +199,12 @@ $(dump-products)
$(error done)
endif

ifeq (a,b)
$(info PRODUCTS -----------)
$(foreach product, $(PRODUCTS), $(info $(PRODUCTS.$(product).PRODUCT_NAME)))# $(product)))
$(error stop)
endif

# Convert a short name like "sooner" into the path to the product
# file defining that product.
#
Loading