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
/styles
))
12 extras_TEMPLATES_STYLES
:= \
17 extras_STYLES_XMLFILES
:= \
18 Default
/META-INF
/manifest.xml \
21 Default
/Thumbnails
/thumbnail.png \
22 Modern
/META-INF
/manifest.xml \
25 Modern
/Thumbnails
/thumbnail.png \
28 extras_TPLSTYLES_MIMETYPEFILES
:= $(foreach atexts
,$(extras_TEMPLATES_STYLES
),$(atexts
)/mimetype
)
31 ifneq ($(sort $(foreach file
,$(extras_STYLES_XMLFILES
),$(wordlist
1, 1, $(subst /, ,$(file
))))),$(sort $(extras_TEMPLATES_STYLES
)))
32 $(call gb_Output_error
,defined template text do not match existing directories
)
35 $(call gb_CustomTarget_get_target
,extras
/source
/templates
/styles
) : \
36 $(foreach atexts
,$(extras_TEMPLATES_STYLES
),$(call gb_CustomTarget_get_workdir
,extras
/source
/templates
/styles
)/$(atexts
).ott
)
38 $(call gb_CustomTarget_get_workdir
,extras
/source
/templates
/styles
)/%/mimetype
: $(SRCDIR
)/extras
/source
/templates
/styles
/%/mimetype
39 $(call gb_Output_announce
,$*/mimetype
,$(true
),CPY
,1)
42 $(call gb_CustomTarget_get_workdir
,extras
/source
/templates
/styles
)/%.jpg
: $(SRCDIR
)/extras
/source
/templates
/styles
/%.jpg
43 $(call gb_Output_announce
,$*.jpg
,$(true
),CPY
,1)
46 $(call gb_CustomTarget_get_workdir
,extras
/source
/templates
/styles
)/%.png
: $(SRCDIR
)/extras
/source
/templates
/styles
/%.png
47 $(call gb_Output_announce
,$*.png
,$(true
),CPY
,1)
50 $(call gb_CustomTarget_get_workdir
,extras
/source
/templates
/styles
)/%.rdf
: $(SRCDIR
)/extras
/source
/templates
/styles
/%.rdf
51 $(call gb_Output_announce
,$*.rdf
,$(true
),CPY
,1)
54 $(call gb_CustomTarget_get_workdir
,extras
/source
/templates
/styles
)/%.svg
: $(SRCDIR
)/extras
/source
/templates
/styles
/%.svg
55 $(call gb_Output_announce
,$*.svg
,$(true
),CPY
,1)
58 $(call gb_CustomTarget_get_workdir
,extras
/source
/templates
/styles
)/%.svm
: $(SRCDIR
)/extras
/source
/templates
/styles
/%.svm
59 $(call gb_Output_announce
,$*.svm
,$(true
),CPY
,1)
62 $(call gb_CustomTarget_get_workdir
,extras
/source
/templates
/styles
)/%.xml
: $(SRCDIR
)/extras
/source
/templates
/styles
/%.xml \
63 |
$(call gb_ExternalExecutable_get_dependencies
,xsltproc
)
64 $(call gb_Output_announce
,$*.xml
,$(true
),XSL
,1)
65 $(call gb_ExternalExecutable_get_command
,xsltproc
) --nonet
-o
$@
$(SRCDIR
)/extras
/util
/compact.xsl
$<
67 $(call gb_CustomTarget_get_workdir
,extras
/source
/templates
/styles
)/%.ott
:
68 $(call gb_Output_announce
,$*.ott
,$(true
),ZIP
,2)
69 $(call gb_Helper_abbreviate_dirs
,\
70 cd
$(EXTRAS_STYLES_DIR
) && \
71 zip
-qrX
--filesync
--must-match
$@
$(EXTRAS_STYLES_FILES
) \
74 define extras_Tplstyles_make_file_deps
75 $(call gb_CustomTarget_get_workdir
,$(1))/$(2) : $(SRCDIR
)/$(1)/$(2) \
76 |
$(dir $(call gb_CustomTarget_get_workdir
,$(1))/$(2)).
dir
80 define extras_Tplstyles_make_zip_deps
81 $(call gb_CustomTarget_get_workdir
,$(1))/$(2) : \
82 $(addprefix $(call gb_CustomTarget_get_workdir
,$(1))/,$(filter $(3)/%,$(extras_TPLSTYLES_MIMETYPEFILES
) $(extras_STYLES_XMLFILES
))) \
83 |
$(dir $(call gb_CustomTarget_get_workdir
,$(1))/$(2)).
dir
85 $(call gb_CustomTarget_get_workdir
,$(1))/$(2) : \
86 EXTRAS_STYLES_FILES
:= $(foreach file
,$(filter $(3)/%,$(extras_TPLSTYLES_MIMETYPEFILES
) $(extras_STYLES_XMLFILES
)),$(subst $(3)/,,$(file
)))
87 $(call gb_CustomTarget_get_workdir
,$(1))/$(2) : \
88 EXTRAS_STYLES_DIR
:= $(call gb_CustomTarget_get_workdir
,$(1))/$(3)
92 $(eval
$(foreach file
,$(extras_TPLSTYLES_MIMETYPEFILES
) $(extras_STYLES_XMLFILES
),\
93 $(call extras_Tplstyles_make_zip_deps
,extras
/source
/templates
/styles
,$(file
)) \
96 $(eval
$(foreach atexts
,$(extras_TEMPLATES_STYLES
),\
97 $(call extras_Tplstyles_make_zip_deps
,extras
/source
/templates
/styles
,$(atexts
).ott
,$(atexts
)) \
100 # vim: set noet sw=4 ts=4: