OSDN Git Service

Don't give the user tag to host modules automatically.
authorJoe Onorato <joeo@google.com>
Sat, 19 May 2012 03:43:14 +0000 (20:43 -0700)
committerJoe Onorato <joeo@google.com>
Fri, 17 Aug 2012 05:36:40 +0000 (22:36 -0700)
Change-Id: I12d0a84786e5bf2224efd8684526b6097e6105d7

core/base_rules.mk
core/definitions.mk
core/main.mk

index 51fb398..1d1078f 100644 (file)
@@ -58,15 +58,19 @@ 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))))
+  ifeq (true,$(LOCAL_UNINSTALLABLE_MODULE))
+    LOCAL_MODULE_TAGS := optional
+  else
+    ifneq ($(LOCAL_IS_HOST_MODULE),true)
+      # Installable target modules without tags fall back to user (which is changed to user eng
+      # below)
+      LOCAL_MODULE_TAGS := user
+    endif
+  endif
+  #$(warning default tags: $(lastword $(filter-out config/% out/%,$(MAKEFILE_LIST))))
 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.
@@ -92,7 +96,7 @@ ifneq ($(filter $(LOCAL_MODULE_TAGS),user),)
     $(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 *    makefile(s) where it is necessary, if)
     $(warning *    appropriate.)
     $(warning * )
     $(warning * If the component should be in EVERY build of ALL)
@@ -544,6 +548,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 user debug eng tests, $(LOCAL_MODULE_TAGS)),)
+    $(error $(LOCAL_MODULE_MAKEFILE): Module "$(LOCAL_MODULE)" has useless module tags: $(filter user debug eng tests, $(LOCAL_MODULE_TAGS)). It will be installed anyway.)
+  endif
+endif
+
 endif # !LOCAL_UNINSTALLABLE_MODULE
 
 
index c1757f3..6e87cc1 100644 (file)
@@ -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:=
index f7a5193..7e7244e 100644 (file)
@@ -660,6 +660,8 @@ ifdef is_sdk_build
           $(error 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