diff options
author | Tamas Bunth <tamas.bunth@collabora.co.uk> | 2019-03-04 16:54:06 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2019-03-19 15:16:51 +0100 |
commit | 7a9f6df7fb83ec23d09cb5744c2c865fa22e7143 (patch) | |
tree | 62af385480790172d4d55ccc05d88432c41aa6db /readlicense_oo/CustomTarget_license.mk | |
parent | Update git submodules (diff) | |
download | core-7a9f6df7fb83ec23d09cb5744c2c865fa22e7143.tar.gz core-7a9f6df7fb83ec23d09cb5744c2c865fa22e7143.zip |
single source file for licensing info with conditional text
... for easier maintenance. This commit only introduces the
framework. Follow up commits will update the license file.
Advantages:
* single source, multiple outputs (html, txt)
* conditional text, i.e. output will not include license
terms of components that are not configured in the build
Change-Id: I0ffad41119228a0a26fd1b6ce19930ca6085adb2
Reviewed-on: https://gerrit.libreoffice.org/69396
Tested-by: Jenkins
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'readlicense_oo/CustomTarget_license.mk')
-rw-r--r-- | readlicense_oo/CustomTarget_license.mk | 47 |
1 files changed, 46 insertions, 1 deletions
diff --git a/readlicense_oo/CustomTarget_license.mk b/readlicense_oo/CustomTarget_license.mk index 653f1dd38541..75923d109970 100644 --- a/readlicense_oo/CustomTarget_license.mk +++ b/readlicense_oo/CustomTarget_license.mk @@ -10,15 +10,60 @@ $(eval $(call gb_CustomTarget_CustomTarget,readlicense_oo/license)) readlicense_oo_DIR := $(call gb_CustomTarget_get_workdir,readlicense_oo/license) +readlicense_oo_LICENSE_xml := $(SRCDIR)/readlicense_oo/license/license.xml +$(call gb_CustomTarget_get_target,readlicense_oo/license) : $(readlicense_oo_DIR)/license.html + +ifeq ($(OS),WNT) $(call gb_CustomTarget_get_target,readlicense_oo/license) : $(readlicense_oo_DIR)/license.txt +else +$(call gb_CustomTarget_get_target,readlicense_oo/license) : $(readlicense_oo_DIR)/LICENSE +endif + +$(readlicense_oo_DIR)/license.html : \ + $(SRCDIR)/readlicense_oo/license/license_html.xsl \ + $(readlicense_oo_LICENSE_xml) \ + | $(readlicense_oo_DIR)/.dir \ + $(call gb_ExternalExecutable_get_dependencies,xsltproc) + $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),XSL,1) + $(call gb_Helper_abbreviate_dirs, \ + $(call gb_ExternalExecutable_get_command,xsltproc) --nonet --novalid -o $@ \ + --stringparam build_type "$(BUILD_TYPE)" \ + --stringparam os "$(OS)" \ + --stringparam themes "$(WITH_THEMES)" \ + $(if $(MPL_SUBSET),,--stringparam no_mpl_subset no_mpl_subset) \ + $< \ + $(readlicense_oo_LICENSE_xml) \ + $(if $(filter WNT,$(OS)), \ + && $(gb_AWK) 'sub("$$","\r")' $@ > $@.tmp \ + && mv $@.tmp $@ \ + ) \ + ) + +$(readlicense_oo_DIR)/LICENSE : \ + $(SRCDIR)/readlicense_oo/license/license_plain_text.xsl \ + $(readlicense_oo_LICENSE_xml) \ + | $(readlicense_oo_DIR)/.dir \ + $(call gb_ExternalExecutable_get_dependencies,xsltproc) + $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),XSL,1) + $(call gb_Helper_abbreviate_dirs, \ + $(call gb_ExternalExecutable_get_command,xsltproc) --nonet --novalid -o $@ \ + --stringparam build_type "$(BUILD_TYPE)" \ + --stringparam os "$(OS)" \ + --stringparam themes "$(WITH_THEMES)" \ + $(if $(MPL_SUBSET),,--stringparam no_mpl_subset no_mpl_subset) \ + $< \ + $(readlicense_oo_LICENSE_xml) \ + ) +ifeq ($(OS),WNT) $(readlicense_oo_DIR)/license.txt : \ - $(SRCDIR)/readlicense_oo/license/LICENSE \ + $(readlicense_oo_DIR)/LICENSE \ | $(readlicense_oo_DIR)/.dir $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),AWK,1) $(call gb_Helper_abbreviate_dirs, \ $(gb_AWK) 'sub("$$","\r")' $< > $@.tmp && mv $@.tmp $@ \ ) +endif # vim:set shiftwidth=4 tabstop=4 noexpandtab: |