better name for a function overload
[LibreOffice.git] / extras / CustomTarget_tpldraw.mk
blobec878697f55a25566948330b714e9804c73a4388
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/draw))
12 extras_TEMPLATES_DRAW := \
13 bpmn \
16 extras_DRAW_XMLFILES := \
17 bpmn/content.xml \
18 bpmn/META-INF/manifest.xml \
19 bpmn/meta.xml \
20 bpmn/styles.xml \
21 bpmn/Thumbnails/thumbnail.png \
24 extras_DRAW_MIMETYPEFILES := $(foreach atexts,$(extras_TEMPLATES_DRAW),$(atexts)/mimetype)
27 $(call gb_CustomTarget_get_target,extras/source/templates/draw) : \
28 $(foreach atexts,$(extras_TEMPLATES_DRAW),$(call gb_CustomTarget_get_workdir,extras/source/templates/draw)/$(atexts).otg)
30 $(call gb_CustomTarget_get_workdir,extras/source/templates/draw)/%/mimetype : $(SRCDIR)/extras/source/templates/draw/%/mimetype
31 $(call gb_Output_announce,templates/draw/$*/mimetype,$(true),CPY,1)
32 $(call gb_Trace_StartRange,templates/draw/$*/mimetype,CPY)
33 cp $< $@
34 $(call gb_Trace_EndRange,templates/draw/$*/mimetype,CPY)
36 $(call gb_CustomTarget_get_workdir,extras/source/templates/draw)/%.jpg : $(SRCDIR)/extras/source/templates/draw/%.jpg
37 $(call gb_Output_announce,templates/draw/$*.jpg,$(true),CPY,1)
38 $(call gb_Trace_StartRange,templates/draw/$*.jpg,CPY)
39 cp $< $@
40 $(call gb_Trace_EndRange,templates/draw/$*.jpg,CPY)
42 $(call gb_CustomTarget_get_workdir,extras/source/templates/draw)/%.png : $(SRCDIR)/extras/source/templates/draw/%.png
43 $(call gb_Output_announce,templates/draw/$*.png,$(true),CPY,1)
44 $(call gb_Trace_StartRange,templates/draw/$*.png,CPY)
45 cp $< $@
46 $(call gb_Trace_EndRange,templates/draw/$*.png,CPY)
48 $(call gb_CustomTarget_get_workdir,extras/source/templates/draw)/%.rdf : $(SRCDIR)/extras/source/templates/draw/%.rdf
49 $(call gb_Output_announce,templates/draw/$*.rdf,$(true),CPY,1)
50 $(call gb_Trace_StartRange,templates/draw/$*.rdf,CPY)
51 cp $< $@
52 $(call gb_Trace_EndRange,templates/draw/$*.rdf,CPY)
54 $(call gb_CustomTarget_get_workdir,extras/source/templates/draw)/%.svg : $(SRCDIR)/extras/source/templates/draw/%.svg
55 $(call gb_Output_announce,templates/draw/$*.svg,$(true),CPY,1)
56 $(call gb_Trace_StartRange,templates/draw/$*.svg,CPY)
57 cp $< $@
58 $(call gb_Trace_EndRange,templates/draw/$*.svg,CPY)
60 $(call gb_CustomTarget_get_workdir,extras/source/templates/draw)/%.svm : $(SRCDIR)/extras/source/templates/draw/%.svm
61 $(call gb_Output_announce,templates/draw/$*.svm,$(true),CPY,1)
62 $(call gb_Trace_StartRange,templates/draw/$*.svm,CPY)
63 cp $< $@
64 $(call gb_Trace_EndRange,templates/draw/$*.svm,CPY)
66 $(call gb_CustomTarget_get_workdir,extras/source/templates/draw)/%.xml : $(SRCDIR)/extras/source/templates/draw/%.xml \
67 | $(call gb_ExternalExecutable_get_dependencies,xsltproc)
68 $(call gb_Output_announce,templates/draw/$*.xml,$(true),XSL,1)
69 $(call gb_Trace_StartRange,templates/draw/$*.xml,XSL)
70 $(call gb_ExternalExecutable_get_command,xsltproc) --nonet -o $@ $(SRCDIR)/extras/util/compact.xsl $<
71 $(call gb_Trace_EndRange,templates/draw/$*.xml,XSL)
73 $(call gb_CustomTarget_get_workdir,extras/source/templates/draw)/%.otg :
74 $(call gb_Output_announce,templates/draw/$*.otg,$(true),ZIP,2)
75 $(call gb_Trace_StartRange,templates/draw/$*.otg,ZIP)
76 $(call gb_Helper_abbreviate_dirs,\
77 cd $(EXTRAS_DRAW_DIR) && \
78 zip -q0X --filesync --must-match $@ $(EXTRAS_DRAW_MIMEFILES_FILTER) && \
79 zip -qrX --must-match $@ $(EXTRAS_DRAW_XMLFILES_FILTER) \
81 $(call gb_Trace_EndRange,templates/draw/$*.otg,ZIP)
83 define extras_Tpldraw_make_file_deps
84 $(call gb_CustomTarget_get_workdir,$(1))/$(2) : $(SRCDIR)/$(1)/$(2) \
85 | $(dir $(call gb_CustomTarget_get_workdir,$(1))/$(2)).dir
87 endef
89 define extras_Tpldraw_make_zip_deps
90 $(call gb_CustomTarget_get_workdir,$(1))/$(2) : \
91 $(addprefix $(call gb_CustomTarget_get_workdir,$(1))/,$(filter $(3)/%,$(extras_DRAW_MIMETYPEFILES) $(extras_DRAW_XMLFILES))) \
92 | $(dir $(call gb_CustomTarget_get_workdir,$(1))/$(2)).dir
94 $(call gb_CustomTarget_get_workdir,$(1))/$(2) : \
95 EXTRAS_DRAW_MIMEFILES_FILTER := $(foreach file,$(filter $(3)/%,$(extras_DRAW_MIMETYPEFILES)),$(subst $(3)/,,$(file)))
96 $(call gb_CustomTarget_get_workdir,$(1))/$(2) : \
97 EXTRAS_DRAW_XMLFILES_FILTER := $(foreach file,$(filter $(3)/%,$(extras_DRAW_XMLFILES)),$(subst $(3)/,,$(file)))
98 $(call gb_CustomTarget_get_workdir,$(1))/$(2) : \
99 EXTRAS_DRAW_DIR := $(call gb_CustomTarget_get_workdir,$(1))/$(3)
101 endef
103 $(eval $(foreach file,$(extras_DRAW_MIMETYPEFILES) $(extras_DRAW_XMLFILES),\
104 $(call extras_Tpldraw_make_file_deps,extras/source/templates/draw,$(file)) \
107 $(eval $(foreach atexts,$(extras_TEMPLATES_DRAW),\
108 $(call extras_Tpldraw_make_zip_deps,extras/source/templates/draw,$(atexts).otg,$(atexts)) \
111 # vim: set noet sw=4 ts=4: