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 \
39 l10n
/zh_CN_ott_normal
/meta.xml \
40 l10n
/zh_CN_ott_normal
/content.xml \
41 l10n
/ja_ott_normal
/meta.xml \
42 l10n
/ja_ott_normal
/content.xml \
44 # param: style-base (e.g. Modern)
45 extras_TEMPLATES_XMLFILES_RELATIVE
= $(subst $(1)/,,$(filter $(1)/%,$(extras_TEMPLATES_XMLFILES
)))
48 # secondexpansion since the patterns not just cover a filename portion, but also include a
49 # directory portion with different number of elements
50 # copy regular files (mimetype, *.jpg, *.png, *.rdf, *.svg, *.svm, …)
51 $(gb_CustomTarget_workdir
)/extras
/source
/templates
/% : $(SRCDIR
)/extras
/source
/templates
/% \
52 |
$$(dir $(gb_CustomTarget_workdir
)/extras
/source
/templates
/$$*).
dir
53 $(call gb_Output_announce
,templates
/$*,$(true
),CPY
,1)
54 $(call gb_Trace_StartRange
,templates
/$*,CPY
)
56 $(call gb_Trace_EndRange
,templates
/$*,CPY
)
58 # test and copy xml files
59 $(gb_CustomTarget_workdir
)/extras
/source
/templates
/%.xml
: $(SRCDIR
)/extras
/source
/templates
/%.xml \
60 |
$(call gb_ExternalExecutable_get_dependencies
,xsltproc
) \
61 $$(dir $(gb_CustomTarget_workdir
)/extras
/source
/templates
/$$*.xml
).
dir
62 $(call gb_Output_announce
,templates
/$*.xml
,$(true
),XSL
,1)
63 $(call gb_Trace_StartRange
,templates
/$*.xml
,XSL
)
64 $(call gb_ExternalExecutable_get_command
,xsltproc
) --nonet
-o
$@
$(SRCDIR
)/extras
/util
/compact.xsl
$<
65 $(call gb_Trace_EndRange
,templates
/$*.xml
,XSL
)
68 $(gb_CustomTarget_workdir
)/extras
/source
/templates
/%.ott
: \
69 $$(addprefix $(gb_CustomTarget_workdir
)/extras
/source
/templates
/$$*/,\
70 mimetype
$$(call extras_TEMPLATES_XMLFILES_RELATIVE
,$$*) ) \
71 $$(addprefix $(gb_CustomTarget_workdir
)/extras
/source
/templates
/$$*/,\
72 styles.xml
$$(call extras_TEMPLATES_XMLFILES_RELATIVE
,$$*) ) \
73 $$(addprefix $(gb_CustomTarget_workdir
)/extras
/source
/templates
/$$*/,\
74 META-INF
/manifest.xml
$$(call extras_TEMPLATES_XMLFILES_RELATIVE
,$$*) ) \
75 $$(addprefix $(gb_CustomTarget_workdir
)/extras
/source
/templates
/$$*/,\
76 Thumbnails
/thumbnail.png
$$(call extras_TEMPLATES_XMLFILES_RELATIVE
,$$*) )
77 $(call gb_Output_announce
,templates
/$*.ott
,$(true
),ZIP
,2)
78 $(call gb_Trace_StartRange
,templates
/$*.ott
,ZIP
)
79 $(call gb_Helper_abbreviate_dirs
,\
81 $(call gb_Helper_wsl_path
,\
82 $(WSL
) zip
-q0X
--filesync
--must-match
$@ mimetype
&& \
83 $(WSL
) zip
-qrX
--must-match
$@ styles.xml META-INF
/manifest.xml Thumbnails
/thumbnail.png
&& \
84 $(WSL
) zip
-qrX
--must-match
$@
$(call extras_TEMPLATES_XMLFILES_RELATIVE
,$*)) \
86 $(call gb_Trace_EndRange
,templates
/$*.ott
,ZIP
)
89 $(gb_CustomTarget_workdir
)/extras
/source
/templates
/%.otg
: \
90 $$(addprefix $(gb_CustomTarget_workdir
)/extras
/source
/templates
/$$*/,\
91 mimetype
$$(call extras_TEMPLATES_XMLFILES_RELATIVE
,$$*) ) \
92 $$(addprefix $(gb_CustomTarget_workdir
)/extras
/source
/templates
/$$*/,\
93 content.xml
$$(call extras_TEMPLATES_XMLFILES_RELATIVE
,$$*) ) \
94 $$(addprefix $(gb_CustomTarget_workdir
)/extras
/source
/templates
/$$*/,\
95 styles.xml
$$(call extras_TEMPLATES_XMLFILES_RELATIVE
,$$*) ) \
96 $$(addprefix $(gb_CustomTarget_workdir
)/extras
/source
/templates
/$$*/,\
97 META-INF
/manifest.xml
$$(call extras_TEMPLATES_XMLFILES_RELATIVE
,$$*) ) \
98 $$(addprefix $(gb_CustomTarget_workdir
)/extras
/source
/templates
/$$*/,\
99 Thumbnails
/thumbnail.png
$$(call extras_TEMPLATES_XMLFILES_RELATIVE
,$$*) )
100 $(call gb_Output_announce
,templates
/$*.otg
,$(true
),ZIP
,2)
101 $(call gb_Trace_StartRange
,templates
/$*.otg
,ZIP
)
102 $(call gb_Helper_abbreviate_dirs
,\
104 $(call gb_Helper_wsl_path
,\
105 $(WSL
) zip
-q0X
--filesync
--must-match
$@ mimetype
&& \
106 $(WSL
) zip
-qrX
--must-match
$@ content.xml styles.xml META-INF
/manifest.xml Thumbnails
/thumbnail.png
&& \
107 $(WSL
) zip
-qrX
--must-match
$@
$(call extras_TEMPLATES_XMLFILES_RELATIVE
,$*)) \
109 $(call gb_Trace_EndRange
,templates
/$*.otg
,ZIP
)
111 # vim: set noet sw=4 ts=4: