From 7e76f904d208e4ef0bf722583897d4044264f546 Mon Sep 17 00:00:00 2001 From: Luca Ceresoli Date: Thu, 17 May 2012 19:33:00 +0200 Subject: legal-info: infrastructure to collect legally-relevant material This allows to automatically collect material that may be needed to comply with the license of packages that Buildroot prepares for the target device. The core of the implementation is made by the following parts: - in package/pkg-utils.mk some helper functions are defined for common actions such as generating a warning, producing info about a package etc; - in package/pkg-gentargets.mk, within the GENTARGETS framework, a new -legal-info target produces all the info for a given package; - Makefile implements the top-level targets: - legal-info-prepare creates the output directory and produces legal info about Buildroot itself and the toolchain, which mostly means just warning the user that this is not implemented; - legal-info, the only target that is supposed to be used directly, depends on all of the above and finishes things by producing the README files from the various pieces. Signed-off-by: Luca Ceresoli Signed-off-by: Thomas Petazzoni --- package/pkg-utils.mk | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'package/pkg-utils.mk') diff --git a/package/pkg-utils.mk b/package/pkg-utils.mk index 0c55a9d71..35abb17ce 100644 --- a/package/pkg-utils.mk +++ b/package/pkg-utils.mk @@ -92,3 +92,28 @@ define sep endef + +# +# legal-info helper functions +# +LEGAL_INFO_SEPARATOR="::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::" +legal-warning=echo "WARNING: $(1)" >>$(LEGAL_WARNINGS) +legal-warning-pkg=echo "WARNING: $(1): $(2)" >>$(LEGAL_WARNINGS) +define legal-warning-pkg-savednothing # pkg, {local|override} + $(call legal-warning-pkg,$(1),sources and license files not saved ($(2) packages not handled)) +endef +legal-manifest=echo "$(1),$(2),$(3),$(4),$(5)" >>$(LEGAL_MANIFEST_CSV) +define legal-license-header + echo -e "$(LEGAL_INFO_SEPARATOR)\n\t$(1):" \ + "$(2)\n$(LEGAL_INFO_SEPARATOR)\n\n" >>$(LEGAL_LICENSES_TXT) +endef +define legal-license-nofiles + $(call legal-license-header,$(1),unknown license file(s)) +endef +define legal-license-file # pkg, filename, file-fullpath + $(call legal-license-header,$(1),$(2) file) && \ + cat $(3) >>$(LEGAL_LICENSES_TXT) && \ + echo >>$(LEGAL_LICENSES_TXT) && \ + mkdir -p $(LICENSE_FILES_DIR)/$(1)/ && \ + cp $(3) $(LICENSE_FILES_DIR)/$(1)/ +endef -- cgit v1.2.3