gb_LinkTarget_use_clang: only use flto=thin with clang, not with gcc
[LibreOffice.git] / extras / CustomTarget_templates.mk
blobc6bea14a27dfcd078165eb035e2291c653bf2f5d
1 # -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
3 # This file is part of the LibreOffice project.
5 # This Source Code Form is subject to the terms of the Mozilla Public
6 # License, v. 2.0. If a copy of the MPL was not distributed with this
7 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 $(eval $(call gb_CustomTarget_CustomTarget,extras/source/templates))
12 # # for OTT templates: mimetype, styles.xml, META-INF/manifest.xml and
13 # Thumbnails/thumbnail.png files are automatically added for each template
14 # # for OTG templates: mimetype, content.xml, styles.xml, META-INF/manifest.xml and
15 # Thumbnails/thumbnail.png files are automatically added for each template
16 # list of meta.xml files (one per template) + other files (content.xml, manifest.rdf, settings.xml, pictures...)
17 extras_TEMPLATES_XMLFILES := \
18 officorr/Modern_business_letter_sans_serif/meta.xml \
19 officorr/Modern_business_letter_serif/meta.xml \
20 offimisc/Businesscard-with-logo/meta.xml \
21 personal/CV/meta.xml \
22 personal/Resume1page/meta.xml \
23 styles/Default/meta.xml \
24 styles/Modern/meta.xml \
25 styles/Simple/meta.xml \
26 officorr/Modern_business_letter_sans_serif/content.xml \
27 officorr/Modern_business_letter_serif/content.xml \
28 offimisc/Businesscard-with-logo/content.xml \
29 personal/CV/content.xml \
30 personal/Resume1page/content.xml \
31 officorr/Modern_business_letter_sans_serif/manifest.rdf \
32 officorr/Modern_business_letter_serif/manifest.rdf \
33 offimisc/Businesscard-with-logo/manifest.rdf \
34 personal/CV/manifest.rdf \
35 personal/Resume1page/manifest.rdf \
36 offimisc/Businesscard-with-logo/settings.xml \
37 offimisc/Businesscard-with-logo/Pictures/10000201000001F4000000A0108F3F06.png \
38 draw/bpmn/meta.xml \
39 l10n/zh_CN_ott_normal/meta.xml \
40 l10n/zh_CN_ott_normal/content.xml \
42 # param: style-base (e.g. Modern)
43 extras_TEMPLATES_XMLFILES_RELATIVE = $(subst $(1)/,,$(filter $(1)/%,$(extras_TEMPLATES_XMLFILES)))
45 .SECONDEXPANSION:
46 # secondexpansion since the patterns not just cover a filename portion, but also include a
47 # directory portion with different number of elements
48 # copy regular files (mimetype, *.jpg, *.png, *.rdf, *.svg, *.svm, …)
49 $(call gb_CustomTarget_get_workdir,extras/source/templates)/% : $(SRCDIR)/extras/source/templates/% \
50 | $$(dir $(call gb_CustomTarget_get_workdir,extras/source/templates)/$$*).dir
51 $(call gb_Output_announce,templates/$*,$(true),CPY,1)
52 $(call gb_Trace_StartRange,templates/$*,CPY)
53 cp $< $@
54 $(call gb_Trace_EndRange,templates/$*,CPY)
56 # test and copy xml files
57 $(call gb_CustomTarget_get_workdir,extras/source/templates)/%.xml : $(SRCDIR)/extras/source/templates/%.xml \
58 | $(call gb_ExternalExecutable_get_dependencies,xsltproc) \
59 $$(dir $(call gb_CustomTarget_get_workdir,extras/source/templates)/$$*.xml).dir
60 $(call gb_Output_announce,templates/$*.xml,$(true),XSL,1)
61 $(call gb_Trace_StartRange,templates/$*.xml,XSL)
62 $(call gb_ExternalExecutable_get_command,xsltproc) --nonet -o $@ $(SRCDIR)/extras/util/compact.xsl $<
63 $(call gb_Trace_EndRange,templates/$*.xml,XSL)
65 # zip files to OTT
66 $(call gb_CustomTarget_get_workdir,extras/source/templates)/%.ott : \
67 $$(addprefix $(call gb_CustomTarget_get_workdir,extras/source/templates)/$$*/,\
68 mimetype $$(call extras_TEMPLATES_XMLFILES_RELATIVE,$$*) ) \
69 $$(addprefix $(call gb_CustomTarget_get_workdir,extras/source/templates)/$$*/,\
70 styles.xml $$(call extras_TEMPLATES_XMLFILES_RELATIVE,$$*) ) \
71 $$(addprefix $(call gb_CustomTarget_get_workdir,extras/source/templates)/$$*/,\
72 META-INF/manifest.xml $$(call extras_TEMPLATES_XMLFILES_RELATIVE,$$*) ) \
73 $$(addprefix $(call gb_CustomTarget_get_workdir,extras/source/templates)/$$*/,\
74 Thumbnails/thumbnail.png $$(call extras_TEMPLATES_XMLFILES_RELATIVE,$$*) )
75 $(call gb_Output_announce,templates/$*.ott,$(true),ZIP,2)
76 $(call gb_Trace_StartRange,templates/$*.ott,ZIP)
77 $(call gb_Helper_abbreviate_dirs,\
78 cd $(dir $<) && \
79 zip -q0X --filesync --must-match $@ mimetype && \
80 zip -qrX --must-match $@ styles.xml META-INF/manifest.xml Thumbnails/thumbnail.png && \
81 zip -qrX --must-match $@ $(call extras_TEMPLATES_XMLFILES_RELATIVE,$*) \
83 $(call gb_Trace_EndRange,templates/$*.ott,ZIP)
85 # zip files to OTG
86 $(call gb_CustomTarget_get_workdir,extras/source/templates)/%.otg : \
87 $$(addprefix $(call gb_CustomTarget_get_workdir,extras/source/templates)/$$*/,\
88 mimetype $$(call extras_TEMPLATES_XMLFILES_RELATIVE,$$*) ) \
89 $$(addprefix $(call gb_CustomTarget_get_workdir,extras/source/templates)/$$*/,\
90 content.xml $$(call extras_TEMPLATES_XMLFILES_RELATIVE,$$*) ) \
91 $$(addprefix $(call gb_CustomTarget_get_workdir,extras/source/templates)/$$*/,\
92 styles.xml $$(call extras_TEMPLATES_XMLFILES_RELATIVE,$$*) ) \
93 $$(addprefix $(call gb_CustomTarget_get_workdir,extras/source/templates)/$$*/,\
94 META-INF/manifest.xml $$(call extras_TEMPLATES_XMLFILES_RELATIVE,$$*) ) \
95 $$(addprefix $(call gb_CustomTarget_get_workdir,extras/source/templates)/$$*/,\
96 Thumbnails/thumbnail.png $$(call extras_TEMPLATES_XMLFILES_RELATIVE,$$*) )
97 $(call gb_Output_announce,templates/$*.otg,$(true),ZIP,2)
98 $(call gb_Trace_StartRange,templates/$*.otg,ZIP)
99 $(call gb_Helper_abbreviate_dirs,\
100 cd $(dir $<) && \
101 zip -q0X --filesync --must-match $@ mimetype && \
102 zip -qrX --must-match $@ content.xml styles.xml META-INF/manifest.xml Thumbnails/thumbnail.png && \
103 zip -qrX --must-match $@ $(call extras_TEMPLATES_XMLFILES_RELATIVE,$*) \
105 $(call gb_Trace_EndRange,templates/$*.otg,ZIP)
107 # vim: set noet sw=4 ts=4: