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
|
2022-04-29 01:12:52 +02:00
|
|
|
ifndef _has_warned_about_base_rules_hook
|
|
|
|
$(warning base-rules-hook is deprecated, please remove usages of it and/or convert to Soong.)
|
|
|
|
_has_warned_about_base_rules_hook := true
|
|
|
|
endif
|
|
|
|
$(if $(base-rules-hook),)
|
2009-03-04 04:28:42 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
###########################################################
|
|
|
|
## Common instructions for a generic module.
|
|
|
|
###########################################################
|
|
|
|
|
|
|
|
LOCAL_MODULE := $(strip $(LOCAL_MODULE))
|
|
|
|
ifeq ($(LOCAL_MODULE),)
|
|
|
|
$(error $(LOCAL_PATH): LOCAL_MODULE is not defined)
|
|
|
|
endif
|
2018-06-10 23:49:01 +02:00
|
|
|
$(call verify-module-name)
|
2009-03-04 04:28:42 +01:00
|
|
|
|
2022-03-20 07:20:59 +01:00
|
|
|
my_test_data :=
|
|
|
|
my_test_config :=
|
|
|
|
|
2009-03-04 04:28:42 +01:00
|
|
|
LOCAL_IS_HOST_MODULE := $(strip $(LOCAL_IS_HOST_MODULE))
|
|
|
|
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
|
2020-03-07 03:09:06 +01:00
|
|
|
my_prefix := TARGET_
|
|
|
|
my_kind :=
|
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
|
|
|
|
|
2018-07-12 20:44:33 +02:00
|
|
|
ifeq (true, $(LOCAL_PRODUCT_MODULE))
|
|
|
|
ifneq (,$(filter $(LOCAL_MODULE),$(PRODUCT_FORCE_PRODUCT_MODULES_TO_SYSTEM_PARTITION)))
|
|
|
|
LOCAL_PRODUCT_MODULE :=
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2017-11-15 10:22:14 +01:00
|
|
|
_path := $(LOCAL_MODULE_PATH) $(LOCAL_MODULE_PATH_32) $(LOCAL_MODULE_PATH_64)
|
|
|
|
ifneq ($(filter $(TARGET_OUT_VENDOR)%,$(_path)),)
|
|
|
|
LOCAL_VENDOR_MODULE := true
|
|
|
|
else ifneq ($(filter $(TARGET_OUT_OEM)/%,$(_path)),)
|
|
|
|
LOCAL_OEM_MODULE := true
|
|
|
|
else ifneq ($(filter $(TARGET_OUT_ODM)/%,$(_path)),)
|
|
|
|
LOCAL_ODM_MODULE := true
|
2017-11-27 09:04:47 +01:00
|
|
|
else ifneq ($(filter $(TARGET_OUT_PRODUCT)/%,$(_path)),)
|
|
|
|
LOCAL_PRODUCT_MODULE := true
|
2019-06-25 08:58:13 +02:00
|
|
|
else ifneq ($(filter $(TARGET_OUT_SYSTEM_EXT)/%,$(_path)),)
|
|
|
|
LOCAL_SYSTEM_EXT_MODULE := true
|
2017-11-15 10:22:14 +01:00
|
|
|
endif
|
|
|
|
_path :=
|
|
|
|
|
2019-06-25 08:58:13 +02:00
|
|
|
# TODO(b/135957588) Remove following workaround
|
|
|
|
# LOCAL_PRODUCT_SERVICES_MODULE to LOCAL_PRODUCT_MODULE for all Android.mk
|
|
|
|
ifndef LOCAL_PRODUCT_MODULE
|
|
|
|
LOCAL_PRODUCT_MODULE := $(LOCAL_PRODUCT_SERVICES_MODULE)
|
|
|
|
endif
|
|
|
|
|
2017-03-21 02:31:17 +01:00
|
|
|
ifndef LOCAL_PROPRIETARY_MODULE
|
|
|
|
LOCAL_PROPRIETARY_MODULE := $(LOCAL_VENDOR_MODULE)
|
|
|
|
endif
|
|
|
|
ifndef LOCAL_VENDOR_MODULE
|
|
|
|
LOCAL_VENDOR_MODULE := $(LOCAL_PROPRIETARY_MODULE)
|
|
|
|
endif
|
|
|
|
ifneq ($(filter-out $(LOCAL_PROPRIETARY_MODULE),$(LOCAL_VENDOR_MODULE))$(filter-out $(LOCAL_VENDOR_MODULE),$(LOCAL_PROPRIETARY_MODULE)),)
|
|
|
|
$(call pretty-error,Only one of LOCAL_PROPRIETARY_MODULE[$(LOCAL_PROPRIETARY_MODULE)] and LOCAL_VENDOR_MODULE[$(LOCAL_VENDOR_MODULE)] may be set, or they must be equal)
|
|
|
|
endif
|
|
|
|
|
2020-08-10 06:03:22 +02:00
|
|
|
ifeq ($(LOCAL_HOST_MODULE),true)
|
|
|
|
my_image_variant := host
|
|
|
|
else ifeq ($(LOCAL_VENDOR_MODULE),true)
|
|
|
|
my_image_variant := vendor
|
|
|
|
else ifeq ($(LOCAL_OEM_MODULE),true)
|
|
|
|
my_image_variant := vendor
|
|
|
|
else ifeq ($(LOCAL_ODM_MODULE),true)
|
|
|
|
my_image_variant := vendor
|
|
|
|
else ifeq ($(LOCAL_PRODUCT_MODULE),true)
|
|
|
|
my_image_variant := product
|
|
|
|
else
|
|
|
|
my_image_variant := core
|
|
|
|
endif
|
|
|
|
|
2019-01-18 07:09:09 +01:00
|
|
|
non_system_module := $(filter true, \
|
|
|
|
$(LOCAL_PRODUCT_MODULE) \
|
2019-06-25 08:58:13 +02:00
|
|
|
$(LOCAL_SYSTEM_EXT_MODULE) \
|
2019-01-18 07:09:09 +01:00
|
|
|
$(LOCAL_VENDOR_MODULE) \
|
|
|
|
$(LOCAL_PROPRIETARY_MODULE))
|
|
|
|
|
2016-11-18 23:05:39 +01:00
|
|
|
include $(BUILD_SYSTEM)/local_vndk.mk
|
2018-01-15 06:48:40 +01:00
|
|
|
include $(BUILD_SYSTEM)/local_systemsdk.mk
|
2020-08-20 13:21:36 +02:00
|
|
|
include $(BUILD_SYSTEM)/local_current_sdk.mk
|
2016-11-18 23:05:39 +01:00
|
|
|
|
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
|
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))
|
|
|
|
|
2017-10-24 07:14:21 +02:00
|
|
|
my_bad_deps := $(strip $(foreach dep,$(filter-out | ||,$(LOCAL_ADDITIONAL_DEPENDENCIES)),\
|
|
|
|
$(if $(findstring /,$(dep)),,$(dep))))
|
|
|
|
ifneq ($(my_bad_deps),)
|
|
|
|
$(call pretty-warning,"Bad LOCAL_ADDITIONAL_DEPENDENCIES: $(my_bad_deps)")
|
|
|
|
$(call pretty-error,"LOCAL_ADDITIONAL_DEPENDENCIES must only contain paths (not module names)")
|
|
|
|
endif
|
|
|
|
|
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
|
|
|
|
2019-01-23 04:38:56 +01:00
|
|
|
my_bad_module_tags := $(filter eng debug,$(my_module_tags))
|
|
|
|
ifdef my_bad_module_tags
|
|
|
|
ifeq (true,$(LOCAL_UNINSTALLABLE_MODULE))
|
|
|
|
$(call pretty-warning,LOCAL_MODULE_TAGS := $(my_bad_module_tags) does not do anything for uninstallable modules)
|
|
|
|
endif
|
2019-02-10 03:58:36 +01:00
|
|
|
$(call pretty-error,LOCAL_MODULE_TAGS := $(my_bad_module_tags) is obsolete. See $(CHANGES_URL)#LOCAL_MODULE_TAGS)
|
2019-01-23 04:38:56 +01:00
|
|
|
endif
|
|
|
|
|
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.
|
2019-02-10 03:58:36 +01:00
|
|
|
ifneq ($(filter-out tests optional samples,$(my_module_tags)),)
|
|
|
|
$(call pretty-error,unusual tags: $(filter-out tests optional samples,$(my_module_tags)))
|
2010-01-07 20:06:50 +01:00
|
|
|
endif
|
|
|
|
|
2009-03-04 04:28:42 +01:00
|
|
|
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))
|
2014-03-21 20:25:44 +01:00
|
|
|
my_multilib_module_path := $(strip $(LOCAL_MODULE_PATH_$(my_32_64_bit_suffix)))
|
|
|
|
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))
|
2020-05-06 22:46:30 +02:00
|
|
|
|
2017-02-13 22:41:43 +01:00
|
|
|
ifdef LOCAL_IS_HOST_MODULE
|
|
|
|
partition_tag :=
|
2020-03-21 02:31:43 +01:00
|
|
|
actual_partition_tag :=
|
2017-02-13 22:41:43 +01:00
|
|
|
else
|
2019-04-03 03:10:37 +02:00
|
|
|
ifeq (true,$(strip $(LOCAL_VENDOR_MODULE)))
|
2017-02-13 22:41:43 +01:00
|
|
|
partition_tag := _VENDOR
|
2020-03-21 02:31:43 +01:00
|
|
|
# A vendor module could be on the vendor partition at "vendor" or the system
|
|
|
|
# partition at "system/vendor".
|
|
|
|
actual_partition_tag := $(if $(filter true,$(BOARD_USES_VENDORIMAGE)),vendor,system)
|
2019-04-03 03:10:37 +02:00
|
|
|
else ifeq (true,$(strip $(LOCAL_OEM_MODULE)))
|
2017-02-13 22:41:43 +01:00
|
|
|
partition_tag := _OEM
|
2020-03-21 02:31:43 +01:00
|
|
|
actual_partition_tag := oem
|
2019-04-03 03:10:37 +02:00
|
|
|
else ifeq (true,$(strip $(LOCAL_ODM_MODULE)))
|
2017-02-13 22:41:43 +01:00
|
|
|
partition_tag := _ODM
|
2020-03-21 02:31:43 +01:00
|
|
|
# An ODM module could be on the odm partition at "odm", the vendor partition
|
|
|
|
# at "vendor/odm", or the system partition at "system/vendor/odm".
|
|
|
|
actual_partition_tag := $(if $(filter true,$(BOARD_USES_ODMIMAGE)),odm,$(if $(filter true,$(BOARD_USES_VENDORIMAGE)),vendor,system))
|
2019-04-03 03:10:37 +02:00
|
|
|
else ifeq (true,$(strip $(LOCAL_PRODUCT_MODULE)))
|
2017-11-27 09:04:47 +01:00
|
|
|
partition_tag := _PRODUCT
|
2020-03-21 02:31:43 +01:00
|
|
|
# A product module could be on the product partition at "product" or the
|
|
|
|
# system partition at "system/product".
|
|
|
|
actual_partition_tag := $(if $(filter true,$(BOARD_USES_PRODUCTIMAGE)),product,system)
|
2019-06-25 08:58:13 +02:00
|
|
|
else ifeq (true,$(strip $(LOCAL_SYSTEM_EXT_MODULE)))
|
|
|
|
partition_tag := _SYSTEM_EXT
|
2020-03-21 02:31:43 +01:00
|
|
|
# A system_ext-specific module could be on the system_ext partition at
|
|
|
|
# "system_ext" or the system partition at "system/system_ext".
|
|
|
|
actual_partition_tag := $(if $(filter true,$(BOARD_USES_SYSTEM_EXTIMAGE)),system_ext,system)
|
2017-02-13 22:41:43 +01:00
|
|
|
else ifeq (NATIVE_TESTS,$(LOCAL_MODULE_CLASS))
|
|
|
|
partition_tag := _DATA
|
2020-03-21 02:31:43 +01:00
|
|
|
actual_partition_tag := data
|
2017-02-13 22:41:43 +01:00
|
|
|
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)
|
2020-03-21 02:31:43 +01:00
|
|
|
actual_partition_tag := $(if $(partition_tag),data,system)
|
2017-02-13 22:41:43 +01:00
|
|
|
endif
|
|
|
|
endif
|
2019-03-14 02:04:05 +01:00
|
|
|
# For test modules that lack a suite tag, set null-suite as the default.
|
|
|
|
# We only support adding a default suite to native tests, native benchmarks, and instrumentation tests.
|
|
|
|
# This is because they are the only tests we currently auto-generate test configs for.
|
|
|
|
ifndef LOCAL_COMPATIBILITY_SUITE
|
|
|
|
ifneq ($(filter NATIVE_TESTS NATIVE_BENCHMARK, $(LOCAL_MODULE_CLASS)),)
|
|
|
|
LOCAL_COMPATIBILITY_SUITE := null-suite
|
|
|
|
endif
|
|
|
|
ifneq ($(filter APPS, $(LOCAL_MODULE_CLASS)),)
|
|
|
|
ifneq ($(filter $(my_module_tags),tests),)
|
|
|
|
LOCAL_COMPATIBILITY_SUITE := null-suite
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
use_testcase_folder :=
|
2019-03-25 21:26:03 +01:00
|
|
|
ifeq ($(my_module_path),)
|
|
|
|
ifneq ($(LOCAL_MODULE),$(filter $(LOCAL_MODULE),$(DEFAULT_DATA_OUT_MODULES)))
|
|
|
|
ifdef LOCAL_COMPATIBILITY_SUITE
|
|
|
|
ifneq (true, $(LOCAL_IS_HOST_MODULE))
|
|
|
|
use_testcase_folder := true
|
2019-03-14 02:04:05 +01:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2020-11-12 01:25:20 +01:00
|
|
|
ifeq ($(LOCAL_IS_UNIT_TEST),true)
|
|
|
|
ifeq ($(LOCAL_IS_HOST_MODULE),true)
|
|
|
|
LOCAL_COMPATIBILITY_SUITE += host-unit-tests
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2017-03-17 00:51:46 +01:00
|
|
|
ifeq ($(my_module_path),)
|
|
|
|
install_path_var := $(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)OUT$(partition_tag)_$(LOCAL_MODULE_CLASS)
|
|
|
|
ifeq (true,$(LOCAL_PRIVILEGED_MODULE))
|
|
|
|
install_path_var := $(install_path_var)_PRIVILEGED
|
2009-03-04 04:28:42 +01:00
|
|
|
endif
|
2017-01-20 01:01:17 +01:00
|
|
|
|
2017-03-17 00:51:46 +01:00
|
|
|
my_module_path := $($(install_path_var))
|
2019-03-14 02:04:05 +01:00
|
|
|
|
|
|
|
# If use_testcase_folder be set, and LOCAL_MODULE_PATH not set,
|
|
|
|
# overwrite the default path under testcase.
|
|
|
|
ifeq ($(use_testcase_folder),true)
|
|
|
|
arch_dir := $($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)
|
|
|
|
testcase_folder := $($(my_prefix)OUT_TESTCASES)/$(LOCAL_MODULE)/$(arch_dir)
|
|
|
|
my_module_path := $(testcase_folder)
|
|
|
|
arch_dir :=
|
|
|
|
endif
|
|
|
|
|
2017-03-17 00:51:46 +01:00
|
|
|
ifeq ($(strip $(my_module_path)),)
|
|
|
|
$(error $(LOCAL_PATH): unhandled install path "$(install_path_var) for $(LOCAL_MODULE)")
|
2017-01-20 01:01:17 +01:00
|
|
|
endif
|
|
|
|
endif
|
2017-03-17 00:51:46 +01:00
|
|
|
ifneq ($(my_module_relative_path),)
|
|
|
|
my_module_path := $(my_module_path)/$(my_module_relative_path)
|
2014-01-25 04:23:40 +01:00
|
|
|
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
|
|
|
|
|
2009-03-04 04:28:42 +01:00
|
|
|
# Make sure that this IS_HOST/CLASS/MODULE combination is unique.
|
|
|
|
module_id := MODULE.$(if \
|
2020-03-07 03:09:06 +01:00
|
|
|
$(LOCAL_IS_HOST_MODULE),$($(my_prefix)OS),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)
|
|
|
|
|
2020-06-09 06:00:18 +02:00
|
|
|
# These are the same as local-intermediates-dir / local-generated-sources dir, but faster
|
|
|
|
intermediates.COMMON := $($(my_prefix)OUT_COMMON_INTERMEDIATES)/$(LOCAL_MODULE_CLASS)/$(LOCAL_MODULE)_intermediates
|
|
|
|
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
|
2009-03-04 04:28:42 +01:00
|
|
|
|
2017-03-24 11:31:49 +01:00
|
|
|
ifneq ($(LOCAL_OVERRIDES_MODULES),)
|
2018-11-07 10:39:34 +01:00
|
|
|
ifndef LOCAL_IS_HOST_MODULE
|
|
|
|
ifeq ($(LOCAL_MODULE_CLASS),EXECUTABLES)
|
2017-03-24 11:31:49 +01:00
|
|
|
EXECUTABLES.$(LOCAL_MODULE).OVERRIDES := $(strip $(LOCAL_OVERRIDES_MODULES))
|
2018-11-07 10:39:34 +01:00
|
|
|
else ifeq ($(LOCAL_MODULE_CLASS),SHARED_LIBRARIES)
|
|
|
|
SHARED_LIBRARIES.$(LOCAL_MODULE).OVERRIDES := $(strip $(LOCAL_OVERRIDES_MODULES))
|
2019-11-06 23:08:59 +01:00
|
|
|
else ifeq ($(LOCAL_MODULE_CLASS),ETC)
|
|
|
|
ETC.$(LOCAL_MODULE).OVERRIDES := $(strip $(LOCAL_OVERRIDES_MODULES))
|
2017-03-24 11:31:49 +01:00
|
|
|
else
|
2018-11-07 10:39:34 +01:00
|
|
|
$(call pretty-error,LOCAL_MODULE_CLASS := $(LOCAL_MODULE_CLASS) cannot use LOCAL_OVERRIDES_MODULES)
|
2017-03-24 11:31:49 +01:00
|
|
|
endif
|
|
|
|
else
|
2018-11-07 10:39:34 +01:00
|
|
|
$(call pretty-error,host modules cannot use LOCAL_OVERRIDES_MODULES)
|
2017-03-24 11:31:49 +01:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
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
|
|
|
|
2017-05-16 08:38:04 +02:00
|
|
|
LOCAL_BUILT_MODULE := $(intermediates)/$(my_built_module_stem)
|
|
|
|
|
2021-09-25 00:48:03 +02:00
|
|
|
ifneq (,$(LOCAL_SOONG_INSTALLED_MODULE))
|
|
|
|
ifneq ($(LOCAL_MODULE_MAKEFILE),$(SOONG_ANDROID_MK))
|
|
|
|
$(call pretty-error, LOCAL_SOONG_INSTALLED_MODULE can only be used from $(SOONG_ANDROID_MK))
|
|
|
|
endif
|
|
|
|
# Use the install path requested by Soong.
|
|
|
|
LOCAL_INSTALLED_MODULE := $(LOCAL_SOONG_INSTALLED_MODULE)
|
|
|
|
else 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)
|
2020-05-06 22:46:30 +02:00
|
|
|
# framework-res.apk doesn't like the additional layer.
|
|
|
|
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
|
|
|
|
ifneq ($(use_testcase_folder),true)
|
|
|
|
my_module_path := $(my_module_path)/$(LOCAL_MODULE)
|
|
|
|
endif
|
2019-03-14 02:04:05 +01:00
|
|
|
endif
|
2014-07-18 06:24:42 +02:00
|
|
|
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.
|
2018-09-07 01:25:22 +02:00
|
|
|
#
|
|
|
|
# Don't create .toc files for Soong shared libraries, that is handled in
|
|
|
|
# Soong and soong_cc_prebuilt.mk
|
2015-10-09 07:36:04 +02:00
|
|
|
###########################################################
|
2018-09-07 01:25:22 +02:00
|
|
|
ifneq ($(LOCAL_MODULE_MAKEFILE),$(SOONG_ANDROID_MK))
|
2015-10-09 07:36:04 +02:00
|
|
|
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
|
2018-09-07 01:25:22 +02:00
|
|
|
endif
|
2015-10-09 07:36:04 +02:00
|
|
|
|
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)),)
|
2019-06-12 19:13:28 +02:00
|
|
|
event_log_tags := $(foreach f,$(addprefix $(LOCAL_PATH)/,$(logtags_sources)),$(call clean-path,$(f)))
|
2015-09-04 09:23:49 +02:00
|
|
|
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)
|
2018-07-24 10:21:12 +02:00
|
|
|
.PHONY: $(cleantarget)
|
2014-01-16 01:02:16 +01:00
|
|
|
$(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)
|
|
|
|
$(LOCAL_INTERMEDIATE_TARGETS) : PRIVATE_HOST:= $(my_host)
|
2015-08-14 21:59:50 +02:00
|
|
|
$(LOCAL_INTERMEDIATE_TARGETS) : PRIVATE_PREFIX := $(my_prefix)
|
2023-06-08 23:08:40 +02:00
|
|
|
$(LOCAL_INTERMEDIATE_TARGETS) : .KATI_TAGS += ;module_name=$(LOCAL_MODULE)
|
|
|
|
ifeq ($(LOCAL_MODULE_CLASS),)
|
|
|
|
$(error "$(LOCAL_MODULE) in $(LOCAL_PATH) does not set $(LOCAL_MODULE_CLASS)")
|
|
|
|
else
|
|
|
|
$(LOCAL_INTERMEDIATE_TARGETS) : .KATI_TAGS += ;module_type=$(LOCAL_MODULE_CLASS)
|
|
|
|
endif
|
2015-08-14 21:59:50 +02:00
|
|
|
|
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)
|
2019-01-30 00:04:39 +01:00
|
|
|
$(my_all_targets): $(LOCAL_BUILT_MODULE) $(LOCAL_INSTALLED_MODULE) $(LOCAL_ADDITIONAL_CHECKED_MODULE)
|
2016-09-07 21:48:30 +02:00
|
|
|
|
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.
|
2020-06-09 08:10:14 +02:00
|
|
|
define my_path_comp
|
|
|
|
parent := $(patsubst %/,%,$(dir $(1)))
|
|
|
|
parent_target := MODULES-IN-$$(subst /,-,$$(parent))
|
|
|
|
.PHONY: $$(parent_target)
|
|
|
|
$$(parent_target): $(2)
|
|
|
|
ifndef $$(parent_target)
|
|
|
|
$$(parent_target) := true
|
|
|
|
ifneq (,$$(findstring /,$$(parent)))
|
|
|
|
$$(eval $$(call my_path_comp,$$(parent),$$(parent_target)))
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endef
|
|
|
|
|
|
|
|
_local_path := $(patsubst %/,%,$(LOCAL_PATH))
|
|
|
|
_local_path_target := MODULES-IN-$(subst /,-,$(_local_path))
|
|
|
|
|
|
|
|
.PHONY: $(_local_path_target)
|
|
|
|
$(_local_path_target): $(my_register_name)
|
|
|
|
|
|
|
|
ifndef $(_local_path_target)
|
|
|
|
$(_local_path_target) := true
|
2020-08-08 14:10:59 +02:00
|
|
|
ifneq (,$(findstring /,$(_local_path)))
|
|
|
|
$(eval $(call my_path_comp,$(_local_path),$(_local_path_target)))
|
|
|
|
endif
|
2020-06-09 08:10:14 +02:00
|
|
|
endif
|
|
|
|
|
|
|
|
_local_path :=
|
|
|
|
_local_path_target :=
|
|
|
|
my_path_comp :=
|
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_installed_symlinks :=
|
2019-03-14 02:04:05 +01:00
|
|
|
|
2021-09-25 00:48:03 +02:00
|
|
|
ifneq (,$(LOCAL_SOONG_INSTALLED_MODULE))
|
|
|
|
# Soong already generated the copy rule, but make the installed location depend on the Make
|
|
|
|
# copy of the intermediates for now, as some rules that collect intermediates may expect
|
|
|
|
# them to exist.
|
|
|
|
$(LOCAL_INSTALLED_MODULE): $(LOCAL_BUILT_MODULE)
|
|
|
|
else ifneq (true,$(LOCAL_UNINSTALLABLE_MODULE))
|
2021-11-03 21:15:59 +01:00
|
|
|
$(LOCAL_INSTALLED_MODULE): PRIVATE_POST_INSTALL_CMD := $(LOCAL_POST_INSTALL_CMD)
|
|
|
|
$(LOCAL_INSTALLED_MODULE): $(LOCAL_BUILT_MODULE)
|
2009-03-04 04:28:42 +01:00
|
|
|
@echo "Install: $@"
|
2021-11-03 21:15:59 +01:00
|
|
|
ifeq ($(LOCAL_MODULE_MAKEFILE),$(SOONG_ANDROID_MK))
|
2020-08-21 17:36:23 +02:00
|
|
|
$(copy-file-or-link-to-new-target)
|
2021-11-03 21:15:59 +01:00
|
|
|
else
|
2011-01-19 02:21:20 +01:00
|
|
|
$(copy-file-to-new-target)
|
2021-09-25 00:48:03 +02:00
|
|
|
endif
|
2021-11-03 21:15:59 +01:00
|
|
|
$(PRIVATE_POST_INSTALL_CMD)
|
2016-07-15 01:02:57 +02:00
|
|
|
|
2021-09-25 00:48:03 +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),\
|
2021-04-15 19:41:38 +02:00
|
|
|
$(call symlink-file,$(LOCAL_INSTALLED_MODULE),$(my_installed_module_stem),$(symlink))\
|
|
|
|
$(call declare-0p-target,$(symlink)))
|
2016-07-15 01:02:57 +02:00
|
|
|
|
2021-09-25 00:48:03 +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
|
|
|
|
2023-09-02 01:15:00 +02:00
|
|
|
# Add dependencies on LOCAL_SOONG_INSTALL_SYMLINKS if we're installing any kind of module, not just
|
|
|
|
# ones that set LOCAL_SOONG_INSTALLED_MODULE. This is so we can have a soong module that only
|
|
|
|
# installs symlinks (e.g. install_symlink). We can't set LOCAL_SOONG_INSTALLED_MODULE to a symlink
|
|
|
|
# because cp commands will fail on symlinks.
|
|
|
|
ifneq (,$(or $(LOCAL_SOONG_INSTALLED_MODULE),$(call boolean-not,$(LOCAL_UNINSTALLABLE_MODULE))))
|
|
|
|
$(foreach symlink, $(LOCAL_SOONG_INSTALL_SYMLINKS), $(call declare-0p-target,$(symlink)))
|
|
|
|
$(my_all_targets) : | $(LOCAL_SOONG_INSTALL_SYMLINKS)
|
|
|
|
endif
|
|
|
|
|
2018-04-05 00:41:05 +02:00
|
|
|
###########################################################
|
2021-09-25 00:48:03 +02:00
|
|
|
## VINTF manifest fragment and init.rc goals
|
2018-04-05 00:41:05 +02:00
|
|
|
###########################################################
|
|
|
|
|
|
|
|
my_vintf_installed:=
|
2021-11-02 01:58:28 +01:00
|
|
|
my_vintf_path:=
|
2018-04-05 00:41:05 +02:00
|
|
|
my_vintf_pairs:=
|
2021-09-25 00:48:03 +02:00
|
|
|
my_init_rc_installed :=
|
|
|
|
my_init_rc_path :=
|
|
|
|
my_init_rc_pairs :=
|
2018-04-05 00:41:05 +02:00
|
|
|
ifneq (true,$(LOCAL_UNINSTALLABLE_MODULE))
|
2021-09-25 00:48:03 +02:00
|
|
|
ifndef LOCAL_IS_HOST_MODULE
|
|
|
|
# Rule to install the module's companion vintf fragments.
|
|
|
|
ifneq ($(strip $(LOCAL_FULL_VINTF_FRAGMENTS)),)
|
|
|
|
my_vintf_fragments := $(LOCAL_FULL_VINTF_FRAGMENTS)
|
|
|
|
else
|
|
|
|
my_vintf_fragments := $(foreach xml,$(LOCAL_VINTF_FRAGMENTS),$(LOCAL_PATH)/$(xml))
|
|
|
|
endif
|
|
|
|
ifneq ($(strip $(my_vintf_fragments)),)
|
2021-11-02 01:58:28 +01:00
|
|
|
# Make doesn't support recovery as an output partition, but some Soong modules installed in recovery
|
|
|
|
# have init.rc files that need to be installed alongside them. Manually handle the case where the
|
|
|
|
# output file is in the recovery partition.
|
|
|
|
my_vintf_path := $(if $(filter $(TARGET_RECOVERY_ROOT_OUT)/%,$(my_module_path)),$(TARGET_RECOVERY_ROOT_OUT)/system/etc,$(TARGET_OUT$(partition_tag)_ETC))
|
|
|
|
my_vintf_pairs := $(foreach xml,$(my_vintf_fragments),$(xml):$(my_vintf_path)/vintf/manifest/$(notdir $(xml)))
|
2021-09-25 00:48:03 +02:00
|
|
|
my_vintf_installed := $(foreach xml,$(my_vintf_pairs),$(call word-colon,2,$(xml)))
|
2018-04-05 00:41:05 +02:00
|
|
|
|
2021-09-25 00:48:03 +02:00
|
|
|
# Only set up copy rules once, even if another arch variant shares it
|
|
|
|
my_vintf_new_pairs := $(filter-out $(ALL_VINTF_MANIFEST_FRAGMENTS_LIST),$(my_vintf_pairs))
|
|
|
|
my_vintf_new_installed := $(call copy-many-vintf-manifest-files-checked,$(my_vintf_new_pairs))
|
2018-04-05 00:41:05 +02:00
|
|
|
|
2021-09-25 00:48:03 +02:00
|
|
|
ALL_VINTF_MANIFEST_FRAGMENTS_LIST += $(my_vintf_new_pairs)
|
2018-04-05 00:41:05 +02:00
|
|
|
|
2023-07-05 08:58:53 +02:00
|
|
|
$(my_all_targets) : $(my_vintf_installed)
|
2023-07-05 08:59:28 +02:00
|
|
|
# Install fragments together with the target
|
|
|
|
$(LOCAL_INSTALLED_MODULE) : | $(my_vintf_installed)
|
2021-09-25 00:48:03 +02:00
|
|
|
endif # my_vintf_fragments
|
2018-04-05 00:41:05 +02:00
|
|
|
|
2021-09-25 00:48:03 +02:00
|
|
|
# Rule to install the module's companion init.rc.
|
|
|
|
ifneq ($(strip $(LOCAL_FULL_INIT_RC)),)
|
|
|
|
my_init_rc := $(LOCAL_FULL_INIT_RC)
|
|
|
|
else
|
|
|
|
my_init_rc := $(foreach rc,$(LOCAL_INIT_RC_$(my_32_64_bit_suffix)) $(LOCAL_INIT_RC),$(LOCAL_PATH)/$(rc))
|
|
|
|
endif
|
|
|
|
ifneq ($(strip $(my_init_rc)),)
|
2022-04-14 01:40:06 +02:00
|
|
|
# Make doesn't support recovery or ramdisk as an output partition,
|
|
|
|
# but some Soong modules installed in recovery or ramdisk
|
|
|
|
# have init.rc files that need to be installed alongside them.
|
|
|
|
# Manually handle the case where the
|
|
|
|
# output file is in the recovery or ramdisk partition.
|
|
|
|
ifneq (,$(filter $(TARGET_RECOVERY_ROOT_OUT)/%,$(my_module_path)))
|
2023-01-13 18:45:00 +01:00
|
|
|
ifneq (,$(filter $(TARGET_RECOVERY_ROOT_OUT)/first_stage_ramdisk/%,$(my_module_path)))
|
|
|
|
my_init_rc_path := $(TARGET_RECOVERY_ROOT_OUT)/first_stage_ramdisk/system/etc
|
|
|
|
else
|
|
|
|
my_init_rc_path := $(TARGET_RECOVERY_ROOT_OUT)/system/etc
|
|
|
|
endif
|
2022-04-14 01:40:06 +02:00
|
|
|
else ifneq (,$(filter $(TARGET_RAMDISK_OUT)/%,$(my_module_path)))
|
|
|
|
my_init_rc_path := $(TARGET_RAMDISK_OUT)/system/etc
|
|
|
|
else
|
|
|
|
my_init_rc_path := $(TARGET_OUT$(partition_tag)_ETC)
|
|
|
|
endif
|
2021-09-25 00:48:03 +02:00
|
|
|
my_init_rc_pairs := $(foreach rc,$(my_init_rc),$(rc):$(my_init_rc_path)/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-init-script-files-checked,$(my_init_rc_new_pairs))
|
|
|
|
|
|
|
|
ALL_INIT_RC_INSTALLED_PAIRS += $(my_init_rc_new_pairs)
|
|
|
|
|
|
|
|
$(my_all_targets) : $(my_init_rc_installed)
|
2023-07-05 08:59:28 +02:00
|
|
|
# Install init_rc together with the target
|
|
|
|
$(LOCAL_INSTALLED_MODULE) : | $(my_init_rc_installed)
|
2021-09-25 00:48:03 +02:00
|
|
|
endif # my_init_rc
|
|
|
|
|
|
|
|
endif # !LOCAL_IS_HOST_MODULE
|
2018-04-05 00:41:05 +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
|
|
|
|
|
2019-01-30 00:04:39 +01:00
|
|
|
my_checked_module += $(LOCAL_ADDITIONAL_CHECKED_MODULE)
|
|
|
|
|
2009-07-17 21:33:40 +02:00
|
|
|
# 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
|
|
|
|
2017-12-04 23:44:16 +01:00
|
|
|
###########################################################
|
|
|
|
## Test Data
|
|
|
|
###########################################################
|
|
|
|
my_test_data_pairs :=
|
|
|
|
my_installed_test_data :=
|
|
|
|
# Source to relative dst file paths for reuse in LOCAL_COMPATIBILITY_SUITE.
|
|
|
|
my_test_data_file_pairs :=
|
|
|
|
|
2019-09-14 02:39:49 +02:00
|
|
|
ifneq ($(strip $(filter NATIVE_TESTS,$(LOCAL_MODULE_CLASS)) $(LOCAL_IS_FUZZ_TARGET)),)
|
2017-12-04 23:44:16 +01:00
|
|
|
ifneq ($(strip $(LOCAL_TEST_DATA)),)
|
|
|
|
ifneq (true,$(LOCAL_UNINSTALLABLE_MODULE))
|
|
|
|
|
2020-07-17 21:27:27 +02:00
|
|
|
# Soong LOCAL_TEST_DATA is of the form <from_base>:<file>:<relative_install_path>
|
|
|
|
# or <from_base>:<file>, to be installed to
|
|
|
|
# <install_root>/<relative_install_path>/<file> or <install_root>/<file>,
|
|
|
|
# respectively.
|
2020-06-06 07:28:20 +02:00
|
|
|
ifeq ($(LOCAL_MODULE_MAKEFILE),$(SOONG_ANDROID_MK))
|
|
|
|
define copy_test_data_pairs
|
|
|
|
_src_base := $$(call word-colon,1,$$(td))
|
|
|
|
_file := $$(call word-colon,2,$$(td))
|
2020-07-17 21:27:27 +02:00
|
|
|
_relative_install_path := $$(call word-colon,3,$$(td))
|
|
|
|
ifeq (,$$(_relative_install_path))
|
|
|
|
_relative_dest_file := $$(_file)
|
|
|
|
else
|
|
|
|
_relative_dest_file := $$(call append-path,$$(_relative_install_path),$$(_file))
|
|
|
|
endif
|
|
|
|
my_test_data_pairs += $$(call append-path,$$(_src_base),$$(_file)):$$(call append-path,$$(my_module_path),$$(_relative_dest_file))
|
|
|
|
my_test_data_file_pairs += $$(call append-path,$$(_src_base),$$(_file)):$$(_relative_dest_file)
|
2020-06-06 07:28:20 +02:00
|
|
|
endef
|
|
|
|
else
|
|
|
|
define copy_test_data_pairs
|
|
|
|
_src_base := $$(call word-colon,1,$$(td))
|
|
|
|
_file := $$(call word-colon,2,$$(td))
|
|
|
|
ifndef _file
|
|
|
|
_file := $$(_src_base)
|
|
|
|
_src_base := $$(LOCAL_PATH)
|
|
|
|
endif
|
|
|
|
ifneq (,$$(findstring ..,$$(_file)))
|
|
|
|
$$(call pretty-error,LOCAL_TEST_DATA may not include '..': $$(_file))
|
|
|
|
endif
|
|
|
|
ifneq (,$$(filter/%,$$(_src_base) $$(_file)))
|
|
|
|
$$(call pretty-error,LOCAL_TEST_DATA may not include absolute paths: $$(_src_base) $$(_file))
|
|
|
|
endif
|
|
|
|
my_test_data_pairs += $$(call append-path,$$(_src_base),$$(_file)):$$(call append-path,$$(my_module_path),$$(_file))
|
|
|
|
my_test_data_file_pairs += $$(call append-path,$$(_src_base),$$(_file)):$$(_file)
|
|
|
|
endef
|
|
|
|
endif
|
|
|
|
|
|
|
|
$(foreach td,$(LOCAL_TEST_DATA),$(eval $(copy_test_data_pairs)))
|
|
|
|
|
|
|
|
copy_test_data_pairs :=
|
2017-12-04 23:44:16 +01:00
|
|
|
|
|
|
|
my_installed_test_data := $(call copy-many-files,$(my_test_data_pairs))
|
|
|
|
$(LOCAL_INSTALLED_MODULE): $(my_installed_test_data)
|
|
|
|
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
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
|
2023-02-14 05:27:59 +01:00
|
|
|
|
|
|
|
ifneq (,$(LOCAL_FULL_TEST_CONFIG))
|
|
|
|
test_config := $(LOCAL_FULL_TEST_CONFIG)
|
|
|
|
else ifneq (,$(LOCAL_TEST_CONFIG))
|
|
|
|
test_config := $(LOCAL_PATH)/$(LOCAL_TEST_CONFIG)
|
|
|
|
else
|
|
|
|
test_config := $(wildcard $(LOCAL_PATH)/AndroidTest.xml)
|
|
|
|
endif
|
|
|
|
|
2020-04-13 21:16:19 +02:00
|
|
|
ifneq (true,$(LOCAL_UNINSTALLABLE_MODULE))
|
2017-02-09 00:53:32 +01:00
|
|
|
|
2017-04-04 21:47:19 +02:00
|
|
|
# If we are building a native test or benchmark and its stem variants are not defined,
|
|
|
|
# separate the multiple architectures into subdirectories of the testcase folder.
|
|
|
|
arch_dir :=
|
|
|
|
is_native :=
|
2018-01-08 21:25:18 +01:00
|
|
|
multi_arch :=
|
2017-04-04 21:47:19 +02:00
|
|
|
ifeq ($(LOCAL_MODULE_CLASS),NATIVE_TESTS)
|
|
|
|
is_native := true
|
2018-01-08 21:25:18 +01:00
|
|
|
multi_arch := true
|
2017-04-04 21:47:19 +02:00
|
|
|
endif
|
|
|
|
ifdef LOCAL_MULTILIB
|
2018-01-08 21:25:18 +01:00
|
|
|
multi_arch := true
|
2022-04-05 18:29:18 +02:00
|
|
|
# These conditionals allow this functionality to be mimicked in Soong
|
2022-03-30 18:46:32 +02:00
|
|
|
else ifeq ($(LOCAL_MODULE_MAKEFILE),$(SOONG_ANDROID_MK))
|
|
|
|
ifeq ($(LOCAL_MODULE_CLASS),SHARED_LIBRARIES)
|
|
|
|
multi_arch := true
|
|
|
|
endif
|
2017-04-04 21:47:19 +02:00
|
|
|
endif
|
2019-03-14 02:04:05 +01:00
|
|
|
|
2018-01-08 21:25:18 +01:00
|
|
|
ifdef multi_arch
|
2019-03-14 02:04:05 +01:00
|
|
|
arch_dir := /$($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)
|
|
|
|
else
|
|
|
|
ifeq ($(use_testcase_folder),true)
|
2017-04-04 21:47:19 +02:00
|
|
|
arch_dir := /$($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)
|
|
|
|
endif
|
2019-03-14 02:04:05 +01:00
|
|
|
endif
|
|
|
|
|
2018-01-08 21:25:18 +01:00
|
|
|
multi_arch :=
|
2017-04-04 21:47:19 +02:00
|
|
|
|
2019-03-19 09:00:45 +01:00
|
|
|
my_default_test_module :=
|
|
|
|
my_default_test_module := $($(my_prefix)OUT_TESTCASES)/$(LOCAL_MODULE)$(arch_dir)/$(my_installed_module_stem)
|
|
|
|
ifneq ($(LOCAL_INSTALLED_MODULE),$(my_default_test_module))
|
|
|
|
# Install into the testcase folder
|
|
|
|
$(LOCAL_INSTALLED_MODULE) : $(my_default_test_module)
|
|
|
|
endif
|
|
|
|
|
2015-10-21 03:18:40 +02:00
|
|
|
# The module itself.
|
2017-02-17 03:04:10 +01:00
|
|
|
$(foreach suite, $(LOCAL_COMPATIBILITY_SUITE), \
|
2021-11-03 21:15:59 +01:00
|
|
|
$(eval my_compat_dist_$(suite) := $(patsubst %:$(LOCAL_INSTALLED_MODULE),$(LOCAL_INSTALLED_MODULE):$(LOCAL_INSTALLED_MODULE),\
|
|
|
|
$(foreach dir, $(call compatibility_suite_dirs,$(suite),$(arch_dir)), \
|
|
|
|
$(LOCAL_BUILT_MODULE):$(dir)/$(my_installed_module_stem)))) \
|
2018-06-25 07:47:53 +02:00
|
|
|
$(eval my_compat_dist_config_$(suite) := ))
|
2015-10-21 03:18:40 +02:00
|
|
|
|
|
|
|
|
2018-08-23 17:04:37 +02:00
|
|
|
# Auto-generate build config.
|
|
|
|
ifeq (,$(test_config))
|
|
|
|
ifneq (true,$(is_native))
|
|
|
|
is_instrumentation_test := true
|
|
|
|
ifeq (true, $(LOCAL_IS_HOST_MODULE))
|
|
|
|
is_instrumentation_test := false
|
|
|
|
endif
|
|
|
|
# If LOCAL_MODULE_CLASS is not APPS, it's certainly not an instrumentation
|
|
|
|
# test. However, some packages for test data also have LOCAL_MODULE_CLASS
|
|
|
|
# set to APPS. These will require flag LOCAL_DISABLE_AUTO_GENERATE_TEST_CONFIG
|
|
|
|
# to disable auto-generating test config file.
|
|
|
|
ifneq (APPS, $(LOCAL_MODULE_CLASS))
|
|
|
|
is_instrumentation_test := false
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
# CTS modules can be used for test data, so test config files must be
|
|
|
|
# explicitly created using AndroidTest.xml
|
|
|
|
ifeq (,$(filter cts, $(LOCAL_COMPATIBILITY_SUITE)))
|
|
|
|
ifneq (true, $(LOCAL_DISABLE_AUTO_GENERATE_TEST_CONFIG))
|
|
|
|
ifeq (true, $(filter true,$(is_native) $(is_instrumentation_test)))
|
|
|
|
include $(BUILD_SYSTEM)/autogen_test_config.mk
|
|
|
|
test_config := $(autogen_test_config_file)
|
|
|
|
autogen_test_config_file :=
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
is_instrumentation_test :=
|
|
|
|
|
2021-05-27 19:19:48 +02:00
|
|
|
# Currently this flag variable is true only for the `android_test_helper_app` type module
|
|
|
|
# which should not have any .config file
|
|
|
|
ifeq (true, $(LOCAL_DISABLE_TEST_CONFIG))
|
|
|
|
test_config :=
|
|
|
|
endif
|
|
|
|
|
2018-07-13 16:55:36 +02:00
|
|
|
# Make sure we only add the files once for multilib modules.
|
|
|
|
ifdef $(my_prefix)$(LOCAL_MODULE_CLASS)_$(LOCAL_MODULE)_compat_files
|
|
|
|
# Sync the auto_test_config value for multilib modules.
|
|
|
|
ifdef $(my_prefix)$(LOCAL_MODULE_CLASS)_$(LOCAL_MODULE)_autogen
|
|
|
|
ALL_MODULES.$(my_register_name).auto_test_config := true
|
2017-12-07 00:57:31 +01:00
|
|
|
endif
|
2018-07-13 16:55:36 +02:00
|
|
|
else
|
|
|
|
$(my_prefix)$(LOCAL_MODULE_CLASS)_$(LOCAL_MODULE)_compat_files := true
|
|
|
|
# LOCAL_COMPATIBILITY_SUPPORT_FILES is a list of <src>[:<dest>].
|
|
|
|
$(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)))))
|
2017-12-07 00:57:31 +01:00
|
|
|
|
2018-07-13 16:55:36 +02:00
|
|
|
ifneq (,$(test_config))
|
|
|
|
$(foreach suite, $(LOCAL_COMPATIBILITY_SUITE), \
|
|
|
|
$(eval my_compat_dist_config_$(suite) += $(foreach dir, $(call compatibility_suite_dirs,$(suite)), \
|
|
|
|
$(test_config):$(dir)/$(LOCAL_MODULE).config)))
|
|
|
|
endif
|
2015-06-03 21:43:50 +02:00
|
|
|
|
2020-08-15 21:27:42 +02:00
|
|
|
ifneq (,$(LOCAL_EXTRA_FULL_TEST_CONFIGS))
|
|
|
|
$(foreach test_config_file, $(LOCAL_EXTRA_FULL_TEST_CONFIGS), \
|
|
|
|
$(foreach suite, $(LOCAL_COMPATIBILITY_SUITE), \
|
|
|
|
$(eval my_compat_dist_config_$(suite) += $(foreach dir, $(call compatibility_suite_dirs,$(suite)), \
|
2020-09-17 00:51:28 +02:00
|
|
|
$(test_config_file):$(dir)/$(basename $(notdir $(test_config_file))).config))))
|
2020-08-15 21:27:42 +02:00
|
|
|
endif
|
|
|
|
|
2018-07-13 16:55:36 +02:00
|
|
|
ifneq (,$(wildcard $(LOCAL_PATH)/DynamicConfig.xml))
|
|
|
|
$(foreach suite, $(LOCAL_COMPATIBILITY_SUITE), \
|
|
|
|
$(eval my_compat_dist_config_$(suite) += $(foreach dir, $(call compatibility_suite_dirs,$(suite)), \
|
|
|
|
$(LOCAL_PATH)/DynamicConfig.xml:$(dir)/$(LOCAL_MODULE).dynamic)))
|
|
|
|
endif
|
2017-04-20 01:10:45 +02:00
|
|
|
|
2018-07-13 16:55:36 +02:00
|
|
|
ifneq (,$(wildcard $(LOCAL_PATH)/$(LOCAL_MODULE)_*.config))
|
|
|
|
$(foreach extra_config, $(wildcard $(LOCAL_PATH)/$(LOCAL_MODULE)_*.config), \
|
|
|
|
$(foreach suite, $(LOCAL_COMPATIBILITY_SUITE), \
|
|
|
|
$(eval my_compat_dist_config_$(suite) += $(foreach dir, $(call compatibility_suite_dirs,$(suite)), \
|
|
|
|
$(extra_config):$(dir)/$(notdir $(extra_config))))))
|
|
|
|
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
|
|
|
|
2019-09-13 21:02:46 +02:00
|
|
|
|
|
|
|
ifeq ($(use_testcase_folder),true)
|
|
|
|
ifneq ($(my_test_data_file_pairs),)
|
2020-03-13 23:51:54 +01:00
|
|
|
# Filter out existng installed test data paths when collecting test data files to be installed and
|
|
|
|
# indexed as they cause build rule conflicts. Instead put them in a separate list which is only
|
|
|
|
# used for indexing.
|
2019-09-13 21:02:46 +02:00
|
|
|
$(foreach pair, $(my_test_data_file_pairs), \
|
|
|
|
$(eval parts := $(subst :,$(space),$(pair))) \
|
|
|
|
$(eval src_path := $(word 1,$(parts))) \
|
|
|
|
$(eval file := $(word 2,$(parts))) \
|
|
|
|
$(foreach suite, $(LOCAL_COMPATIBILITY_SUITE), \
|
|
|
|
$(eval my_compat_dist_$(suite) += $(foreach dir, $(call compatibility_suite_dirs,$(suite),$(arch_dir)), \
|
2020-03-13 23:51:54 +01:00
|
|
|
$(call filter-copy-pair,$(src_path),$(call append-path,$(dir),$(file)),$(my_installed_test_data)))) \
|
|
|
|
$(eval my_compat_dist_test_data_$(suite) += \
|
|
|
|
$(foreach dir, $(call compatibility_suite_dirs,$(suite),$(arch_dir)), \
|
|
|
|
$(filter $(my_installed_test_data),$(call append-path,$(dir),$(file)))))))
|
2019-09-13 21:02:46 +02:00
|
|
|
endif
|
|
|
|
else
|
2017-12-04 23:44:16 +01:00
|
|
|
ifneq ($(my_test_data_file_pairs),)
|
|
|
|
$(foreach pair, $(my_test_data_file_pairs), \
|
|
|
|
$(eval parts := $(subst :,$(space),$(pair))) \
|
|
|
|
$(eval src_path := $(word 1,$(parts))) \
|
|
|
|
$(eval file := $(word 2,$(parts))) \
|
|
|
|
$(foreach suite, $(LOCAL_COMPATIBILITY_SUITE), \
|
|
|
|
$(eval my_compat_dist_$(suite) += $(foreach dir, $(call compatibility_suite_dirs,$(suite),$(arch_dir)), \
|
|
|
|
$(src_path):$(call append-path,$(dir),$(file))))))
|
|
|
|
endif
|
2019-09-13 21:02:46 +02:00
|
|
|
endif
|
2019-03-14 02:04:05 +01:00
|
|
|
|
|
|
|
|
2017-12-04 23:44:16 +01:00
|
|
|
|
2018-01-27 01:57:57 +01:00
|
|
|
arch_dir :=
|
|
|
|
is_native :=
|
|
|
|
|
2017-02-17 03:04:10 +01:00
|
|
|
$(call create-suite-dependencies)
|
2018-06-25 07:47:53 +02:00
|
|
|
$(foreach suite, $(LOCAL_COMPATIBILITY_SUITE), \
|
2020-03-13 23:51:54 +01:00
|
|
|
$(eval my_compat_dist_config_$(suite) := ) \
|
|
|
|
$(eval my_compat_dist_test_data_$(suite) := ))
|
2015-06-03 21:43:50 +02:00
|
|
|
|
2020-04-13 21:16:19 +02:00
|
|
|
endif # LOCAL_UNINSTALLABLE_MODULE
|
2023-02-14 05:27:59 +01:00
|
|
|
|
|
|
|
# HACK: pretend a soong LOCAL_FULL_TEST_CONFIG is autogenerated by setting the flag in
|
|
|
|
# module-info.json
|
|
|
|
# TODO: (b/113029686) Add explicit flag from Soong to determine if a test was
|
|
|
|
# autogenerated.
|
|
|
|
ifneq (,$(filter $(SOONG_OUT_DIR)%,$(LOCAL_FULL_TEST_CONFIG)))
|
|
|
|
ifeq ($(LOCAL_MODULE_MAKEFILE),$(SOONG_ANDROID_MK))
|
|
|
|
ALL_MODULES.$(my_register_name).auto_test_config := true
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2015-06-03 21:43:50 +02:00
|
|
|
endif # LOCAL_COMPATIBILITY_SUITE
|
|
|
|
|
2022-02-18 08:27:53 +01:00
|
|
|
my_supported_variant :=
|
|
|
|
ifeq ($(my_host_cross),true)
|
|
|
|
my_supported_variant := HOST_CROSS
|
|
|
|
else
|
|
|
|
ifdef LOCAL_IS_HOST_MODULE
|
|
|
|
my_supported_variant := HOST
|
|
|
|
else
|
|
|
|
my_supported_variant := DEVICE
|
|
|
|
endif
|
|
|
|
endif
|
2018-04-13 23:39:53 +02:00
|
|
|
###########################################################
|
|
|
|
## Add test module to ALL_DISABLED_PRESUBMIT_TESTS if LOCAL_PRESUBMIT_DISABLED is set to true.
|
|
|
|
###########################################################
|
|
|
|
ifeq ($(LOCAL_PRESUBMIT_DISABLED),true)
|
|
|
|
ALL_DISABLED_PRESUBMIT_TESTS += $(LOCAL_MODULE)
|
|
|
|
endif # LOCAL_PRESUBMIT_DISABLED
|
|
|
|
|
2009-03-04 04:28:42 +01:00
|
|
|
###########################################################
|
|
|
|
## Register with ALL_MODULES
|
|
|
|
###########################################################
|
|
|
|
|
2019-08-27 08:25:17 +02:00
|
|
|
ifndef ALL_MODULES.$(my_register_name).PATH
|
2019-04-02 23:43:32 +02:00
|
|
|
# These keys are no longer used, they've been replaced by keys that specify
|
|
|
|
# target/host/host_cross (REQUIRED_FROM_TARGET / REQUIRED_FROM_HOST) and similar.
|
|
|
|
#
|
|
|
|
# Marking them obsolete to ensure that anyone using these internal variables looks for
|
|
|
|
# alternates.
|
|
|
|
$(KATI_obsolete_var ALL_MODULES.$(my_register_name).REQUIRED)
|
|
|
|
$(KATI_obsolete_var ALL_MODULES.$(my_register_name).EXPLICITLY_REQUIRED)
|
|
|
|
$(KATI_obsolete_var ALL_MODULES.$(my_register_name).HOST_REQUIRED)
|
|
|
|
$(KATI_obsolete_var ALL_MODULES.$(my_register_name).TARGET_REQUIRED)
|
|
|
|
endif
|
|
|
|
|
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)
|
2023-01-05 02:13:47 +01:00
|
|
|
ALL_MODULES.$(my_register_name).SOONG_MODULE_TYPE := \
|
|
|
|
$(ALL_MODULES.$(my_register_name).SOONG_MODULE_TYPE) $(LOCAL_SOONG_MODULE_TYPE)
|
2019-01-19 04:37:47 +01:00
|
|
|
ifndef LOCAL_IS_HOST_MODULE
|
|
|
|
ALL_MODULES.$(my_register_name).TARGET_BUILT := \
|
|
|
|
$(ALL_MODULES.$(my_register_name).TARGET_BUILT) $(LOCAL_BUILT_MODULE)
|
|
|
|
endif
|
2021-09-25 00:48:03 +02:00
|
|
|
ifneq (,$(LOCAL_SOONG_INSTALLED_MODULE))
|
|
|
|
# Store the list of paths to installed locations of files provided by this
|
|
|
|
# module. Used as dependencies of the image packaging rules when the module
|
|
|
|
# is installed by the current product.
|
|
|
|
ALL_MODULES.$(my_register_name).INSTALLED := \
|
|
|
|
$(strip $(ALL_MODULES.$(my_register_name).INSTALLED) \
|
|
|
|
$(foreach f, $(LOCAL_SOONG_INSTALL_PAIRS),\
|
|
|
|
$(word 2,$(subst :,$(space),$(f)))) \
|
|
|
|
$(LOCAL_SOONG_INSTALL_SYMLINKS) \
|
|
|
|
$(my_init_rc_installed) \
|
|
|
|
$(my_installed_test_data) \
|
|
|
|
$(my_vintf_installed))
|
2023-08-21 20:47:39 +02:00
|
|
|
|
|
|
|
ALL_MODULES.$(my_register_name).INSTALLED_SYMLINKS := $(LOCAL_SOONG_INSTALL_SYMLINKS)
|
|
|
|
|
2021-09-25 00:48:03 +02:00
|
|
|
# Store the list of colon-separated pairs of the built and installed locations
|
|
|
|
# of files provided by this module. Used by custom packaging rules like
|
|
|
|
# package-modules.mk that need to copy the built files to a custom install
|
|
|
|
# location during packaging.
|
2021-11-15 22:15:22 +01:00
|
|
|
#
|
|
|
|
# Translate copies from $(LOCAL_PREBUILT_MODULE_FILE) to $(LOCAL_BUILT_MODULE)
|
|
|
|
# so that package-modules.mk gets any transtive dependencies added to
|
|
|
|
# $(LOCAL_BUILT_MODULE), for example unstripped symbols files.
|
2021-09-25 00:48:03 +02:00
|
|
|
ALL_MODULES.$(my_register_name).BUILT_INSTALLED := \
|
|
|
|
$(strip $(ALL_MODULES.$(my_register_name).BUILT_INSTALLED) \
|
2021-11-15 22:15:22 +01:00
|
|
|
$(patsubst $(LOCAL_PREBUILT_MODULE_FILE):%,$(LOCAL_BUILT_MODULE):%,$(LOCAL_SOONG_INSTALL_PAIRS)) \
|
2021-09-25 00:48:03 +02:00
|
|
|
$(my_init_rc_pairs) \
|
|
|
|
$(my_test_data_pairs) \
|
|
|
|
$(my_vintf_pairs))
|
Do not install required modules from order-only deps
When a vintf_fragments or init_rc file is shared by two modules,
unintended modules are installed due to the shared file.
This was caused by add-all-target-to-target-required-modules-deps.
With the following definitions:
cc_binary {
name: "foo",
vintf_fragments: ["shared.xml"],
required: ["foo-req"],
}
cc_binary {
name: "bar",
vintf_fragments: ["shared.xml"],
}
When installing "bar", surprisingly, "foo-req" is installed due to the
link between "shared.xml" and "foo-req" added by
add-all-target-to-target-required-modules-deps.
To fix that, in this change, vintf_fragments and init_rc files are
marked as "order-only" deps. In
add-all-target-to-target-required-modules-deps, order-only deps are not
used to add links to "required" modules.
Now, with the same definitions, installing "bar" won't installs
"foo-req".
Bug: 198818343
Test: (see above)
Change-Id: I16be0dcb84564c559cb2f4223e2812321ee14729
2023-07-05 09:00:36 +02:00
|
|
|
# Store the list of vintf/init_rc as order-only dependencies
|
|
|
|
ALL_MODULES.$(my_register_name).ORDERONLY_INSTALLED := \
|
|
|
|
$(strip $(ALL_MODULES.$(my_register_name).ORDERONLY_INSTALLED) \
|
|
|
|
$(my_init_rc_installed) \
|
|
|
|
$(my_vintf_installed))
|
2021-09-25 00:48:03 +02:00
|
|
|
else ifneq (true,$(LOCAL_UNINSTALLABLE_MODULE))
|
|
|
|
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) \
|
2018-04-05 00:41:05 +02:00
|
|
|
$(my_installed_test_data) $(my_vintf_installed))
|
2021-09-25 00:48:03 +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) \
|
2018-04-05 00:41:05 +02:00
|
|
|
$(my_init_rc_pairs) $(my_test_data_pairs) $(my_vintf_pairs))
|
Do not install required modules from order-only deps
When a vintf_fragments or init_rc file is shared by two modules,
unintended modules are installed due to the shared file.
This was caused by add-all-target-to-target-required-modules-deps.
With the following definitions:
cc_binary {
name: "foo",
vintf_fragments: ["shared.xml"],
required: ["foo-req"],
}
cc_binary {
name: "bar",
vintf_fragments: ["shared.xml"],
}
When installing "bar", surprisingly, "foo-req" is installed due to the
link between "shared.xml" and "foo-req" added by
add-all-target-to-target-required-modules-deps.
To fix that, in this change, vintf_fragments and init_rc files are
marked as "order-only" deps. In
add-all-target-to-target-required-modules-deps, order-only deps are not
used to add links to "required" modules.
Now, with the same definitions, installing "bar" won't installs
"foo-req".
Bug: 198818343
Test: (see above)
Change-Id: I16be0dcb84564c559cb2f4223e2812321ee14729
2023-07-05 09:00:36 +02:00
|
|
|
ALL_MODULES.$(my_register_name).ORDERONLY_INSTALLED := \
|
|
|
|
$(strip $(ALL_MODULES.$(my_register_name).ORDERONLY_INSTALLED) \
|
|
|
|
$(my_init_rc_installed) \
|
|
|
|
$(my_vintf_installed))
|
2014-05-19 22:03:36 +02:00
|
|
|
endif
|
2023-09-02 01:15:00 +02:00
|
|
|
|
|
|
|
# Mark LOCAL_SOONG_INSTALL_SYMLINKS as installed if we're installing any kind of module, not just
|
|
|
|
# ones that set LOCAL_SOONG_INSTALLED_MODULE. This is so we can have a soong module that only
|
|
|
|
# installs symlinks (e.g. installed_symlink). We can't set LOCAL_SOONG_INSTALLED_MODULE to a symlink
|
|
|
|
# because cp commands will fail on symlinks.
|
|
|
|
ifneq (,$(or $(LOCAL_SOONG_INSTALLED_MODULE),$(call boolean-not,$(LOCAL_UNINSTALLABLE_MODULE))))
|
|
|
|
ALL_MODULES.$(my_register_name).INSTALLED += $(LOCAL_SOONG_INSTALL_SYMLINKS)
|
|
|
|
ALL_MODULES.$(my_register_name).INSTALLED_SYMLINKS := $(LOCAL_SOONG_INSTALL_SYMLINKS)
|
|
|
|
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
|
2020-05-04 13:12:00 +02:00
|
|
|
# Record the platform availability of this module. Note that the availability is not
|
|
|
|
# meaningful for non-installable modules (e.g., static libs) or host modules.
|
|
|
|
# We only care about modules that are installable to the device.
|
|
|
|
ifeq (true,$(LOCAL_NOT_AVAILABLE_FOR_PLATFORM))
|
|
|
|
ifneq (true,$(LOCAL_UNINSTALLABLE_MODULE))
|
|
|
|
ifndef LOCAL_IS_HOST_MODULE
|
|
|
|
ALL_MODULES.$(my_register_name).NOT_AVAILABLE_FOR_PLATFORM := true
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endif
|
2017-12-19 10:46:55 +01:00
|
|
|
|
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
|
2017-12-19 10:46:55 +01:00
|
|
|
|
2021-10-13 10:25:35 +02:00
|
|
|
ALL_MODULES.$(my_register_name).SHARED_LIBS := \
|
|
|
|
$(ALL_MODULES.$(my_register_name).SHARED_LIBS) $(LOCAL_SHARED_LIBRARIES)
|
|
|
|
|
2023-05-15 20:08:30 +02:00
|
|
|
ALL_MODULES.$(my_register_name).STATIC_LIBS := \
|
|
|
|
$(ALL_MODULES.$(my_register_name).STATIC_LIBS) $(LOCAL_STATIC_LIBRARIES)
|
|
|
|
|
2021-10-13 10:25:35 +02:00
|
|
|
ALL_MODULES.$(my_register_name).SYSTEM_SHARED_LIBS := \
|
|
|
|
$(ALL_MODULES.$(my_register_name).SYSTEM_SHARED_LIBS) $(LOCAL_SYSTEM_SHARED_LIBRARIES)
|
|
|
|
|
2022-02-08 09:59:21 +01:00
|
|
|
ALL_MODULES.$(my_register_name).LOCAL_RUNTIME_LIBRARIES := \
|
2022-08-31 11:46:13 +02:00
|
|
|
$(ALL_MODULES.$(my_register_name).LOCAL_RUNTIME_LIBRARIES) $(LOCAL_RUNTIME_LIBRARIES) \
|
|
|
|
$(LOCAL_JAVA_LIBRARIES)
|
|
|
|
|
|
|
|
ALL_MODULES.$(my_register_name).LOCAL_STATIC_LIBRARIES := \
|
|
|
|
$(ALL_MODULES.$(my_register_name).LOCAL_STATIC_LIBRARIES) $(LOCAL_STATIC_JAVA_LIBRARIES)
|
2022-02-08 09:59:21 +01:00
|
|
|
|
2021-12-21 11:59:33 +01:00
|
|
|
ifdef LOCAL_TEST_DATA
|
|
|
|
# Export the list of targets that are handled as data inputs and required
|
|
|
|
# by tests at runtime. The LOCAL_TEST_DATA format is generated from below
|
|
|
|
# https://cs.android.com/android/platform/superproject/+/master:build/soong/android/androidmk.go;l=925-944;drc=master
|
|
|
|
# which format is like $(path):$(relative_file) but for module-info, only
|
|
|
|
# the string after ":" is needed.
|
|
|
|
ALL_MODULES.$(my_register_name).TEST_DATA := \
|
|
|
|
$(strip $(ALL_MODULES.$(my_register_name).TEST_DATA) \
|
|
|
|
$(foreach f, $(LOCAL_TEST_DATA),\
|
|
|
|
$(call word-colon,2,$(f))))
|
|
|
|
endif
|
|
|
|
|
2022-02-11 11:27:32 +01:00
|
|
|
ifdef LOCAL_TEST_DATA_BINS
|
|
|
|
ALL_MODULES.$(my_register_name).TEST_DATA_BINS := \
|
|
|
|
$(ALL_MODULES.$(my_register_name).TEST_DATA_BINS) $(LOCAL_TEST_DATA_BINS)
|
|
|
|
endif
|
|
|
|
|
2022-02-18 08:27:53 +01:00
|
|
|
ALL_MODULES.$(my_register_name).SUPPORTED_VARIANTS := \
|
|
|
|
$(ALL_MODULES.$(my_register_name).SUPPORTED_VARIANTS) \
|
|
|
|
$(filter-out $(ALL_MODULES.$(my_register_name).SUPPORTED_VARIANTS),$(my_supported_variant))
|
|
|
|
|
2023-06-29 23:34:18 +02:00
|
|
|
ALL_MODULES.$(my_register_name).ACONFIG_FILES := \
|
|
|
|
$(ALL_MODULES.$(my_register_name).ACONFIG_FILES) $(LOCAL_ACONFIG_FILES)
|
|
|
|
|
|
|
|
|
2022-08-31 07:02:36 +02:00
|
|
|
##########################################################################
|
|
|
|
## When compiling against API imported module, use API import stub
|
|
|
|
## libraries.
|
|
|
|
##########################################################################
|
|
|
|
ifneq ($(LOCAL_USE_VNDK),)
|
|
|
|
ifneq ($(LOCAL_MODULE_MAKEFILE),$(SOONG_ANDROID_MK))
|
|
|
|
apiimport_postfix := .apiimport
|
|
|
|
ifeq ($(LOCAL_USE_VNDK_PRODUCT),true)
|
|
|
|
apiimport_postfix := .apiimport.product
|
|
|
|
else
|
|
|
|
apiimport_postfix := .apiimport.vendor
|
|
|
|
endif
|
|
|
|
|
|
|
|
my_required_modules := $(foreach l,$(my_required_modules), \
|
|
|
|
$(if $(filter $(l), $(API_IMPORTED_SHARED_LIBRARIES)), $(l)$(apiimport_postfix), $(l)))
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2020-01-20 10:57:01 +01:00
|
|
|
##########################################################################
|
|
|
|
## When compiling against the VNDK, add the .vendor or .product suffix to
|
|
|
|
## required modules.
|
|
|
|
##########################################################################
|
2017-12-19 10:46:55 +01:00
|
|
|
ifneq ($(LOCAL_USE_VNDK),)
|
2020-01-20 10:57:01 +01:00
|
|
|
#####################################################
|
|
|
|
## Soong modules may be built three times, once for
|
|
|
|
## /system, once for /vendor and once for /product.
|
|
|
|
## If we're using the VNDK, switch all soong
|
|
|
|
## libraries over to the /vendor or /product variant.
|
|
|
|
#####################################################
|
2017-12-19 10:46:55 +01:00
|
|
|
ifneq ($(LOCAL_MODULE_MAKEFILE),$(SOONG_ANDROID_MK))
|
|
|
|
# We don't do this renaming for soong-defined modules since they already
|
2020-01-20 10:57:01 +01:00
|
|
|
# have correct names (with .vendor or .product suffix when necessary) in
|
|
|
|
# their LOCAL_*_LIBRARIES.
|
|
|
|
ifeq ($(LOCAL_USE_VNDK_PRODUCT),true)
|
|
|
|
my_required_modules := $(foreach l,$(my_required_modules),\
|
|
|
|
$(if $(SPLIT_PRODUCT.SHARED_LIBRARIES.$(l)),$(l).product,$(l)))
|
|
|
|
else
|
|
|
|
my_required_modules := $(foreach l,$(my_required_modules),\
|
|
|
|
$(if $(SPLIT_VENDOR.SHARED_LIBRARIES.$(l)),$(l).vendor,$(l)))
|
|
|
|
endif
|
2017-12-19 10:46:55 +01:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2019-04-02 23:43:32 +02:00
|
|
|
ifdef LOCAL_IS_HOST_MODULE
|
|
|
|
ifneq ($(my_host_cross),true)
|
|
|
|
ALL_MODULES.$(my_register_name).REQUIRED_FROM_HOST := \
|
|
|
|
$(strip $(ALL_MODULES.$(my_register_name).REQUIRED_FROM_HOST) $(my_required_modules))
|
|
|
|
ALL_MODULES.$(my_register_name).EXPLICITLY_REQUIRED_FROM_HOST := \
|
|
|
|
$(strip $(ALL_MODULES.$(my_register_name).EXPLICITLY_REQUIRED_FROM_HOST)\
|
|
|
|
$(my_required_modules))
|
|
|
|
ALL_MODULES.$(my_register_name).TARGET_REQUIRED_FROM_HOST := \
|
|
|
|
$(strip $(ALL_MODULES.$(my_register_name).TARGET_REQUIRED_FROM_HOST)\
|
|
|
|
$(LOCAL_TARGET_REQUIRED_MODULES))
|
|
|
|
else
|
|
|
|
ALL_MODULES.$(my_register_name).REQUIRED_FROM_HOST_CROSS := \
|
|
|
|
$(strip $(ALL_MODULES.$(my_register_name).REQUIRED_FROM_HOST_CROSS) $(my_required_modules))
|
|
|
|
ALL_MODULES.$(my_register_name).EXPLICITLY_REQUIRED_FROM_HOST_CROSS := \
|
|
|
|
$(strip $(ALL_MODULES.$(my_register_name).EXPLICITLY_REQUIRED_FROM_HOST_CROSS)\
|
|
|
|
$(my_required_modules))
|
|
|
|
ifdef LOCAL_TARGET_REQUIRED_MODULES
|
|
|
|
$(call pretty-error,LOCAL_TARGET_REQUIRED_MODULES may not be used from host_cross modules)
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
ifdef LOCAL_HOST_REQUIRED_MODULES
|
|
|
|
$(call pretty-error,LOCAL_HOST_REQUIRED_MODULES may not be used from host modules. Use LOCAL_REQUIRED_MODULES instead)
|
|
|
|
endif
|
|
|
|
else
|
|
|
|
ALL_MODULES.$(my_register_name).REQUIRED_FROM_TARGET := \
|
|
|
|
$(strip $(ALL_MODULES.$(my_register_name).REQUIRED_FROM_TARGET) $(my_required_modules))
|
|
|
|
ALL_MODULES.$(my_register_name).EXPLICITLY_REQUIRED_FROM_TARGET := \
|
|
|
|
$(strip $(ALL_MODULES.$(my_register_name).EXPLICITLY_REQUIRED_FROM_TARGET)\
|
|
|
|
$(my_required_modules))
|
|
|
|
ALL_MODULES.$(my_register_name).HOST_REQUIRED_FROM_TARGET := \
|
|
|
|
$(strip $(ALL_MODULES.$(my_register_name).HOST_REQUIRED_FROM_TARGET)\
|
|
|
|
$(LOCAL_HOST_REQUIRED_MODULES))
|
|
|
|
ifdef LOCAL_TARGET_REQUIRED_MODULES
|
|
|
|
$(call pretty-error,LOCAL_TARGET_REQUIRED_MODULES may not be used from target modules. Use LOCAL_REQUIRED_MODULES instead)
|
|
|
|
endif
|
|
|
|
endif
|
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)
|
2018-08-07 15:22:21 +02:00
|
|
|
ALL_MODULES.$(my_register_name).MODULE_NAME := $(LOCAL_MODULE)
|
2021-12-08 08:30:23 +01:00
|
|
|
ALL_MODULES.$(my_register_name).COMPATIBILITY_SUITES := \
|
|
|
|
$(ALL_MODULES.$(my_register_name).COMPATIBILITY_SUITES) \
|
|
|
|
$(filter-out $(ALL_MODULES.$(my_register_name).COMPATIBILITY_SUITES),$(LOCAL_COMPATIBILITY_SUITE))
|
2018-08-23 17:04:37 +02:00
|
|
|
ALL_MODULES.$(my_register_name).TEST_CONFIG := $(test_config)
|
2020-08-15 21:27:42 +02:00
|
|
|
ALL_MODULES.$(my_register_name).EXTRA_TEST_CONFIGS := $(LOCAL_EXTRA_FULL_TEST_CONFIGS)
|
2020-08-27 18:19:53 +02:00
|
|
|
ALL_MODULES.$(my_register_name).TEST_MAINLINE_MODULES := $(LOCAL_TEST_MAINLINE_MODULES)
|
2020-09-23 12:15:20 +02:00
|
|
|
ifndef LOCAL_IS_HOST_MODULE
|
|
|
|
ALL_MODULES.$(my_register_name).FILE_CONTEXTS := $(LOCAL_FILE_CONTEXTS)
|
|
|
|
endif
|
2021-04-19 14:30:17 +02:00
|
|
|
ifdef LOCAL_IS_UNIT_TEST
|
2021-01-08 10:36:56 +01:00
|
|
|
ALL_MODULES.$(my_register_name).IS_UNIT_TEST := $(LOCAL_IS_UNIT_TEST)
|
2021-04-19 14:30:17 +02:00
|
|
|
endif
|
2022-08-05 14:51:50 +02:00
|
|
|
ifdef LOCAL_TEST_OPTIONS_TAGS
|
|
|
|
ALL_MODULES.$(my_register_name).TEST_OPTIONS_TAGS := $(LOCAL_TEST_OPTIONS_TAGS)
|
|
|
|
endif
|
2018-08-23 17:04:37 +02:00
|
|
|
test_config :=
|
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.
|
2021-11-03 09:13:05 +01:00
|
|
|
# (b/204397180) Unlock RECORD_ALL_DEPS was acknowledged reasonable for better Atest performance.
|
2020-06-09 06:00:18 +02:00
|
|
|
ALL_DEPS.MODULES += $(LOCAL_MODULE)
|
2015-05-07 21:08:53 +02:00
|
|
|
ALL_DEPS.$(LOCAL_MODULE).ALL_DEPS := $(sort \
|
2019-06-05 22:10:29 +02:00
|
|
|
$(ALL_DEPS.$(LOCAL_MODULE).ALL_DEPS) \
|
2015-05-07 21:08:53 +02:00
|
|
|
$(LOCAL_STATIC_LIBRARIES) \
|
|
|
|
$(LOCAL_WHOLE_STATIC_LIBRARIES) \
|
|
|
|
$(LOCAL_SHARED_LIBRARIES) \
|
2019-08-27 20:23:35 +02:00
|
|
|
$(LOCAL_DYLIB_LIBRARIES) \
|
|
|
|
$(LOCAL_RLIB_LIBRARIES) \
|
|
|
|
$(LOCAL_PROC_MACRO_LIBRARIES) \
|
2017-02-16 00:48:11 +01:00
|
|
|
$(LOCAL_HEADER_LIBRARIES) \
|
2015-05-07 21:08:53 +02:00
|
|
|
$(LOCAL_STATIC_JAVA_LIBRARIES) \
|
2019-06-05 22:10:29 +02:00
|
|
|
$(LOCAL_JAVA_LIBRARIES) \
|
2015-05-07 21:08:53 +02:00
|
|
|
$(LOCAL_JNI_SHARED_LIBRARIES))
|
|
|
|
|
2020-06-09 06:00:18 +02:00
|
|
|
license_files := $(call find-parent-file,$(LOCAL_PATH),MODULE_LICENSE*)
|
2015-05-07 21:08:53 +02:00
|
|
|
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.
|
2019-08-27 09:49:31 +02:00
|
|
|
$(foreach tag,$(filter-out optional,$(my_module_tags)),\
|
2017-10-10 03:01:50 +02:00
|
|
|
$(eval ALL_MODULE_NAME_TAGS.$(tag) := $$(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 :=
|
2019-08-27 20:23:35 +02:00
|
|
|
ifneq (,$(filter EXECUTABLES SHARED_LIBRARIES STATIC_LIBRARIES HEADER_LIBRARIES NATIVE_TESTS RLIB_LIBRARIES DYLIB_LIBRARIES PROC_MACRO_LIBRARIES,$(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
|
2017-11-30 05:54:41 +01:00
|
|
|
$(j_or_n) $(h_or_t) $(j_or_n)-$(h_or_hc_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)
|
2018-06-18 06:54:21 +02:00
|
|
|
.PHONY: $(LOCAL_MODULE)-$(h_or_hc_or_t)
|
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 ($(j_or_n),native)
|
|
|
|
$(LOCAL_MODULE)-$(h_or_hc_or_t)$(my_32_64_bit_suffix) : $(my_all_targets)
|
2018-06-18 06:54:21 +02:00
|
|
|
.PHONY: $(LOCAL_MODULE)-$(h_or_hc_or_t)$(my_32_64_bit_suffix)
|
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
|
|
|
endif
|
2013-01-30 01:59:18 +01:00
|
|
|
endif
|
|
|
|
|
2017-09-19 13:51:45 +02:00
|
|
|
###########################################################
|
|
|
|
# Ensure privileged applications always have LOCAL_PRIVILEGED_MODULE
|
|
|
|
###########################################################
|
|
|
|
ifndef LOCAL_PRIVILEGED_MODULE
|
|
|
|
ifneq (,$(filter $(TARGET_OUT_APPS_PRIVILEGED)/% $(TARGET_OUT_VENDOR_APPS_PRIVILEGED)/%,$(my_module_path)))
|
|
|
|
LOCAL_PRIVILEGED_MODULE := true
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2009-03-04 04:28:42 +01:00
|
|
|
###########################################################
|
|
|
|
## NOTICE files
|
|
|
|
###########################################################
|
|
|
|
|
2012-11-02 01:22:33 +01:00
|
|
|
include $(BUILD_NOTICE_FILE)
|
2023-01-05 02:13:47 +01:00
|
|
|
|
|
|
|
###########################################################
|
|
|
|
## SBOM generation
|
|
|
|
###########################################################
|
2023-05-15 20:08:30 +02:00
|
|
|
include $(BUILD_SBOM_GEN)
|