xref: /aosp_15_r20/build/make/core/os_licensing.mk (revision 9e94795a3d4ef5c1d47486f9a02bb378756cea8a)
1ifeq ($(TARGET_BUILD_APPS),)
2
3.PHONY: systemlicense
4systemlicense: $(call corresponding-license-metadata, $(SYSTEM_NOTICE_DEPS)) reportmissinglicenses
5
6ifneq (,$(SYSTEM_NOTICE_DEPS))
7
8SYSTEM_NOTICE_DEPS += $(UNMOUNTED_NOTICE_DEPS) $(UNMOUNTED_NOTICE_VENDOR_DEPS)
9
10ifneq ($(PRODUCT_NOTICE_SPLIT),true)
11$(eval $(call html-notice-rule,$(target_notice_file_html_gz),"System image",$(system_notice_file_message),$(SYSTEM_NOTICE_DEPS),$(SYSTEM_NOTICE_DEPS)))
12
13$(installed_notice_html_or_xml_gz): $(target_notice_file_html_gz)
14	$(copy-file-to-target)
15else
16$(eval $(call xml-notice-rule,$(target_notice_file_xml_gz),"System image",$(system_notice_file_message),$(SYSTEM_NOTICE_DEPS),$(SYSTEM_NOTICE_DEPS)))
17
18$(eval $(call text-notice-rule,$(target_notice_file_txt),"System image",$(system_notice_file_message),$(SYSTEM_NOTICE_DEPS),$(SYSTEM_NOTICE_DEPS)))
19
20ifneq ($(USE_SOONG_DEFINED_SYSTEM_IMAGE),true)
21$(installed_notice_html_or_xml_gz): $(target_notice_file_xml_gz)
22	$(copy-file-to-target)
23endif
24endif
25
26$(call declare-1p-target,$(target_notice_file_xml_gz))
27ifneq ($(USE_SOONG_DEFINED_SYSTEM_IMAGE),true)
28$(call declare-1p-target,$(installed_notice_html_or_xml_gz))
29endif
30endif
31
32.PHONY: vendorlicense
33vendorlicense: $(call corresponding-license-metadata, $(VENDOR_NOTICE_DEPS)) reportmissinglicenses
34
35ifneq (,$(VENDOR_NOTICE_DEPS))
36
37VENDOR_NOTICE_DEPS += $(UNMOUNTED_NOTICE_VENDOR_DEPS)
38
39$(eval $(call text-notice-rule,$(target_vendor_notice_file_txt),"Vendor image", \
40         "Notices for files contained in all filesystem images except system/system_ext/product/odm/vendor_dlkm/odm_dlkm in this directory:", \
41         $(VENDOR_NOTICE_DEPS),$(VENDOR_NOTICE_DEPS)))
42
43$(eval $(call xml-notice-rule,$(target_vendor_notice_file_xml_gz),"Vendor image", \
44         "Notices for files contained in all filesystem images except system/system_ext/product/odm/vendor_dlkm/odm_dlkm in this directory:", \
45         $(VENDOR_NOTICE_DEPS),$(VENDOR_NOTICE_DEPS)))
46
47$(installed_vendor_notice_xml_gz): $(target_vendor_notice_file_xml_gz)
48	$(copy-file-to-target)
49
50$(call declare-1p-target,$(target_vendor_notice_file_xml_gz))
51$(call declare-1p-target,$(installed_vendor_notice_xml_gz))
52endif
53
54.PHONY: odmlicense
55odmlicense: $(call corresponding-license-metadata, $(ODM_NOTICE_DEPS)) reportmissinglicenses
56
57ifneq (,$(ODM_NOTICE_DEPS))
58$(eval $(call text-notice-rule,$(target_odm_notice_file_txt),"ODM filesystem image", \
59         "Notices for files contained in the odm filesystem image in this directory:", \
60         $(ODM_NOTICE_DEPS),$(ODM_NOTICE_DEPS)))
61
62$(eval $(call xml-notice-rule,$(target_odm_notice_file_xml_gz),"ODM filesystem image", \
63         "Notices for files contained in the odm filesystem image in this directory:", \
64         $(ODM_NOTICE_DEPS),$(ODM_NOTICE_DEPS)))
65
66$(installed_odm_notice_xml_gz): $(target_odm_notice_file_xml_gz)
67	$(copy-file-to-target)
68
69$(call declare-1p-target,$(target_odm_notice_file_xml_gz))
70$(call declare-1p-target,$(installed_odm_notice_xml_gz))
71endif
72
73.PHONY: oemlicense
74oemlicense: $(call corresponding-license-metadata, $(OEM_NOTICE_DEPS)) reportmissinglicenses
75
76.PHONY: productlicense
77productlicense: $(call corresponding-license-metadata, $(PRODUCT_NOTICE_DEPS)) reportmissinglicenses
78
79ifneq (,$(PRODUCT_NOTICE_DEPS))
80$(eval $(call text-notice-rule,$(target_product_notice_file_txt),"Product image", \
81         "Notices for files contained in the product filesystem image in this directory:", \
82         $(PRODUCT_NOTICE_DEPS),$(PRODUCT_NOTICE_DEPS)))
83
84$(eval $(call xml-notice-rule,$(target_product_notice_file_xml_gz),"Product image", \
85         "Notices for files contained in the product filesystem image in this directory:", \
86         $(PRODUCT_NOTICE_DEPS),$(PRODUCT_NOTICE_DEPS)))
87
88$(installed_product_notice_xml_gz): $(target_product_notice_file_xml_gz)
89	$(copy-file-to-target)
90
91$(call declare-1p-target,$(target_product_notice_file_xml_gz))
92$(call declare-1p-target,$(installed_product_notice_xml_gz))
93endif
94
95.PHONY: systemextlicense
96systemextlicense: $(call corresponding-license-metadata, $(SYSTEM_EXT_NOTICE_DEPS)) reportmissinglicenses
97
98ifneq (,$(SYSTEM_EXT_NOTICE_DEPS))
99$(eval $(call text-notice-rule,$(target_system_ext_notice_file_txt),"System_ext image", \
100         "Notices for files contained in the system_ext filesystem image in this directory:", \
101         $(SYSTEM_EXT_NOTICE_DEPS),$(SYSTEM_EXT_NOTICE_DEPS)))
102
103$(eval $(call xml-notice-rule,$(target_system_ext_notice_file_xml_gz),"System_ext image", \
104         "Notices for files contained in the system_ext filesystem image in this directory:", \
105         $(SYSTEM_EXT_NOTICE_DEPS),$(SYSTEM_EXT_NOTICE_DEPS)))
106
107$(installed_system_ext_notice_xml_gz): $(target_system_ext_notice_file_xml_gz)
108	$(copy-file-to-target)
109
110$(call declare-1p-target,$(target_system_ext_notice_file_xml_gz))
111$(call declare-1p-target,$(installed_system_ext_notice_xml_gz))
112endif
113
114.PHONY: vendor_dlkmlicense
115vendor_dlkmlicense: $(call corresponding-license-metadata, $(VENDOR_DLKM_NOTICE_DEPS)) reportmissinglicenses
116
117ifneq (,$(VENDOR_DLKM_NOTICE_DEPS))
118$(eval $(call text-notice-rule,$(target_vendor_dlkm_notice_file_txt),"Vendor_dlkm image", \
119         "Notices for files contained in the vendor_dlkm filesystem image in this directory:", \
120         $(VENDOR_DLKM_NOTICE_DEPS),$(VENDOR_DLKM_NOTICE_DEPS)))
121
122$(eval $(call xml-notice-rule,$(target_vendor_dlkm_notice_file_xml_gz),"Vendor_dlkm image", \
123         "Notices for files contained in the vendor_dlkm filesystem image in this directory:", \
124         $(VENDOR_DLKM_NOTICE_DEPS),$(VENDOR_DLKM_NOTICE_DEPS)))
125
126$(installed_vendor_dlkm_notice_xml_gz): $(target_vendor_dlkm_notice_file_xml_gz)
127	$(copy-file-to-target)
128
129$(call declare-1p-target,$(target_vendor_dlkm_notice_file_xml_gz))
130$(call declare-1p-target,$(installed_vendor_dlkm_notice_xml_gz))
131endif
132
133.PHONY: odm_dlkmlicense
134odm_dlkmlicense: $(call corresponding-license-metadata, $(ODM_DLKM_NOTICE_DEPS)) reportmissinglicenses
135
136ifneq (,$(ODM_DLKM_NOTICE_DEPS))
137$(eval $(call text-notice-rule,$(target_odm_dlkm_notice_file_txt),"ODM_dlkm filesystem image", \
138         "Notices for files contained in the odm_dlkm filesystem image in this directory:", \
139         $(ODM_DLKM_NOTICE_DEPS),$(ODM_DLKM_NOTICE_DEPS)))
140
141$(eval $(call xml-notice-rule,$(target_odm_dlkm_notice_file_xml_gz),"ODM_dlkm filesystem image", \
142         "Notices for files contained in the odm_dlkm filesystem image in this directory:", \
143         $(ODM_DLKM_NOTICE_DEPS),$(ODM_DLKM_NOTICE_DEPS)))
144
145$(installed_odm_dlkm_notice_xml_gz): $(target_odm_dlkm_notice_file_xml_gz)
146	$(copy-file-to-target)
147
148$(call declare-1p-target,$(target_odm_dlkm_notice_file_xml_gz))
149$(call declare-1p-target,$(installed_odm_dlkm_notice_xml_gz))
150endif
151
152.PHONY: system_dlkmlicense
153system_dlkmlicense: $(call corresponding-license-metadata, $(SYSTEM_DLKM_NOTICE_DEPS)) reportmissinglicenses
154
155ifneq (,$(SYSTEM_DLKM_NOTICE_DEPS))
156$(eval $(call text-notice-rule,$(target_system_dlkm_notice_file_txt),"System_dlkm filesystem image", \
157         "Notices for files contained in the system_dlkm filesystem image in this directory:", \
158         $(SYSTEM_DLKM_NOTICE_DEPS),$(SYSTEM_DLKM_NOTICE_DEPS)))
159
160$(eval $(call xml-notice-rule,$(target_system_dlkm_notice_file_xml_gz),"System_dlkm filesystem image", \
161         "Notices for files contained in the system_dlkm filesystem image in this directory:", \
162         $(SYSTEM_DLKM_NOTICE_DEPS),$(SYSTEM_DLKM_NOTICE_DEPS)))
163
164$(installed_system_dlkm_notice_xml_gz): $(target_system_dlkm_notice_file_xml_gz)
165	$(copy-file-to-target)
166
167$(call declare-1p-target,$(target_system_dlkm_notice_file_xml_gz))
168$(call declare-1p-target,$(installed_sysetm_dlkm_notice_xml_gz))
169endif
170
171endif # not TARGET_BUILD_APPS
172