Version 6.4.0.0.beta1, tag libreoffice-6.4.0.0.beta1
[LibreOffice.git] / extras / CustomTarget_autotextuser.mk
blob95d0bf08034052026b65b1f43f6cf4a19dfcb2a0
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 := \
13 mytexts \
16 extras_AUTOTEXTUSER_XMLFILES := \
17 mytexts/BlockList.xml \
18 mytexts/META-INF/manifest.xml \
21 extras_AUTOTEXTUSER_MIMETYPEFILES := \
22 mytexts/mimetype \
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 cp $< $@
32 $(call gb_CustomTarget_get_workdir,extras/source/autotext/user)/%.xml : $(SRCDIR)/extras/source/autotext/%.xml \
33 | $(call gb_ExternalExecutable_get_dependencies,xsltproc)
34 $(call gb_Output_announce,autotext/user/$*.xml,$(true),XSL,1)
35 $(call gb_ExternalExecutable_get_command,xsltproc) --nonet -o $@ $(SRCDIR)/extras/util/compact.xsl $<
37 $(call gb_CustomTarget_get_workdir,extras/source/autotext/user)/%.bau :
38 $(call gb_Output_announce,autotext/user/$*.bau,$(true),ZIP,2)
39 $(call gb_Helper_abbreviate_dirs,\
40 cd $(EXTRAS_AUTOTEXTUSER_DIR) && \
41 zip -q0X --filesync --must-match $@ $(EXTRAS_AUTOTEXTUSER_MIMEFILES_FILTER) && \
42 zip -qrX --must-match $@ $(EXTRAS_AUTOTEXTUSER_XMLFILES_FILTER) \
45 define extras_Autotextuser_make_file_deps
46 $(call gb_CustomTarget_get_workdir,$(1)/user)/$(2) : $(SRCDIR)/$(1)/$(2) \
47 | $(dir $(call gb_CustomTarget_get_workdir,$(1)/user)/$(2)).dir
49 endef
51 define extras_Autotextuser_make_zip_deps
52 $(call gb_CustomTarget_get_workdir,$(1)/user)/$(2) : \
53 $(addprefix $(call gb_CustomTarget_get_workdir,$(1)/user)/,$(filter $(3)/%,$(extras_AUTOTEXTUSER_MIMETYPEFILES) $(extras_AUTOTEXTUSER_XMLFILES))) \
54 | $(dir $(call gb_CustomTarget_get_workdir,$(1)/user)/$(2)).dir
56 $(call gb_CustomTarget_get_workdir,$(1)/user)/$(2) : \
57 EXTRAS_AUTOTEXTUSER_MIMEFILES_FILTER := $(foreach file,$(filter $(3)/%,$(extras_AUTOTEXTUSER_MIMETYPEFILES)),$(subst $(3)/,,$(file)))
58 $(call gb_CustomTarget_get_workdir,$(1)/user)/$(2) : \
59 EXTRAS_AUTOTEXTUSER_XMLFILES_FILTER := $(foreach file,$(filter $(3)/%,$(extras_AUTOTEXTUSER_XMLFILES)),$(subst $(3)/,,$(file)))
60 $(call gb_CustomTarget_get_workdir,$(1)/user)/$(2) : \
61 EXTRAS_AUTOTEXTUSER_DIR := $(call gb_CustomTarget_get_workdir,$(1)/user)/$(3)
63 endef
65 $(eval $(foreach file,$(extras_AUTOTEXTUSER_MIMETYPEFILES) $(extras_AUTOTEXTUSER_XMLFILES),\
66 $(call extras_Autotextuser_make_file_deps,extras/source/autotext,$(file)) \
69 $(eval $(foreach atexts,$(extras_AUTOTEXTUSER_AUTOTEXTS),\
70 $(call extras_Autotextuser_make_zip_deps,extras/source/autotext,$(atexts).bau,$(atexts)) \
73 # vim: set noet sw=4 ts=4: