2009-03-04 04:28:42 +01:00
|
|
|
#
|
|
|
|
# Copyright (C) 2008 The Android Open Source Project
|
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
#
|
|
|
|
|
2016-07-26 01:03:53 +02:00
|
|
|
# Catch users that directly include base_rules.mk
|
|
|
|
$(call record-module-type,base_rules)
|
|
|
|
|
2009-03-04 04:28:42 +01:00
|
|
|
# Users can define base-rules-hook in their buildspec.mk to perform
|
|
|
|
# arbitrary operations as each module is included.
|
|
|
|
ifdef base-rules-hook
|
|
|
|
$(if $(base-rules-hook),)
|
|
|
|
endif
|
|
|
|
|
|
|
|
###########################################################
|
|
|
|
## Common instructions for a generic module.
|
|
|
|
###########################################################
|
|
|
|
|
|
|
|
LOCAL_MODULE := $(strip $(LOCAL_MODULE))
|
|
|
|
ifeq ($(LOCAL_MODULE),)
|
|
|
|
$(error $(LOCAL_PATH): LOCAL_MODULE is not defined)
|
|
|
|
endif
|
|
|
|
|
|
|
|
LOCAL_IS_HOST_MODULE := $(strip $(LOCAL_IS_HOST_MODULE))
|
2016-08-02 02:41:49 +02:00
|
|
|
LOCAL_IS_AUX_MODULE := $(strip $(LOCAL_IS_AUX_MODULE))
|
2009-03-04 04:28:42 +01:00
|
|
|
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
|
2015-08-14 21:59:50 +02:00
|
|
|
ifeq ($(LOCAL_HOST_PREFIX),)
|
|
|
|
my_prefix := HOST_
|
|
|
|
else
|
|
|
|
my_prefix := $(LOCAL_HOST_PREFIX)
|
|
|
|
endif
|
2012-11-02 01:22:33 +01:00
|
|
|
my_host := host-
|
2016-08-02 02:41:49 +02:00
|
|
|
my_kind := HOST
|
2009-03-04 04:28:42 +01:00
|
|
|
else
|
2016-08-02 02:41:49 +02:00
|
|
|
ifdef LOCAL_IS_AUX_MODULE
|
|
|
|
ifneq ($(LOCAL_IS_AUX_MODULE),true)
|
|
|
|
$(error $(LOCAL_PATH): LOCAL_IS_AUX_MODULE must be "true" or empty, not "$(LOCAL_IS_AUX_MODULE)")
|
|
|
|
endif
|
|
|
|
my_prefix := AUX_
|
|
|
|
my_kind := AUX
|
|
|
|
else
|
|
|
|
my_prefix := TARGET_
|
|
|
|
my_kind :=
|
|
|
|
endif
|
2012-11-02 01:22:33 +01:00
|
|
|
my_host :=
|
2009-03-04 04:28:42 +01:00
|
|
|
endif
|
|
|
|
|
2015-08-14 21:59:50 +02:00
|
|
|
ifeq ($(my_prefix),HOST_CROSS_)
|
|
|
|
my_host_cross := true
|
|
|
|
else
|
|
|
|
my_host_cross :=
|
|
|
|
endif
|
|
|
|
|
2016-11-18 23:05:39 +01:00
|
|
|
include $(BUILD_SYSTEM)/local_vndk.mk
|
|
|
|
|
2014-01-28 00:19:09 +01:00
|
|
|
my_module_tags := $(LOCAL_MODULE_TAGS)
|
2015-08-14 21:59:50 +02:00
|
|
|
ifeq ($(my_host_cross),true)
|
|
|
|
my_module_tags :=
|
|
|
|
endif
|
2016-03-17 03:53:19 +01:00
|
|
|
ifeq ($(TARGET_TRANSLATE_2ND_ARCH),true)
|
|
|
|
ifdef LOCAL_2ND_ARCH_VAR_PREFIX
|
|
|
|
# Don't pull in modules by tags if this is for translation TARGET_2ND_ARCH.
|
|
|
|
my_module_tags :=
|
|
|
|
endif
|
|
|
|
endif
|
2014-01-28 00:19:09 +01:00
|
|
|
|
2015-09-29 01:26:00 +02:00
|
|
|
# Ninja has an implicit dependency on the command being run, and kati will
|
|
|
|
# regenerate the ninja manifest if any read makefile changes, so there is no
|
|
|
|
# need to have dependencies on makefiles.
|
|
|
|
# This won't catch all the cases where LOCAL_ADDITIONAL_DEPENDENCIES contains
|
|
|
|
# a .mk file, because a few users of LOCAL_ADDITIONAL_DEPENDENCIES don't include
|
|
|
|
# base_rules.mk, but it will fix the most common ones.
|
|
|
|
LOCAL_ADDITIONAL_DEPENDENCIES := $(filter-out %.mk,$(LOCAL_ADDITIONAL_DEPENDENCIES))
|
|
|
|
|
2009-03-04 04:28:42 +01:00
|
|
|
###########################################################
|
|
|
|
## Validate and define fallbacks for input LOCAL_* variables.
|
|
|
|
###########################################################
|
|
|
|
|
|
|
|
## Dump a .csv file of all modules and their tags
|
|
|
|
#ifneq ($(tag-list-first-time),false)
|
|
|
|
#$(shell rm -f tag-list.csv)
|
|
|
|
#tag-list-first-time := false
|
|
|
|
#endif
|
2014-01-28 00:19:09 +01:00
|
|
|
#$(shell echo $(lastword $(filter-out config/% out/%,$(MAKEFILE_LIST))),$(LOCAL_MODULE),$(strip $(LOCAL_MODULE_CLASS)),$(subst $(space),$(comma),$(sort $(my_module_tags))) >> tag-list.csv)
|
2009-03-04 04:28:42 +01:00
|
|
|
|
2012-05-15 23:31:26 +02:00
|
|
|
LOCAL_UNINSTALLABLE_MODULE := $(strip $(LOCAL_UNINSTALLABLE_MODULE))
|
2014-01-28 00:19:09 +01:00
|
|
|
my_module_tags := $(sort $(my_module_tags))
|
|
|
|
ifeq (,$(my_module_tags))
|
|
|
|
my_module_tags := optional
|
2009-03-04 04:28:42 +01:00
|
|
|
endif
|
|
|
|
|
2012-05-22 23:08:50 +02:00
|
|
|
# User tags are not allowed anymore. Fail early because it will not be installed
|
|
|
|
# like it used to be.
|
2014-01-28 00:19:09 +01:00
|
|
|
ifneq ($(filter $(my_module_tags),user),)
|
2012-05-22 23:08:50 +02:00
|
|
|
$(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
|
2012-05-19 05:43:14 +02:00
|
|
|
|
2010-01-07 20:06:50 +01:00
|
|
|
# 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.
|
2014-01-28 00:19:09 +01:00
|
|
|
ifneq ($(filter-out debug eng tests optional samples,$(my_module_tags)),)
|
2017-02-25 00:07:03 +01:00
|
|
|
$(call pretty-warning,unusual tags $(my_module_tags))
|
2010-01-07 20:06:50 +01:00
|
|
|
endif
|
|
|
|
|
2009-03-04 04:28:42 +01:00
|
|
|
# Add implicit tags.
|
|
|
|
#
|
|
|
|
# If the local directory or one of its parents contains a MODULE_LICENSE_GPL
|
2013-12-10 22:52:00 +01:00
|
|
|
# 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
|
2009-03-04 04:28:42 +01:00
|
|
|
#
|
2015-05-07 21:08:53 +02:00
|
|
|
license_files := $(call find-parent-file,$(LOCAL_PATH),MODULE_LICENSE*)
|
2013-12-10 22:52:00 +01:00
|
|
|
gpl_license_file := $(call find-parent-file,$(LOCAL_PATH),MODULE_LICENSE*_GPL* MODULE_LICENSE*_MPL* MODULE_LICENSE*_LGPL*)
|
2011-12-12 21:57:38 +01:00
|
|
|
ifneq ($(gpl_license_file),)
|
2014-01-28 00:19:09 +01:00
|
|
|
my_module_tags += gnu
|
2011-12-12 21:57:38 +01:00
|
|
|
ALL_GPL_MODULE_LICENSE_FILES := $(sort $(ALL_GPL_MODULE_LICENSE_FILES) $(gpl_license_file))
|
2009-03-04 04:28:42 +01:00
|
|
|
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
|
|
|
|
|
2014-04-17 19:03:35 +02:00
|
|
|
my_32_64_bit_suffix := $(if $($(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)IS_64_BIT),64,32)
|
2014-03-21 20:25:44 +01:00
|
|
|
|
2012-05-15 23:31:26 +02:00
|
|
|
ifneq (true,$(LOCAL_UNINSTALLABLE_MODULE))
|
2016-03-17 03:53:19 +01:00
|
|
|
ifeq ($(TARGET_TRANSLATE_2ND_ARCH),true)
|
|
|
|
# When in TARGET_TRANSLATE_2ND_ARCH both TARGET_ARCH and TARGET_2ND_ARCH are 32-bit,
|
|
|
|
# to avoid path conflict we force using LOCAL_MODULE_PATH_64 for the first arch.
|
|
|
|
ifdef LOCAL_2ND_ARCH_VAR_PREFIX
|
|
|
|
my_multilib_module_path := $(LOCAL_MODULE_PATH_32)
|
|
|
|
else # ! LOCAL_2ND_ARCH_VAR_PREFIX
|
|
|
|
my_multilib_module_path := $(LOCAL_MODULE_PATH_64)
|
|
|
|
endif # ! LOCAL_2ND_ARCH_VAR_PREFIX
|
|
|
|
else # ! TARGET_TRANSLATE_2ND_ARCH
|
2014-03-21 20:25:44 +01:00
|
|
|
my_multilib_module_path := $(strip $(LOCAL_MODULE_PATH_$(my_32_64_bit_suffix)))
|
2016-03-17 03:53:19 +01:00
|
|
|
endif # ! TARGET_TRANSLATE_2ND_ARCH
|
2014-03-21 20:25:44 +01:00
|
|
|
ifdef my_multilib_module_path
|
|
|
|
my_module_path := $(my_multilib_module_path)
|
|
|
|
else
|
2014-01-24 00:09:04 +01:00
|
|
|
my_module_path := $(strip $(LOCAL_MODULE_PATH))
|
2014-03-21 20:25:44 +01:00
|
|
|
endif
|
Fix PDK dupbuild issues
The PDK uses pattern rules in order to install files from the PDK. When
those files already have build rules, the explicit rules override the
pattern rules, and everything works. But because Make (and Kati) doesn't
attempt to clean the file paths, if one of the rules has a redundant /,
we'll export two ninja rules, and ninja will error out with a dupbuild
error.
The PDK pattern rules are clean, but the explicit notice file creation
was not, it was always adding a double // in between NOTICE_FILES/src
and the module path.
Some modules were also setting a LOCAL_MODULE_PATH with a trailing /,
which is redundant, and also hits the above problem. Instead of fixing
all of the modules, just strip a trailing / from my_module_path.
Bug: 33451638
Test: Build with a PDK
Change-Id: Iff3e98fd191ea90626b9b89f179537e8a75f5ef2
2016-12-10 06:15:41 +01:00
|
|
|
my_module_path := $(patsubst %/,%,$(my_module_path))
|
2014-01-25 04:23:40 +01:00
|
|
|
my_module_relative_path := $(strip $(LOCAL_MODULE_RELATIVE_PATH))
|
2017-02-13 22:41:43 +01:00
|
|
|
ifdef LOCAL_IS_HOST_MODULE
|
|
|
|
partition_tag :=
|
|
|
|
else
|
|
|
|
ifeq (true,$(LOCAL_PROPRIETARY_MODULE))
|
|
|
|
partition_tag := _VENDOR
|
|
|
|
else ifeq (true,$(LOCAL_OEM_MODULE))
|
|
|
|
partition_tag := _OEM
|
|
|
|
else ifeq (true,$(LOCAL_ODM_MODULE))
|
|
|
|
partition_tag := _ODM
|
|
|
|
else ifeq (NATIVE_TESTS,$(LOCAL_MODULE_CLASS))
|
|
|
|
partition_tag := _DATA
|
|
|
|
else
|
|
|
|
# The definition of should-install-to-system will be different depending
|
|
|
|
# on which goal (e.g., sdk or just droid) is being built.
|
|
|
|
partition_tag := $(if $(call should-install-to-system,$(my_module_tags)),,_DATA)
|
|
|
|
endif
|
|
|
|
endif
|
2014-01-24 00:09:04 +01:00
|
|
|
ifeq ($(my_module_path),)
|
2014-01-16 01:02:16 +01:00
|
|
|
install_path_var := $(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)OUT$(partition_tag)_$(LOCAL_MODULE_CLASS)
|
2013-05-09 00:49:08 +02:00
|
|
|
ifeq (true,$(LOCAL_PRIVILEGED_MODULE))
|
|
|
|
install_path_var := $(install_path_var)_PRIVILEGED
|
|
|
|
endif
|
|
|
|
|
2014-01-23 02:34:28 +01:00
|
|
|
my_module_path := $($(install_path_var))
|
2014-01-24 00:09:04 +01:00
|
|
|
ifeq ($(strip $(my_module_path)),)
|
|
|
|
$(error $(LOCAL_PATH): unhandled install path "$(install_path_var) for $(LOCAL_MODULE)")
|
2009-03-04 04:28:42 +01:00
|
|
|
endif
|
|
|
|
endif
|
2014-01-25 04:23:40 +01:00
|
|
|
ifneq ($(my_module_relative_path),)
|
|
|
|
my_module_path := $(my_module_path)/$(my_module_relative_path)
|
|
|
|
endif
|
2012-05-15 23:31:26 +02:00
|
|
|
endif # not LOCAL_UNINSTALLABLE_MODULE
|
2009-03-04 04:28:42 +01:00
|
|
|
|
|
|
|
ifneq ($(strip $(LOCAL_BUILT_MODULE)$(LOCAL_INSTALLED_MODULE)),)
|
|
|
|
$(error $(LOCAL_PATH): LOCAL_BUILT_MODULE and LOCAL_INSTALLED_MODULE must not be defined by component makefiles)
|
|
|
|
endif
|
|
|
|
|
2014-01-16 01:02:16 +01:00
|
|
|
my_register_name := $(LOCAL_MODULE)
|
2016-02-06 01:20:19 +01:00
|
|
|
ifeq ($(my_host_cross),true)
|
|
|
|
my_register_name := host_cross_$(LOCAL_MODULE)
|
|
|
|
endif
|
2014-01-16 01:02:16 +01:00
|
|
|
ifdef LOCAL_2ND_ARCH_VAR_PREFIX
|
2014-02-04 20:16:16 +01:00
|
|
|
ifndef LOCAL_NO_2ND_ARCH_MODULE_SUFFIX
|
2016-02-06 01:20:19 +01:00
|
|
|
my_register_name := $(my_register_name)$($(my_prefix)2ND_ARCH_MODULE_SUFFIX)
|
2014-01-16 01:02:16 +01:00
|
|
|
endif
|
2014-02-04 20:16:16 +01:00
|
|
|
endif
|
2016-08-02 02:41:49 +02:00
|
|
|
|
2016-09-07 21:48:30 +02:00
|
|
|
ifeq ($(my_host_cross),true)
|
|
|
|
my_all_targets := host_cross_$(my_register_name)_all_targets
|
|
|
|
else ifneq ($(LOCAL_IS_HOST_MODULE),)
|
|
|
|
my_all_targets := host_$(my_register_name)_all_targets
|
|
|
|
else
|
|
|
|
my_all_targets := device_$(my_register_name)_all_targets
|
|
|
|
endif
|
|
|
|
|
2016-08-02 02:41:49 +02:00
|
|
|
# variant is enough to make nano class unique; it serves as a key to lookup (OS,ARCH) tuple
|
|
|
|
aux_class := $($(my_prefix)OS_VARIANT)
|
2009-03-04 04:28:42 +01:00
|
|
|
# Make sure that this IS_HOST/CLASS/MODULE combination is unique.
|
|
|
|
module_id := MODULE.$(if \
|
2016-08-02 02:41:49 +02:00
|
|
|
$(LOCAL_IS_HOST_MODULE),$($(my_prefix)OS),$(if \
|
|
|
|
$(LOCAL_IS_AUX_MODULE),$(aux_class),TARGET)).$(LOCAL_MODULE_CLASS).$(my_register_name)
|
2009-03-04 04:28:42 +01:00
|
|
|
ifdef $(module_id)
|
|
|
|
$(error $(LOCAL_PATH): $(module_id) already defined by $($(module_id)))
|
|
|
|
endif
|
|
|
|
$(module_id) := $(LOCAL_PATH)
|
|
|
|
|
2015-08-14 21:59:50 +02:00
|
|
|
intermediates := $(call local-intermediates-dir,,$(LOCAL_2ND_ARCH_VAR_PREFIX),$(my_host_cross))
|
2009-03-04 04:28:42 +01:00
|
|
|
intermediates.COMMON := $(call local-intermediates-dir,COMMON)
|
2014-01-25 08:17:21 +01:00
|
|
|
generated_sources_dir := $(call local-generated-sources-dir)
|
2009-03-04 04:28:42 +01:00
|
|
|
|
|
|
|
###########################################################
|
|
|
|
# Pick a name for the intermediate and final targets
|
|
|
|
###########################################################
|
2014-03-21 20:27:37 +01:00
|
|
|
include $(BUILD_SYSTEM)/configure_module_stem.mk
|
2009-03-04 04:28:42 +01:00
|
|
|
|
|
|
|
# OVERRIDE_BUILT_MODULE_PATH is only allowed to be used by the
|
|
|
|
# internal SHARED_LIBRARIES build files.
|
|
|
|
OVERRIDE_BUILT_MODULE_PATH := $(strip $(OVERRIDE_BUILT_MODULE_PATH))
|
|
|
|
ifdef OVERRIDE_BUILT_MODULE_PATH
|
|
|
|
ifneq ($(LOCAL_MODULE_CLASS),SHARED_LIBRARIES)
|
|
|
|
$(error $(LOCAL_PATH): Illegal use of OVERRIDE_BUILT_MODULE_PATH)
|
|
|
|
endif
|
|
|
|
built_module_path := $(OVERRIDE_BUILT_MODULE_PATH)
|
|
|
|
else
|
|
|
|
built_module_path := $(intermediates)
|
|
|
|
endif
|
2014-05-20 23:43:51 +02:00
|
|
|
LOCAL_BUILT_MODULE := $(built_module_path)/$(my_built_module_stem)
|
2009-03-04 04:28:42 +01:00
|
|
|
|
2011-09-07 19:21:42 +02:00
|
|
|
ifneq (true,$(LOCAL_UNINSTALLABLE_MODULE))
|
2014-07-18 06:24:42 +02:00
|
|
|
# Apk and its attachments reside in its own subdir.
|
|
|
|
ifeq ($(LOCAL_MODULE_CLASS),APPS)
|
|
|
|
# framework-res.apk doesn't like the additional layer.
|
2016-10-03 10:56:16 +02:00
|
|
|
ifeq ($(LOCAL_NO_STANDARD_LIBRARIES),true)
|
|
|
|
# Neither do Runtime Resource Overlay apks, which contain just the overlaid resources.
|
|
|
|
else ifeq ($(LOCAL_IS_RUNTIME_RESOURCE_OVERLAY),true)
|
|
|
|
else
|
2014-07-18 06:24:42 +02:00
|
|
|
my_module_path := $(my_module_path)/$(LOCAL_MODULE)
|
|
|
|
endif
|
|
|
|
endif
|
2014-05-20 23:43:51 +02:00
|
|
|
LOCAL_INSTALLED_MODULE := $(my_module_path)/$(my_installed_module_stem)
|
2009-03-04 04:28:42 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
# Assemble the list of targets to create PRIVATE_ variables for.
|
|
|
|
LOCAL_INTERMEDIATE_TARGETS += $(LOCAL_BUILT_MODULE)
|
|
|
|
|
2015-10-09 07:36:04 +02:00
|
|
|
###########################################################
|
|
|
|
## Create .toc files from shared objects to reduce unnecessary rebuild
|
|
|
|
# .toc files have the list of external dynamic symbols without their addresses.
|
2015-11-09 08:47:42 +01:00
|
|
|
# As .KATI_RESTAT is specified to .toc files and commit-change-for-toc is used,
|
|
|
|
# dependent binaries of a .toc file will be rebuilt only when the content of
|
2015-10-09 07:36:04 +02:00
|
|
|
# the .toc file is changed.
|
|
|
|
###########################################################
|
|
|
|
ifeq ($(LOCAL_MODULE_CLASS),SHARED_LIBRARIES)
|
|
|
|
LOCAL_INTERMEDIATE_TARGETS += $(LOCAL_BUILT_MODULE).toc
|
|
|
|
$(LOCAL_BUILT_MODULE).toc: $(LOCAL_BUILT_MODULE)
|
|
|
|
$(call $(PRIVATE_2ND_ARCH_VAR_PREFIX)$(PRIVATE_PREFIX)transform-shared-lib-to-toc,$<,$@.tmp)
|
2015-11-09 08:47:42 +01:00
|
|
|
$(call commit-change-for-toc,$@)
|
2015-10-09 07:36:04 +02:00
|
|
|
|
|
|
|
# Kati adds restat=1 to ninja. GNU make does nothing for this.
|
|
|
|
.KATI_RESTAT: $(LOCAL_BUILT_MODULE).toc
|
2016-02-04 22:28:04 +01:00
|
|
|
# Build .toc file when using mm, mma, or make $(my_register_name)
|
2016-09-07 21:48:30 +02:00
|
|
|
$(my_all_targets): $(LOCAL_BUILT_MODULE).toc
|
2015-10-09 07:36:04 +02:00
|
|
|
endif
|
|
|
|
|
2015-09-04 09:23:49 +02:00
|
|
|
###########################################################
|
|
|
|
## logtags: Add .logtags files to global list
|
|
|
|
###########################################################
|
|
|
|
|
2016-06-02 00:27:11 +02:00
|
|
|
logtags_sources := $(filter %.logtags,$(LOCAL_SRC_FILES)) $(LOCAL_LOGTAGS_FILES)
|
2015-09-04 09:23:49 +02:00
|
|
|
|
|
|
|
ifneq ($(strip $(logtags_sources)),)
|
|
|
|
event_log_tags := $(addprefix $(LOCAL_PATH)/,$(logtags_sources))
|
|
|
|
else
|
|
|
|
event_log_tags :=
|
|
|
|
endif
|
2009-03-04 04:28:42 +01:00
|
|
|
|
|
|
|
###########################################################
|
|
|
|
## make clean- targets
|
|
|
|
###########################################################
|
2014-01-16 01:02:16 +01:00
|
|
|
cleantarget := clean-$(my_register_name)
|
|
|
|
$(cleantarget) : PRIVATE_MODULE := $(my_register_name)
|
2013-03-23 02:52:57 +01:00
|
|
|
$(cleantarget) : PRIVATE_CLEAN_FILES := \
|
2012-11-07 23:07:34 +01:00
|
|
|
$(LOCAL_BUILT_MODULE) \
|
|
|
|
$(LOCAL_INSTALLED_MODULE) \
|
|
|
|
$(intermediates)
|
2009-03-04 04:28:42 +01:00
|
|
|
$(cleantarget)::
|
|
|
|
@echo "Clean: $(PRIVATE_MODULE)"
|
|
|
|
$(hide) rm -rf $(PRIVATE_CLEAN_FILES)
|
|
|
|
|
|
|
|
###########################################################
|
|
|
|
## Common definitions for module.
|
|
|
|
###########################################################
|
|
|
|
$(LOCAL_INTERMEDIATE_TARGETS) : PRIVATE_PATH:=$(LOCAL_PATH)
|
|
|
|
$(LOCAL_INTERMEDIATE_TARGETS) : PRIVATE_IS_HOST_MODULE := $(LOCAL_IS_HOST_MODULE)
|
2016-08-02 02:41:49 +02:00
|
|
|
$(LOCAL_INTERMEDIATE_TARGETS) : PRIVATE_IS_AUX_MODULE := $(LOCAL_IS_AUX_MODULE)
|
2009-03-04 04:28:42 +01:00
|
|
|
$(LOCAL_INTERMEDIATE_TARGETS) : PRIVATE_HOST:= $(my_host)
|
2015-08-14 21:59:50 +02:00
|
|
|
$(LOCAL_INTERMEDIATE_TARGETS) : PRIVATE_PREFIX := $(my_prefix)
|
|
|
|
|
2009-05-28 04:41:07 +02:00
|
|
|
$(LOCAL_INTERMEDIATE_TARGETS) : PRIVATE_INTERMEDIATES_DIR:= $(intermediates)
|
2014-04-17 19:03:35 +02:00
|
|
|
$(LOCAL_INTERMEDIATE_TARGETS) : PRIVATE_2ND_ARCH_VAR_PREFIX := $(LOCAL_2ND_ARCH_VAR_PREFIX)
|
|
|
|
|
2009-03-04 04:28:42 +01:00
|
|
|
# Tell the module and all of its sub-modules who it is.
|
2014-01-16 01:02:16 +01:00
|
|
|
$(LOCAL_INTERMEDIATE_TARGETS) : PRIVATE_MODULE:= $(my_register_name)
|
2009-03-04 04:28:42 +01:00
|
|
|
|
|
|
|
# Provide a short-hand for building this module.
|
|
|
|
# We name both BUILT and INSTALLED in case
|
|
|
|
# LOCAL_UNINSTALLABLE_MODULE is set.
|
2016-09-07 21:48:30 +02:00
|
|
|
.PHONY: $(my_all_targets)
|
|
|
|
$(my_all_targets): $(LOCAL_BUILT_MODULE) $(LOCAL_INSTALLED_MODULE)
|
|
|
|
|
2014-01-16 01:02:16 +01:00
|
|
|
.PHONY: $(my_register_name)
|
2016-09-07 21:48:30 +02:00
|
|
|
$(my_register_name): $(my_all_targets)
|
2009-03-04 04:28:42 +01:00
|
|
|
|
2016-03-23 19:02:03 +01:00
|
|
|
ifneq ($(my_register_name),$(LOCAL_MODULE))
|
|
|
|
# $(LOCAL_MODULE) covers all the multilib targets.
|
|
|
|
.PHONY: $(LOCAL_MODULE)
|
2016-09-07 21:48:30 +02:00
|
|
|
$(LOCAL_MODULE) : $(my_all_targets)
|
2016-03-23 19:02:03 +01:00
|
|
|
endif
|
|
|
|
|
2015-09-24 01:08:55 +02:00
|
|
|
# Set up phony targets that covers all modules under the given paths.
|
|
|
|
# This allows us to build everything in given paths by running mmma/mma.
|
|
|
|
my_path_components := $(subst /,$(space),$(LOCAL_PATH))
|
|
|
|
my_path_prefix := MODULES-IN
|
|
|
|
$(foreach c, $(my_path_components),\
|
2015-09-25 01:19:19 +02:00
|
|
|
$(eval my_path_prefix := $(my_path_prefix)-$(c))\
|
2015-09-24 01:08:55 +02:00
|
|
|
$(eval .PHONY : $(my_path_prefix))\
|
2016-09-07 21:48:30 +02:00
|
|
|
$(eval $(my_path_prefix) : $(my_all_targets)))
|
2015-09-24 01:08:55 +02:00
|
|
|
|
2009-03-04 04:28:42 +01:00
|
|
|
###########################################################
|
|
|
|
## Module installation rule
|
|
|
|
###########################################################
|
|
|
|
|
2016-07-15 01:02:57 +02:00
|
|
|
my_init_rc_installed :=
|
|
|
|
my_init_rc_pairs :=
|
|
|
|
my_installed_symlinks :=
|
2015-04-19 18:55:39 +02:00
|
|
|
ifneq (true,$(LOCAL_UNINSTALLABLE_MODULE))
|
2013-02-06 20:44:41 +01:00
|
|
|
$(LOCAL_INSTALLED_MODULE): PRIVATE_POST_INSTALL_CMD := $(LOCAL_POST_INSTALL_CMD)
|
2016-03-01 02:52:39 +01:00
|
|
|
$(LOCAL_INSTALLED_MODULE): $(LOCAL_BUILT_MODULE)
|
2009-03-04 04:28:42 +01:00
|
|
|
@echo "Install: $@"
|
2011-01-19 02:21:20 +01:00
|
|
|
$(copy-file-to-new-target)
|
2013-02-06 20:44:41 +01:00
|
|
|
$(PRIVATE_POST_INSTALL_CMD)
|
2009-03-04 04:28:42 +01:00
|
|
|
|
2016-07-28 07:52:42 +02:00
|
|
|
ifndef LOCAL_IS_HOST_MODULE
|
2015-08-20 21:02:10 +02:00
|
|
|
# Rule to install the module's companion init.rc.
|
2016-07-28 07:52:42 +02:00
|
|
|
my_init_rc := $(LOCAL_INIT_RC_$(my_32_64_bit_suffix)) $(LOCAL_INIT_RC)
|
|
|
|
ifneq ($(strip $(my_init_rc)),)
|
|
|
|
my_init_rc_pairs := $(foreach rc,$(my_init_rc),$(LOCAL_PATH)/$(rc):$(TARGET_OUT$(partition_tag)_ETC)/init/$(notdir $(rc)))
|
|
|
|
my_init_rc_installed := $(foreach rc,$(my_init_rc_pairs),$(call word-colon,2,$(rc)))
|
|
|
|
|
|
|
|
# Make sure we only set up the copy rules once, even if another arch variant
|
|
|
|
# shares a common LOCAL_INIT_RC.
|
|
|
|
my_init_rc_new_pairs := $(filter-out $(ALL_INIT_RC_INSTALLED_PAIRS),$(my_init_rc_pairs))
|
|
|
|
my_init_rc_new_installed := $(call copy-many-files,$(my_init_rc_new_pairs))
|
|
|
|
ALL_INIT_RC_INSTALLED_PAIRS += $(my_init_rc_new_pairs)
|
2009-03-04 04:28:42 +01:00
|
|
|
|
2016-09-07 21:48:30 +02:00
|
|
|
$(my_all_targets) : $(my_init_rc_installed)
|
2016-07-28 07:52:42 +02:00
|
|
|
endif # my_init_rc
|
|
|
|
endif # !LOCAL_IS_HOST_MODULE
|
2016-07-15 01:02:57 +02:00
|
|
|
|
|
|
|
# Rule to install the module's companion symlinks
|
|
|
|
my_installed_symlinks := $(addprefix $(my_module_path)/,$(LOCAL_MODULE_SYMLINKS) $(LOCAL_MODULE_SYMLINKS_$(my_32_64_bit_suffix)))
|
|
|
|
$(foreach symlink,$(my_installed_symlinks),\
|
|
|
|
$(call symlink-file,$(LOCAL_INSTALLED_MODULE),$(my_installed_module_stem),$(symlink)))
|
|
|
|
|
2016-09-07 21:48:30 +02:00
|
|
|
$(my_all_targets) : | $(my_installed_symlinks)
|
2016-08-25 00:20:23 +02:00
|
|
|
|
2015-08-20 21:02:10 +02:00
|
|
|
endif # !LOCAL_UNINSTALLABLE_MODULE
|
2009-07-17 21:33:40 +02:00
|
|
|
|
|
|
|
###########################################################
|
|
|
|
## CHECK_BUILD goals
|
|
|
|
###########################################################
|
2014-09-29 23:34:32 +02:00
|
|
|
my_checked_module :=
|
2009-07-17 21:33:40 +02:00
|
|
|
# If nobody has defined a more specific module for the
|
2013-01-30 23:43:05 +01:00
|
|
|
# checked modules, use LOCAL_BUILT_MODULE.
|
2014-09-29 23:34:32 +02:00
|
|
|
ifdef LOCAL_CHECKED_MODULE
|
|
|
|
my_checked_module := $(LOCAL_CHECKED_MODULE)
|
|
|
|
else
|
|
|
|
my_checked_module := $(LOCAL_BUILT_MODULE)
|
2009-07-17 21:33:40 +02:00
|
|
|
endif
|
|
|
|
|
|
|
|
# If they request that this module not be checked, then don't.
|
|
|
|
# PLEASE DON'T SET THIS. ANY PLACES THAT SET THIS WITHOUT
|
|
|
|
# GOOD REASON WILL HAVE IT REMOVED.
|
|
|
|
ifdef LOCAL_DONT_CHECK_MODULE
|
2014-09-29 23:34:32 +02:00
|
|
|
my_checked_module :=
|
2009-07-17 21:33:40 +02:00
|
|
|
endif
|
2014-05-20 23:43:51 +02:00
|
|
|
# Don't check build target module defined for the 2nd arch
|
|
|
|
ifndef LOCAL_IS_HOST_MODULE
|
2014-01-16 01:02:16 +01:00
|
|
|
ifdef LOCAL_2ND_ARCH_VAR_PREFIX
|
2014-09-29 23:34:32 +02:00
|
|
|
my_checked_module :=
|
2014-01-16 01:02:16 +01:00
|
|
|
endif
|
2014-05-20 23:43:51 +02:00
|
|
|
endif
|
2009-07-17 21:33:40 +02:00
|
|
|
|
2015-06-03 21:43:50 +02:00
|
|
|
###########################################################
|
2017-02-17 03:04:10 +01:00
|
|
|
## Compatibility suite files.
|
2015-06-03 21:43:50 +02:00
|
|
|
###########################################################
|
|
|
|
ifdef LOCAL_COMPATIBILITY_SUITE
|
2017-02-09 00:53:32 +01:00
|
|
|
|
2015-10-21 03:18:40 +02:00
|
|
|
# The module itself.
|
2017-02-17 03:04:10 +01:00
|
|
|
$(foreach suite, $(LOCAL_COMPATIBILITY_SUITE), \
|
|
|
|
$(eval my_compat_dist_$(suite) := $(foreach dir, $(call compatibility_suite_dirs,$(suite)), \
|
|
|
|
$(LOCAL_BUILT_MODULE):$(dir)/$(my_installed_module_stem))))
|
2015-10-21 03:18:40 +02:00
|
|
|
|
|
|
|
# Make sure we only add the files once for multilib modules.
|
|
|
|
ifndef $(my_prefix)$(LOCAL_MODULE_CLASS)_$(LOCAL_MODULE)_compat_files
|
|
|
|
$(my_prefix)$(LOCAL_MODULE_CLASS)_$(LOCAL_MODULE)_compat_files := true
|
|
|
|
|
2015-09-17 21:24:56 +02:00
|
|
|
# LOCAL_COMPATIBILITY_SUPPORT_FILES is a list of <src>[:<dest>].
|
2017-02-17 03:04:10 +01:00
|
|
|
$(foreach suite, $(LOCAL_COMPATIBILITY_SUITE), \
|
|
|
|
$(eval my_compat_dist_$(suite) += $(foreach f, $(LOCAL_COMPATIBILITY_SUPPORT_FILES), \
|
|
|
|
$(eval p := $(subst :,$(space),$(f))) \
|
|
|
|
$(eval s := $(word 1,$(p))) \
|
|
|
|
$(eval n := $(or $(word 2,$(p)),$(notdir $(word 1, $(p))))) \
|
|
|
|
$(foreach dir, $(call compatibility_suite_dirs,$(suite)), \
|
|
|
|
$(s):$(dir)/$(n)))))
|
|
|
|
|
2015-09-17 21:24:56 +02:00
|
|
|
|
|
|
|
ifneq (,$(wildcard $(LOCAL_PATH)/AndroidTest.xml))
|
2017-02-17 03:04:10 +01:00
|
|
|
$(foreach suite, $(LOCAL_COMPATIBILITY_SUITE), \
|
|
|
|
$(eval my_compat_dist_$(suite) += $(foreach dir, $(call compatibility_suite_dirs,$(suite)), \
|
|
|
|
$(LOCAL_PATH)/AndroidTest.xml:$(dir)/$(LOCAL_MODULE).config)))
|
2015-06-04 20:21:49 +02:00
|
|
|
endif
|
2015-06-03 21:43:50 +02:00
|
|
|
|
2015-09-17 21:24:56 +02:00
|
|
|
ifneq (,$(wildcard $(LOCAL_PATH)/DynamicConfig.xml))
|
2017-02-17 03:04:10 +01:00
|
|
|
$(foreach suite, $(LOCAL_COMPATIBILITY_SUITE), \
|
|
|
|
$(eval my_compat_dist_$(suite) += $(foreach dir, $(call compatibility_suite_dirs,$(suite)), \
|
|
|
|
$(LOCAL_PATH)/DynamicConfig.xml:$(dir)/$(LOCAL_MODULE).dynamic)))
|
2015-08-18 23:31:08 +02:00
|
|
|
endif
|
2015-10-21 03:18:40 +02:00
|
|
|
endif # $(my_prefix)$(LOCAL_MODULE_CLASS)_$(LOCAL_MODULE)_compat_files
|
2015-08-18 23:31:08 +02:00
|
|
|
|
2017-02-17 03:04:10 +01:00
|
|
|
$(call create-suite-dependencies)
|
2015-06-03 21:43:50 +02:00
|
|
|
|
|
|
|
endif # LOCAL_COMPATIBILITY_SUITE
|
|
|
|
|
2016-12-10 01:05:09 +01:00
|
|
|
###########################################################
|
|
|
|
## Test Data
|
|
|
|
###########################################################
|
|
|
|
my_test_data_pairs :=
|
|
|
|
my_installed_test_data :=
|
|
|
|
|
|
|
|
ifneq ($(filter NATIVE_TESTS,$(LOCAL_MODULE_CLASS)),)
|
|
|
|
ifneq ($(strip $(LOCAL_TEST_DATA)),)
|
|
|
|
ifneq (true,$(LOCAL_UNINSTALLABLE_MODULE))
|
|
|
|
|
|
|
|
my_test_data_pairs := $(strip $(foreach td,$(LOCAL_TEST_DATA), \
|
|
|
|
$(eval _file := $(call word-colon,2,$(td))) \
|
|
|
|
$(if $(_file), \
|
|
|
|
$(eval _base := $(call word-colon,1,$(td))), \
|
|
|
|
$(eval _base := $(LOCAL_PATH)) \
|
|
|
|
$(eval _file := $(call word-colon,1,$(td)))) \
|
|
|
|
$(if $(findstring ..,$(_file)),$(error $(LOCAL_MODULE_MAKEFILE): LOCAL_TEST_DATA may not include '..': $(_file))) \
|
|
|
|
$(if $(filter /%,$(_base) $(_file)),$(error $(LOCAL_MODULE_MAKEFILE): LOCAL_TEST_DATA may not include absolute paths: $(_base) $(_file))) \
|
|
|
|
$(call append-path,$(_base),$(_file)):$(call append-path,$(my_module_path),$(_file))))
|
|
|
|
|
|
|
|
my_installed_test_data := $(call copy-many-files,$(my_test_data_pairs))
|
|
|
|
$(LOCAL_INSTALLED_MODULE): $(my_installed_test_data)
|
|
|
|
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2009-03-04 04:28:42 +01:00
|
|
|
###########################################################
|
|
|
|
## Register with ALL_MODULES
|
|
|
|
###########################################################
|
|
|
|
|
2014-01-16 01:02:16 +01:00
|
|
|
ALL_MODULES += $(my_register_name)
|
2009-03-04 04:28:42 +01:00
|
|
|
|
|
|
|
# Don't use += on subvars, or else they'll end up being
|
|
|
|
# recursively expanded.
|
2014-01-16 01:02:16 +01:00
|
|
|
ALL_MODULES.$(my_register_name).CLASS := \
|
|
|
|
$(ALL_MODULES.$(my_register_name).CLASS) $(LOCAL_MODULE_CLASS)
|
|
|
|
ALL_MODULES.$(my_register_name).PATH := \
|
|
|
|
$(ALL_MODULES.$(my_register_name).PATH) $(LOCAL_PATH)
|
|
|
|
ALL_MODULES.$(my_register_name).TAGS := \
|
2014-01-28 00:19:09 +01:00
|
|
|
$(ALL_MODULES.$(my_register_name).TAGS) $(my_module_tags)
|
2014-01-16 01:02:16 +01:00
|
|
|
ALL_MODULES.$(my_register_name).CHECKED := \
|
2014-09-29 23:34:32 +02:00
|
|
|
$(ALL_MODULES.$(my_register_name).CHECKED) $(my_checked_module)
|
2014-01-16 01:02:16 +01:00
|
|
|
ALL_MODULES.$(my_register_name).BUILT := \
|
|
|
|
$(ALL_MODULES.$(my_register_name).BUILT) $(LOCAL_BUILT_MODULE)
|
2014-05-19 22:03:36 +02:00
|
|
|
ifneq (true,$(LOCAL_UNINSTALLABLE_MODULE))
|
2014-01-16 01:02:16 +01:00
|
|
|
ALL_MODULES.$(my_register_name).INSTALLED := \
|
2015-08-20 21:02:10 +02:00
|
|
|
$(strip $(ALL_MODULES.$(my_register_name).INSTALLED) \
|
2016-12-10 01:05:09 +01:00
|
|
|
$(LOCAL_INSTALLED_MODULE) $(my_init_rc_installed) $(my_installed_symlinks) \
|
|
|
|
$(my_installed_test_data))
|
2014-05-19 22:03:36 +02:00
|
|
|
ALL_MODULES.$(my_register_name).BUILT_INSTALLED := \
|
2015-08-20 21:02:10 +02:00
|
|
|
$(strip $(ALL_MODULES.$(my_register_name).BUILT_INSTALLED) \
|
|
|
|
$(LOCAL_BUILT_MODULE):$(LOCAL_INSTALLED_MODULE) \
|
2016-12-10 01:05:09 +01:00
|
|
|
$(my_init_rc_pairs) $(my_test_data_pairs))
|
2014-05-19 22:03:36 +02:00
|
|
|
endif
|
2014-05-06 01:46:52 +02:00
|
|
|
ifdef LOCAL_PICKUP_FILES
|
|
|
|
# Files or directories ready to pick up by the build system
|
|
|
|
# when $(LOCAL_BUILT_MODULE) is done.
|
|
|
|
ALL_MODULES.$(my_register_name).PICKUP_FILES := \
|
|
|
|
$(ALL_MODULES.$(my_register_name).PICKUP_FILES) $(LOCAL_PICKUP_FILES)
|
|
|
|
endif
|
2015-08-14 02:51:40 +02:00
|
|
|
my_required_modules := $(LOCAL_REQUIRED_MODULES) \
|
|
|
|
$(LOCAL_REQUIRED_MODULES_$(TARGET_$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH))
|
|
|
|
ifdef LOCAL_IS_HOST_MODULE
|
|
|
|
my_required_modules += $(LOCAL_REQUIRED_MODULES_$($(my_prefix)OS))
|
|
|
|
endif
|
2014-01-16 01:02:16 +01:00
|
|
|
ALL_MODULES.$(my_register_name).REQUIRED := \
|
2015-08-14 02:51:40 +02:00
|
|
|
$(strip $(ALL_MODULES.$(my_register_name).REQUIRED) $(my_required_modules))
|
2017-01-05 17:54:46 +01:00
|
|
|
ALL_MODULES.$(my_register_name).EXPLICITLY_REQUIRED := \
|
|
|
|
$(strip $(ALL_MODULES.$(my_register_name).EXPLICITLY_REQUIRED)\
|
|
|
|
$(my_required_modules))
|
2015-09-04 09:23:49 +02:00
|
|
|
ALL_MODULES.$(my_register_name).EVENT_LOG_TAGS := \
|
|
|
|
$(ALL_MODULES.$(my_register_name).EVENT_LOG_TAGS) $(event_log_tags)
|
2014-01-16 01:02:16 +01:00
|
|
|
ALL_MODULES.$(my_register_name).MAKEFILE := \
|
|
|
|
$(ALL_MODULES.$(my_register_name).MAKEFILE) $(LOCAL_MODULE_MAKEFILE)
|
2011-12-10 00:11:57 +01:00
|
|
|
ifdef LOCAL_MODULE_OWNER
|
2014-01-16 01:02:16 +01:00
|
|
|
ALL_MODULES.$(my_register_name).OWNER := \
|
|
|
|
$(sort $(ALL_MODULES.$(my_register_name).OWNER) $(LOCAL_MODULE_OWNER))
|
2011-12-10 00:11:57 +01:00
|
|
|
endif
|
2014-02-11 07:26:23 +01:00
|
|
|
ifdef LOCAL_2ND_ARCH_VAR_PREFIX
|
|
|
|
ALL_MODULES.$(my_register_name).FOR_2ND_ARCH := true
|
|
|
|
endif
|
2015-08-14 21:59:50 +02:00
|
|
|
ALL_MODULES.$(my_register_name).FOR_HOST_CROSS := $(my_host_cross)
|
2009-03-04 04:28:42 +01:00
|
|
|
|
2014-01-16 01:02:16 +01:00
|
|
|
INSTALLABLE_FILES.$(LOCAL_INSTALLED_MODULE).MODULE := $(my_register_name)
|
2010-05-21 23:29:29 +02:00
|
|
|
|
2015-05-07 21:08:53 +02:00
|
|
|
##########################################################
|
|
|
|
# Track module-level dependencies.
|
|
|
|
# Use $(LOCAL_MODULE) instead of $(my_register_name) to ignore module's bitness.
|
|
|
|
ALL_DEPS.MODULES := $(sort $(ALL_DEPS.MODULES) $(LOCAL_MODULE))
|
|
|
|
ALL_DEPS.$(LOCAL_MODULE).ALL_DEPS := $(sort \
|
|
|
|
$(ALL_MODULES.$(LOCAL_MODULE).ALL_DEPS) \
|
|
|
|
$(LOCAL_STATIC_LIBRARIES) \
|
|
|
|
$(LOCAL_WHOLE_STATIC_LIBRARIES) \
|
|
|
|
$(LOCAL_SHARED_LIBRARIES) \
|
2017-02-16 00:48:11 +01:00
|
|
|
$(LOCAL_HEADER_LIBRARIES) \
|
2015-05-07 21:08:53 +02:00
|
|
|
$(LOCAL_STATIC_JAVA_LIBRARIES) \
|
|
|
|
$(LOCAL_JAVA_LIBRARIES)\
|
|
|
|
$(LOCAL_JNI_SHARED_LIBRARIES))
|
|
|
|
|
|
|
|
ALL_DEPS.$(LOCAL_MODULE).LICENSE := $(sort $(ALL_DEPS.$(LOCAL_MODULE).LICENSE) $(license_files))
|
|
|
|
|
2009-03-04 04:28:42 +01:00
|
|
|
###########################################################
|
2014-01-28 00:19:09 +01:00
|
|
|
## Take care of my_module_tags
|
2009-03-04 04:28:42 +01:00
|
|
|
###########################################################
|
|
|
|
|
|
|
|
# Keep track of all the tags we've seen.
|
2014-01-28 00:19:09 +01:00
|
|
|
ALL_MODULE_TAGS := $(sort $(ALL_MODULE_TAGS) $(my_module_tags))
|
2009-03-04 04:28:42 +01:00
|
|
|
|
|
|
|
# Add this module name to the tag list of each specified tag.
|
2014-01-28 00:19:09 +01:00
|
|
|
$(foreach tag,$(my_module_tags),\
|
2014-01-16 01:02:16 +01:00
|
|
|
$(eval ALL_MODULE_NAME_TAGS.$(tag) += $(my_register_name)))
|
2009-03-04 04:28:42 +01:00
|
|
|
|
2013-01-30 01:59:18 +01:00
|
|
|
###########################################################
|
|
|
|
## umbrella targets used to verify builds
|
|
|
|
###########################################################
|
|
|
|
j_or_n :=
|
2017-02-16 00:48:11 +01:00
|
|
|
ifneq (,$(filter EXECUTABLES SHARED_LIBRARIES STATIC_LIBRARIES HEADER_LIBRARIES NATIVE_TESTS,$(LOCAL_MODULE_CLASS)))
|
2013-01-30 01:59:18 +01:00
|
|
|
j_or_n := native
|
|
|
|
else
|
|
|
|
ifneq (,$(filter JAVA_LIBRARIES APPS,$(LOCAL_MODULE_CLASS)))
|
|
|
|
j_or_n := java
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
ifdef LOCAL_IS_HOST_MODULE
|
|
|
|
h_or_t := host
|
Add more module targets for host, host-cross, host32, host64
Previously, clang-host would build the clang module for 32-bit and
64-bit for the host and for windows. Make clang-host only compile
for host, and add clang-host-cross for windows. Also add targets
that only build 32-bit or 64-bit: clang-host32, clang-host64,
clang-host-cross32, clang-host-cross64, clang-target32, and
clang-target64.
Test: inspect build.ninja
Change-Id: I7676f9497dfc852f2a0255dda8da06c88eec0db8
2016-12-09 22:08:27 +01:00
|
|
|
ifeq ($(my_host_cross),true)
|
|
|
|
h_or_hc_or_t := host-cross
|
|
|
|
else
|
|
|
|
h_or_hc_or_t := host
|
|
|
|
endif
|
2013-01-30 01:59:18 +01:00
|
|
|
else
|
Add more module targets for host, host-cross, host32, host64
Previously, clang-host would build the clang module for 32-bit and
64-bit for the host and for windows. Make clang-host only compile
for host, and add clang-host-cross for windows. Also add targets
that only build 32-bit or 64-bit: clang-host32, clang-host64,
clang-host-cross32, clang-host-cross64, clang-target32, and
clang-target64.
Test: inspect build.ninja
Change-Id: I7676f9497dfc852f2a0255dda8da06c88eec0db8
2016-12-09 22:08:27 +01:00
|
|
|
h_or_hc_or_t := target
|
2013-01-30 01:59:18 +01:00
|
|
|
h_or_t := target
|
|
|
|
endif
|
|
|
|
|
Add more module targets for host, host-cross, host32, host64
Previously, clang-host would build the clang module for 32-bit and
64-bit for the host and for windows. Make clang-host only compile
for host, and add clang-host-cross for windows. Also add targets
that only build 32-bit or 64-bit: clang-host32, clang-host64,
clang-host-cross32, clang-host-cross64, clang-target32, and
clang-target64.
Test: inspect build.ninja
Change-Id: I7676f9497dfc852f2a0255dda8da06c88eec0db8
2016-12-09 22:08:27 +01:00
|
|
|
|
2013-01-30 01:59:18 +01:00
|
|
|
ifdef j_or_n
|
2014-09-29 23:34:32 +02:00
|
|
|
$(j_or_n) $(h_or_t) $(j_or_n)-$(h_or_t) : $(my_checked_module)
|
2014-01-28 00:19:09 +01:00
|
|
|
ifneq (,$(filter $(my_module_tags),tests))
|
2014-09-29 23:34:32 +02:00
|
|
|
$(j_or_n)-$(h_or_t)-tests $(j_or_n)-tests $(h_or_t)-tests : $(my_checked_module)
|
2013-01-30 01:59:18 +01:00
|
|
|
endif
|
Add more module targets for host, host-cross, host32, host64
Previously, clang-host would build the clang module for 32-bit and
64-bit for the host and for windows. Make clang-host only compile
for host, and add clang-host-cross for windows. Also add targets
that only build 32-bit or 64-bit: clang-host32, clang-host64,
clang-host-cross32, clang-host-cross64, clang-target32, and
clang-target64.
Test: inspect build.ninja
Change-Id: I7676f9497dfc852f2a0255dda8da06c88eec0db8
2016-12-09 22:08:27 +01:00
|
|
|
$(LOCAL_MODULE)-$(h_or_hc_or_t) : $(my_all_targets)
|
|
|
|
ifeq ($(j_or_n),native)
|
|
|
|
$(LOCAL_MODULE)-$(h_or_hc_or_t)$(my_32_64_bit_suffix) : $(my_all_targets)
|
|
|
|
endif
|
2013-01-30 01:59:18 +01:00
|
|
|
endif
|
|
|
|
|
2009-03-04 04:28:42 +01:00
|
|
|
###########################################################
|
|
|
|
## NOTICE files
|
|
|
|
###########################################################
|
|
|
|
|
2012-11-02 01:22:33 +01:00
|
|
|
include $(BUILD_NOTICE_FILE)
|