2009-03-04 04:28:42 +01:00
|
|
|
###########################################################
|
|
|
|
## Track NOTICE files
|
|
|
|
###########################################################
|
2016-07-26 01:03:53 +02:00
|
|
|
$(call record-module-type,NOTICE_FILE)
|
2009-03-04 04:28:42 +01:00
|
|
|
|
2015-12-22 15:34:09 +01:00
|
|
|
ifneq ($(LOCAL_NOTICE_FILE),)
|
|
|
|
notice_file:=$(strip $(LOCAL_NOTICE_FILE))
|
|
|
|
else
|
2020-02-13 21:37:33 +01:00
|
|
|
notice_file:=$(strip $(wildcard $(LOCAL_PATH)/LICENSE $(LOCAL_PATH)/LICENCE $(LOCAL_PATH)/NOTICE))
|
2015-12-22 15:34:09 +01:00
|
|
|
endif
|
2009-03-04 04:28:42 +01:00
|
|
|
|
2021-01-07 04:34:31 +01:00
|
|
|
ifneq (,$(strip $(LOCAL_LICENSE_PACKAGE_NAME)))
|
|
|
|
license_package_name:=$(strip $(LOCAL_LICENSE_PACKAGE_NAME))
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq (,$(strip $(LOCAL_LICENSE_INSTALL_MAP)))
|
|
|
|
install_map:=$(strip $(LOCAL_LICENSE_INSTALL_MAP))
|
|
|
|
else
|
|
|
|
install_map:=
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq (,$(strip $(LOCAL_LICENSE_KINDS)))
|
|
|
|
license_kinds:=$(strip $(LOCAL_LICENSE_KINDS))
|
|
|
|
else
|
|
|
|
license_kinds:=legacy_by_exception_only
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq (,$(strip $(LOCAL_LICENSE_CONDITIONS)))
|
|
|
|
license_conditions:=$(strip $(LOCAL_LICENSE_CONDITIONS))
|
|
|
|
else
|
|
|
|
license_conditions:=by_exception_only
|
|
|
|
endif
|
|
|
|
|
2012-10-25 16:49:39 +02:00
|
|
|
ifeq ($(LOCAL_MODULE_CLASS),GYP)
|
|
|
|
# We ignore NOTICE files for modules of type GYP.
|
2012-06-27 02:07:19 +02:00
|
|
|
notice_file :=
|
|
|
|
endif
|
|
|
|
|
2018-04-11 20:42:26 +02:00
|
|
|
ifeq ($(LOCAL_MODULE_CLASS),FAKE)
|
|
|
|
# We ignore NOTICE files for modules of type FAKE.
|
|
|
|
notice_file :=
|
|
|
|
endif
|
|
|
|
|
2017-04-04 01:06:00 +02:00
|
|
|
# Soong generates stub libraries that don't need NOTICE files
|
|
|
|
ifdef LOCAL_NO_NOTICE_FILE
|
|
|
|
ifneq ($(LOCAL_MODULE_MAKEFILE),$(SOONG_ANDROID_MK))
|
|
|
|
$(call pretty-error,LOCAL_NO_NOTICE_FILE should not be used by Android.mk files)
|
|
|
|
endif
|
|
|
|
notice_file :=
|
|
|
|
endif
|
|
|
|
|
2012-11-02 01:22:33 +01:00
|
|
|
ifeq ($(LOCAL_MODULE_CLASS),NOTICE_FILES)
|
|
|
|
# If this is a NOTICE-only module, we don't include base_rule.mk,
|
|
|
|
# so my_prefix is not set at this point.
|
|
|
|
ifeq ($(LOCAL_IS_HOST_MODULE),true)
|
|
|
|
my_prefix := HOST_
|
2015-08-14 21:59:50 +02:00
|
|
|
LOCAL_HOST_PREFIX :=
|
2012-11-02 01:22:33 +01:00
|
|
|
else
|
|
|
|
my_prefix := TARGET_
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2019-04-03 17:59:49 +02:00
|
|
|
installed_notice_file :=
|
|
|
|
|
2021-01-07 04:34:31 +01:00
|
|
|
is_container:=$(strip $(LOCAL_MODULE_IS_CONTAINER))
|
|
|
|
ifeq (,$(is_container))
|
|
|
|
ifneq (,$(strip $(filter %.zip %.tar %.tgz %.tar.gz %.apk %.img %.srcszip %.apex, $(LOCAL_BUILT_MODULE))))
|
|
|
|
is_container:=true
|
|
|
|
else
|
|
|
|
is_container:=false
|
|
|
|
endif
|
|
|
|
else ifneq (,$(strip $(filter-out true false,$(is_container))))
|
|
|
|
$(error Unrecognized value '$(is_container)' for LOCAL_MODULE_IS_CONTAINER)
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq (true,$(is_container))
|
|
|
|
# Include shared libraries' notices for "container" types, but not for binaries etc.
|
|
|
|
notice_deps := \
|
2021-02-19 02:17:49 +01:00
|
|
|
$(strip \
|
2021-04-15 19:41:38 +02:00
|
|
|
$(foreach d, \
|
|
|
|
$(LOCAL_REQUIRED_MODULES) \
|
|
|
|
$(LOCAL_STATIC_LIBRARIES) \
|
|
|
|
$(LOCAL_WHOLE_STATIC_LIBRARIES) \
|
|
|
|
$(LOCAL_SHARED_LIBRARIES) \
|
|
|
|
$(LOCAL_DYLIB_LIBRARIES) \
|
|
|
|
$(LOCAL_RLIB_LIBRARIES) \
|
|
|
|
$(LOCAL_PROC_MACRO_LIBRARIES) \
|
|
|
|
$(LOCAL_HEADER_LIBRARIES) \
|
|
|
|
$(LOCAL_STATIC_JAVA_LIBRARIES) \
|
|
|
|
$(LOCAL_JAVA_LIBRARIES) \
|
|
|
|
$(LOCAL_JNI_SHARED_LIBRARIES) \
|
|
|
|
,$(subst :,_,$(d)):static \
|
|
|
|
) \
|
2021-01-07 04:34:31 +01:00
|
|
|
)
|
|
|
|
else
|
|
|
|
notice_deps := \
|
2021-02-19 02:17:49 +01:00
|
|
|
$(strip \
|
2021-04-15 19:41:38 +02:00
|
|
|
$(foreach d, \
|
|
|
|
$(LOCAL_REQUIRED_MODULES) \
|
|
|
|
$(LOCAL_STATIC_LIBRARIES) \
|
|
|
|
$(LOCAL_WHOLE_STATIC_LIBRARIES) \
|
|
|
|
$(LOCAL_RLIB_LIBRARIES) \
|
|
|
|
$(LOCAL_PROC_MACRO_LIBRARIES) \
|
|
|
|
$(LOCAL_HEADER_LIBRARIES) \
|
|
|
|
$(LOCAL_STATIC_JAVA_LIBRARIES) \
|
|
|
|
,$(subst :,_,$(d)):static \
|
|
|
|
)$(foreach d, \
|
|
|
|
$(LOCAL_SHARED_LIBRARIES) \
|
|
|
|
$(LOCAL_DYLIB_LIBRARIES) \
|
|
|
|
$(LOCAL_JAVA_LIBRARIES) \
|
|
|
|
$(LOCAL_JNI_SHARED_LIBRARIES) \
|
|
|
|
,$(subst :,_,$(d)):dynamic \
|
|
|
|
) \
|
2021-01-07 04:34:31 +01:00
|
|
|
)
|
|
|
|
endif
|
|
|
|
ifeq ($(LOCAL_IS_HOST_MODULE),true)
|
2021-04-15 19:41:38 +02:00
|
|
|
notice_deps := $(strip $(notice_deps) $(foreach d,$(LOCAL_HOST_REQUIRED_MODULES),$(subst :,_,$(d)):static))
|
2021-01-07 04:34:31 +01:00
|
|
|
else
|
2021-04-15 19:41:38 +02:00
|
|
|
notice_deps := $(strip $(notice_deps) $(foreach d,$(LOCAL_TARGET_REQUIRED_MODULES),$(subst :,_,$(d)):static))
|
2021-01-07 04:34:31 +01:00
|
|
|
endif
|
|
|
|
|
2021-04-15 19:41:38 +02:00
|
|
|
local_path := $(LOCAL_PATH)
|
|
|
|
|
2021-12-03 23:46:20 +01:00
|
|
|
|
|
|
|
module_license_metadata :=
|
|
|
|
|
2021-01-07 04:34:31 +01:00
|
|
|
ifdef my_register_name
|
2022-06-13 21:32:53 +02:00
|
|
|
module_license_metadata := $(call local-intermediates-dir)/$(my_register_name).meta_lic
|
2021-12-03 23:46:20 +01:00
|
|
|
|
2022-03-20 07:20:59 +01:00
|
|
|
$(foreach target,$(ALL_MODULES.$(my_register_name).BUILT) $(ALL_MODULES.$(my_register_name).INSTALLED) $(my_test_data) $(my_test_config),\
|
2021-12-03 23:46:20 +01:00
|
|
|
$(eval ALL_TARGETS.$(target).META_LIC := $(module_license_metadata)))
|
|
|
|
|
|
|
|
ALL_MODULES.$(my_register_name).META_LIC := $(strip $(ALL_MODULES.$(my_register_name).META_LIC) $(module_license_metadata))
|
|
|
|
|
2021-12-11 00:05:02 +01:00
|
|
|
ifdef LOCAL_SOONG_LICENSE_METADATA
|
|
|
|
# Soong modules have already produced a license metadata file, copy it to where Make expects it.
|
|
|
|
$(eval $(call copy-one-file, $(LOCAL_SOONG_LICENSE_METADATA), $(module_license_metadata)))
|
|
|
|
else
|
|
|
|
# Make modules don't have enough information to produce a license metadata rule until after fix-notice-deps
|
|
|
|
# has been called, store the necessary information until later.
|
|
|
|
ALL_MODULES.$(my_register_name).DELAYED_META_LIC := $(strip $(ALL_MODULES.$(my_register_name).DELAYED_META_LIC) $(module_license_metadata))
|
|
|
|
ALL_MODULES.$(my_register_name).LICENSE_PACKAGE_NAME := $(strip $(license_package_name))
|
|
|
|
ALL_MODULES.$(my_register_name).MODULE_TYPE := $(strip $(ALL_MODULES.$(my_register_name).MODULE_TYPE) $(LOCAL_MODULE_TYPE))
|
|
|
|
ALL_MODULES.$(my_register_name).MODULE_CLASS := $(strip $(ALL_MODULES.$(my_register_name).MODULE_CLASS) $(LOCAL_MODULE_CLASS))
|
|
|
|
ALL_MODULES.$(my_register_name).LICENSE_KINDS := $(ALL_MODULES.$(my_register_name).LICENSE_KINDS) $(license_kinds)
|
|
|
|
ALL_MODULES.$(my_register_name).LICENSE_CONDITIONS := $(ALL_MODULES.$(my_register_name).LICENSE_CONDITIONS) $(license_conditions)
|
|
|
|
ALL_MODULES.$(my_register_name).LICENSE_INSTALL_MAP := $(ALL_MODULES.$(my_register_name).LICENSE_INSTALL_MAP) $(install_map)
|
|
|
|
ALL_MODULES.$(my_register_name).NOTICE_DEPS := $(ALL_MODULES.$(my_register_name).NOTICE_DEPS) $(notice_deps)
|
|
|
|
ALL_MODULES.$(my_register_name).IS_CONTAINER := $(strip $(filter-out false,$(ALL_MODULES.$(my_register_name).IS_CONTAINER) $(is_container)))
|
|
|
|
ALL_MODULES.$(my_register_name).PATH := $(strip $(ALL_MODULES.$(my_register_name).PATH) $(local_path))
|
|
|
|
endif
|
2021-01-07 04:34:31 +01:00
|
|
|
endif
|
|
|
|
|
2011-03-29 14:27:27 +02:00
|
|
|
ifdef notice_file
|
2009-03-04 04:28:42 +01:00
|
|
|
|
2018-06-18 06:47:18 +02:00
|
|
|
ifdef my_register_name
|
2021-02-19 02:17:49 +01:00
|
|
|
ALL_MODULES.$(my_register_name).NOTICES := $(ALL_MODULES.$(my_register_name).NOTICES) $(notice_file)
|
2018-06-18 06:47:18 +02:00
|
|
|
endif
|
|
|
|
|
2019-04-03 17:59:49 +02:00
|
|
|
endif # notice_file
|