LICENSE_FILES_DIR_HOST = $(LEGAL_INFO_DIR)/host-licenses
LEGAL_MANIFEST_CSV_TARGET = $(LEGAL_INFO_DIR)/manifest.csv
LEGAL_MANIFEST_CSV_HOST = $(LEGAL_INFO_DIR)/host-manifest.csv
-LEGAL_LICENSES_TXT_TARGET = $(LEGAL_INFO_DIR)/licenses.txt
-LEGAL_LICENSES_TXT_HOST = $(LEGAL_INFO_DIR)/host-licenses.txt
LEGAL_WARNINGS = $(LEGAL_INFO_DIR)/.warnings
LEGAL_REPORT = $(LEGAL_INFO_DIR)/README
# is that the license still applies to the files distributed as part
# of the rootfs, even if the sources are not themselves redistributed.
ifeq ($$(call qstrip,$$($(2)_LICENSE_FILES)),)
- @$$(call legal-license-nofiles,$$($(2)_RAW_BASE_NAME),$$(call UPPERCASE,$(4)))
@$$(call legal-warning-pkg,$$($(2)_RAW_BASE_NAME),cannot save license ($(2)_LICENSE_FILES not defined))
else
@$$(foreach F,$$($(2)_LICENSE_FILES),$$(call legal-license-file,$$($(2)_RAW_BASE_NAME),$$(F),$$($(2)_DIR)/$$(F),$$(call UPPERCASE,$(4)))$$(sep))
echo '"$(1)","$(2)","$(3)","$(4)","$(5)","$(6)"' >>$(LEGAL_MANIFEST_CSV_$(7))
endef
-define legal-license-header # pkg, license-file, {HOST|TARGET}
- printf "$(LEGAL_INFO_SEPARATOR)\n\t$(1):\
- $(2)\n$(LEGAL_INFO_SEPARATOR)\n\n\n" >>$(LEGAL_LICENSES_TXT_$(3))
-endef
-
-define legal-license-nofiles # pkg, {HOST|TARGET}
- $(call legal-license-header,$(1),unknown license file(s),$(2))
-endef
-
define legal-license-file # pkg, filename, file-fullpath, {HOST|TARGET}
- $(call legal-license-header,$(1),$(2) file,$(4)) && \
- cat $(3) >>$(LEGAL_LICENSES_TXT_$(4)) && \
- echo >>$(LEGAL_LICENSES_TXT_$(4)) && \
mkdir -p $(LICENSE_FILES_DIR_$(4))/$(1)/$(dir $(2)) && \
cp $(3) $(LICENSE_FILES_DIR_$(4))/$(1)/$(2)
endef