path: root/package/pkg-utils.mk
diff options
authorGravatar Luca Ceresoli <luca@lucaceresoli.net>2012-05-17 19:33:00 +0200
committerGravatar Thomas Petazzoni <thomas.petazzoni@free-electrons.com>2012-07-17 19:05:49 +0200
commit7e76f904d208e4ef0bf722583897d4044264f546 (patch)
tree42d13db7331256d045dfd44e7a847d2d3533589c /package/pkg-utils.mk
parent8d19377d24b2b1d6ded278559c16252ec320bef6 (diff)
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 <PKG>-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 <luca@lucaceresoli.net> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'package/pkg-utils.mk')
1 files changed, 25 insertions, 0 deletions
diff --git a/package/pkg-utils.mk b/package/pkg-utils.mk
index 0c55a9d710..35abb17ce5 100644
--- a/package/pkg-utils.mk
+++ b/package/pkg-utils.mk
@@ -92,3 +92,28 @@ define sep
+# legal-info helper functions
+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))
+legal-manifest=echo "$(1),$(2),$(3),$(4),$(5)" >>$(LEGAL_MANIFEST_CSV)
+define legal-license-header
+ echo -e "$(LEGAL_INFO_SEPARATOR)\n\t$(1):" \
+define legal-license-nofiles
+ $(call legal-license-header,$(1),unknown license file(s))
+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)/