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
/autotext
/user
))
12 extras_AUTOTEXTUSER_AUTOTEXTS
:= \
16 extras_AUTOTEXTUSER_XMLFILES
:= \
17 mytexts
/BlockList.xml \
18 mytexts
/META-INF
/manifest.xml \
21 extras_AUTOTEXTUSER_MIMETYPEFILES
:= \
25 $(call gb_CustomTarget_get_target
,extras
/source
/autotext
/user
) : \
26 $(foreach atexts
,$(extras_AUTOTEXTUSER_AUTOTEXTS
),$(call gb_CustomTarget_get_workdir
,extras
/source
/autotext
/user
)/$(atexts
).bau
)
28 $(call gb_CustomTarget_get_workdir
,extras
/source
/autotext
/user
)/%/mimetype
: $(SRCDIR
)/extras
/source
/autotext
/%/mimetype
29 $(call gb_Output_announce
,autotext
/user
/$*/mimetype
,$(true
),CPY
,1)
30 $(call gb_Trace_StartRange
,autotext
/user
/$*/mimetype
,CPY
)
32 $(call gb_Trace_EndRange
,autotext
/user
/$*/mimetype
,CPY
)
34 $(call gb_CustomTarget_get_workdir
,extras
/source
/autotext
/user
)/%.xml
: $(SRCDIR
)/extras
/source
/autotext
/%.xml \
35 |
$(call gb_ExternalExecutable_get_dependencies
,xsltproc
)
36 $(call gb_Output_announce
,autotext
/user
/$*.xml
,$(true
),XSL
,1)
37 $(call gb_Trace_StartRange
,autotext
/user
/$*.xml
,XSL
)
38 $(call gb_ExternalExecutable_get_command
,xsltproc
) --nonet
-o
$@
$(SRCDIR
)/extras
/util
/compact.xsl
$<
39 $(call gb_Trace_EndRange
,autotext
/user
/$*.xml
,XSL
)
41 $(call gb_CustomTarget_get_workdir
,extras
/source
/autotext
/user
)/%.bau
:
42 $(call gb_Output_announce
,autotext
/user
/$*.bau
,$(true
),ZIP
,2)
43 $(call gb_Trace_StartRange
,autotext
/user
/$*.bau
,ZIP
)
44 $(call gb_Helper_abbreviate_dirs
,\
45 cd
$(EXTRAS_AUTOTEXTUSER_DIR
) && \
46 zip
-q0X
--filesync
--must-match
$@
$(EXTRAS_AUTOTEXTUSER_MIMEFILES_FILTER
) && \
47 zip
-qrX
--must-match
$@
$(EXTRAS_AUTOTEXTUSER_XMLFILES_FILTER
) \
49 $(call gb_Trace_EndRange
,autotext
/user
/$*.bau
,ZIP
)
51 define extras_Autotextuser_make_file_deps
52 $(call gb_CustomTarget_get_workdir
,$(1)/user
)/$(2) : $(SRCDIR
)/$(1)/$(2) \
53 |
$(dir $(call gb_CustomTarget_get_workdir
,$(1)/user
)/$(2)).
dir
57 define extras_Autotextuser_make_zip_deps
58 $(call gb_CustomTarget_get_workdir
,$(1)/user
)/$(2) : \
59 $(addprefix $(call gb_CustomTarget_get_workdir
,$(1)/user
)/,$(filter $(3)/%,$(extras_AUTOTEXTUSER_MIMETYPEFILES
) $(extras_AUTOTEXTUSER_XMLFILES
))) \
60 |
$(dir $(call gb_CustomTarget_get_workdir
,$(1)/user
)/$(2)).
dir
62 $(call gb_CustomTarget_get_workdir
,$(1)/user
)/$(2) : \
63 EXTRAS_AUTOTEXTUSER_MIMEFILES_FILTER
:= $(foreach file
,$(filter $(3)/%,$(extras_AUTOTEXTUSER_MIMETYPEFILES
)),$(subst $(3)/,,$(file
)))
64 $(call gb_CustomTarget_get_workdir
,$(1)/user
)/$(2) : \
65 EXTRAS_AUTOTEXTUSER_XMLFILES_FILTER
:= $(foreach file
,$(filter $(3)/%,$(extras_AUTOTEXTUSER_XMLFILES
)),$(subst $(3)/,,$(file
)))
66 $(call gb_CustomTarget_get_workdir
,$(1)/user
)/$(2) : \
67 EXTRAS_AUTOTEXTUSER_DIR
:= $(call gb_CustomTarget_get_workdir
,$(1)/user
)/$(3)
71 $(eval
$(foreach file
,$(extras_AUTOTEXTUSER_MIMETYPEFILES
) $(extras_AUTOTEXTUSER_XMLFILES
),\
72 $(call extras_Autotextuser_make_file_deps
,extras
/source
/autotext
,$(file
)) \
75 $(eval
$(foreach atexts
,$(extras_AUTOTEXTUSER_AUTOTEXTS
),\
76 $(call extras_Autotextuser_make_zip_deps
,extras
/source
/autotext
,$(atexts
).bau
,$(atexts
)) \
79 # vim: set noet sw=4 ts=4: