0c4c84a14b
…by a simple/static $(gb_CustomTarget_workdir)/foo The build system has a lot of overly complicated leftovers from when it was introduced and had not only deal with split repositories but also had to coexist with another buildsystem. Along with lots of copy'n'paste along the years the makefiles became hard to grasp for newcomers with all our calls and evals. As a first step to streamline that, the macros from TargetLocations that simply prefix a static path to the argument (and similar of the same kind) are a natural pick before simplifying the rules themselves/getting rid of a bunch of eval statements. Change-Id: Ia06dbbcd5d1994755a2ff05b84f72ccbc4e3cab5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167005 Tested-by: Jenkins Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
111 lines
5.6 KiB
Makefile
111 lines
5.6 KiB
Makefile
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
|
|
#
|
|
# This file is part of the LibreOffice project.
|
|
#
|
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
#
|
|
|
|
$(eval $(call gb_CustomTarget_CustomTarget,extras/source/templates))
|
|
|
|
# # for OTT templates: mimetype, styles.xml, META-INF/manifest.xml and
|
|
# Thumbnails/thumbnail.png files are automatically added for each template
|
|
# # for OTG templates: mimetype, content.xml, styles.xml, META-INF/manifest.xml and
|
|
# Thumbnails/thumbnail.png files are automatically added for each template
|
|
# list of meta.xml files (one per template) + other files (content.xml, manifest.rdf, settings.xml, pictures...)
|
|
extras_TEMPLATES_XMLFILES := \
|
|
officorr/Modern_business_letter_sans_serif/meta.xml \
|
|
officorr/Modern_business_letter_serif/meta.xml \
|
|
offimisc/Businesscard-with-logo/meta.xml \
|
|
personal/CV/meta.xml \
|
|
personal/Resume1page/meta.xml \
|
|
styles/Default/meta.xml \
|
|
styles/Modern/meta.xml \
|
|
styles/Simple/meta.xml \
|
|
officorr/Modern_business_letter_sans_serif/content.xml \
|
|
officorr/Modern_business_letter_serif/content.xml \
|
|
offimisc/Businesscard-with-logo/content.xml \
|
|
personal/CV/content.xml \
|
|
personal/Resume1page/content.xml \
|
|
officorr/Modern_business_letter_sans_serif/manifest.rdf \
|
|
officorr/Modern_business_letter_serif/manifest.rdf \
|
|
offimisc/Businesscard-with-logo/manifest.rdf \
|
|
personal/CV/manifest.rdf \
|
|
personal/Resume1page/manifest.rdf \
|
|
offimisc/Businesscard-with-logo/settings.xml \
|
|
offimisc/Businesscard-with-logo/Pictures/10000201000001F4000000A0108F3F06.png \
|
|
draw/bpmn/meta.xml \
|
|
l10n/zh_CN_ott_normal/meta.xml \
|
|
l10n/zh_CN_ott_normal/content.xml \
|
|
l10n/ja_ott_normal/meta.xml \
|
|
l10n/ja_ott_normal/content.xml \
|
|
|
|
# param: style-base (e.g. Modern)
|
|
extras_TEMPLATES_XMLFILES_RELATIVE = $(subst $(1)/,,$(filter $(1)/%,$(extras_TEMPLATES_XMLFILES)))
|
|
|
|
.SECONDEXPANSION:
|
|
# secondexpansion since the patterns not just cover a filename portion, but also include a
|
|
# directory portion with different number of elements
|
|
# copy regular files (mimetype, *.jpg, *.png, *.rdf, *.svg, *.svm, …)
|
|
$(gb_CustomTarget_workdir)/extras/source/templates/% : $(SRCDIR)/extras/source/templates/% \
|
|
| $$(dir $(gb_CustomTarget_workdir)/extras/source/templates/$$*).dir
|
|
$(call gb_Output_announce,templates/$*,$(true),CPY,1)
|
|
$(call gb_Trace_StartRange,templates/$*,CPY)
|
|
cp $< $@
|
|
$(call gb_Trace_EndRange,templates/$*,CPY)
|
|
|
|
# test and copy xml files
|
|
$(gb_CustomTarget_workdir)/extras/source/templates/%.xml : $(SRCDIR)/extras/source/templates/%.xml \
|
|
| $(call gb_ExternalExecutable_get_dependencies,xsltproc) \
|
|
$$(dir $(gb_CustomTarget_workdir)/extras/source/templates/$$*.xml).dir
|
|
$(call gb_Output_announce,templates/$*.xml,$(true),XSL,1)
|
|
$(call gb_Trace_StartRange,templates/$*.xml,XSL)
|
|
$(call gb_ExternalExecutable_get_command,xsltproc) --nonet -o $@ $(SRCDIR)/extras/util/compact.xsl $<
|
|
$(call gb_Trace_EndRange,templates/$*.xml,XSL)
|
|
|
|
# zip files to OTT
|
|
$(gb_CustomTarget_workdir)/extras/source/templates/%.ott : \
|
|
$$(addprefix $(gb_CustomTarget_workdir)/extras/source/templates/$$*/,\
|
|
mimetype $$(call extras_TEMPLATES_XMLFILES_RELATIVE,$$*) ) \
|
|
$$(addprefix $(gb_CustomTarget_workdir)/extras/source/templates/$$*/,\
|
|
styles.xml $$(call extras_TEMPLATES_XMLFILES_RELATIVE,$$*) ) \
|
|
$$(addprefix $(gb_CustomTarget_workdir)/extras/source/templates/$$*/,\
|
|
META-INF/manifest.xml $$(call extras_TEMPLATES_XMLFILES_RELATIVE,$$*) ) \
|
|
$$(addprefix $(gb_CustomTarget_workdir)/extras/source/templates/$$*/,\
|
|
Thumbnails/thumbnail.png $$(call extras_TEMPLATES_XMLFILES_RELATIVE,$$*) )
|
|
$(call gb_Output_announce,templates/$*.ott,$(true),ZIP,2)
|
|
$(call gb_Trace_StartRange,templates/$*.ott,ZIP)
|
|
$(call gb_Helper_abbreviate_dirs,\
|
|
cd $(dir $<) && \
|
|
$(call gb_Helper_wsl_path,\
|
|
$(WSL) zip -q0X --filesync --must-match $@ mimetype && \
|
|
$(WSL) zip -qrX --must-match $@ styles.xml META-INF/manifest.xml Thumbnails/thumbnail.png && \
|
|
$(WSL) zip -qrX --must-match $@ $(call extras_TEMPLATES_XMLFILES_RELATIVE,$*)) \
|
|
)
|
|
$(call gb_Trace_EndRange,templates/$*.ott,ZIP)
|
|
|
|
# zip files to OTG
|
|
$(gb_CustomTarget_workdir)/extras/source/templates/%.otg : \
|
|
$$(addprefix $(gb_CustomTarget_workdir)/extras/source/templates/$$*/,\
|
|
mimetype $$(call extras_TEMPLATES_XMLFILES_RELATIVE,$$*) ) \
|
|
$$(addprefix $(gb_CustomTarget_workdir)/extras/source/templates/$$*/,\
|
|
content.xml $$(call extras_TEMPLATES_XMLFILES_RELATIVE,$$*) ) \
|
|
$$(addprefix $(gb_CustomTarget_workdir)/extras/source/templates/$$*/,\
|
|
styles.xml $$(call extras_TEMPLATES_XMLFILES_RELATIVE,$$*) ) \
|
|
$$(addprefix $(gb_CustomTarget_workdir)/extras/source/templates/$$*/,\
|
|
META-INF/manifest.xml $$(call extras_TEMPLATES_XMLFILES_RELATIVE,$$*) ) \
|
|
$$(addprefix $(gb_CustomTarget_workdir)/extras/source/templates/$$*/,\
|
|
Thumbnails/thumbnail.png $$(call extras_TEMPLATES_XMLFILES_RELATIVE,$$*) )
|
|
$(call gb_Output_announce,templates/$*.otg,$(true),ZIP,2)
|
|
$(call gb_Trace_StartRange,templates/$*.otg,ZIP)
|
|
$(call gb_Helper_abbreviate_dirs,\
|
|
cd $(dir $<) && \
|
|
$(call gb_Helper_wsl_path,\
|
|
$(WSL) zip -q0X --filesync --must-match $@ mimetype && \
|
|
$(WSL) zip -qrX --must-match $@ content.xml styles.xml META-INF/manifest.xml Thumbnails/thumbnail.png && \
|
|
$(WSL) zip -qrX --must-match $@ $(call extras_TEMPLATES_XMLFILES_RELATIVE,$*)) \
|
|
)
|
|
$(call gb_Trace_EndRange,templates/$*.otg,ZIP)
|
|
|
|
# vim: set noet sw=4 ts=4:
|