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
,filter/source
/docbook
))
12 filter_docbook_files
:= \
13 DocBookTemplate
/settings.xml \
14 DocBookTemplate
/manifest.rdf \
17 filter_docbook_files_RELATIVE
= $(subst $(1)/,,$(filter $(1)/%,$(filter_docbook_files
)))
19 define run_zip_docbook_recipe
=
20 $(call gb_Output_announce
,$(subst $(gb_CustomTarget_workdir
)/filter/source
/docbook
/,,$@
),$(true
),ZIP
,2)
21 $(call gb_Trace_StartRange
,$(subst $(gb_CustomTarget_workdir
)/filter/source
/docbook
/,,$@
),ZIP
)
23 $(call gb_Helper_wsl_path
,\
24 $(WSL
) zip
-q0X
--filesync
--must-match
$@ mimetype
&& \
25 $(WSL
) zip
-qrX
--must-match
$@
$(subst $(dir $<),,$^
)) -x mimetype
26 $(call gb_Trace_EndRange
,$(subst $(gb_CustomTarget_workdir
)/filter/source
/docbook
/,,$@
),ZIP
)
30 # secondexpansion since the patterns not just cover a filename portion, but also include a
31 # directory portion with different number of elements
32 # copy regular files (mimetype, *.jpg, *.png, *.rdf, *.svg, *.svm, …)
33 $(gb_CustomTarget_workdir
)/filter/source
/docbook
/% : $(SRCDIR
)/filter/source
/docbook
/% \
34 |
$$(dir $(gb_CustomTarget_workdir
)/filter/source
/docbook
/$$*).
dir
35 $(call gb_Output_announce
,docbook
/$*,$(true
),CPY
,1)
36 $(call gb_Trace_StartRange
,docbook
/$*,CPY
)
38 $(call gb_Trace_EndRange
,docbook
/$*,CPY
)
40 # test and copy xml files
41 $(gb_CustomTarget_workdir
)/filter/source
/docbook
/%.xml
: $(SRCDIR
)/filter/source
/docbook
/%.xml \
42 |
$(call gb_ExternalExecutable_get_dependencies
,xsltproc
) \
43 $$(dir $(gb_CustomTarget_workdir
)/filter/source
/docbook
/$$*.xml
).
dir
44 $(call gb_Output_announce
,docbook
/$*.xml
,$(true
),XSL
,1)
45 $(call gb_Trace_StartRange
,docbook
/$*.xml
,XSL
)
46 $(call gb_ExternalExecutable_get_command
,xsltproc
) --nonet
-o
$@
$(SRCDIR
)/extras
/util
/compact.xsl
$<
47 $(call gb_Trace_EndRange
,docbook
/$*.xml
,XSL
)
49 $(gb_CustomTarget_workdir
)/filter/source
/docbook
/%.ott
: \
50 $$(addprefix $(gb_CustomTarget_workdir
)/filter/source
/docbook
/$$*/,\
51 mimetype META-INF
/manifest.xml styles.xml \
52 $$(call filter_docbook_files_RELATIVE
,$$*))
53 $(run_zip_docbook_recipe
)
55 # vim: set noet sw=4 ts=4: