bump product version to 5.0.4.1
[LibreOffice.git] / extras / CustomTarget_autotextuser.mk
blob6b161497ebd0d1b88f7964e98f5b88ffa0776dcb
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 ifneq ($(sort $(foreach file,$(extras_AUTOTEXTUSER_XMLFILES),$(firstword $(subst /, ,$(file))))),$(sort $(extras_AUTOTEXTUSER_AUTOTEXTS)))
26 $(call gb_Output_error,defined user autotext do not match existing directories)
27 endif
29 $(call gb_CustomTarget_get_target,extras/source/autotext/user) : \
30 $(foreach atexts,$(extras_AUTOTEXTUSER_AUTOTEXTS),$(call gb_CustomTarget_get_workdir,extras/source/autotext/user)/$(atexts).bau)
32 $(call gb_CustomTarget_get_workdir,extras/source/autotext/user)/%/mimetype : $(SRCDIR)/extras/source/autotext/%/mimetype
33 $(call gb_Output_announce,$*/mimetype,$(true),CPY,1)
34 cp $< $@
36 $(call gb_CustomTarget_get_workdir,extras/source/autotext/user)/%.xml : $(SRCDIR)/extras/source/autotext/%.xml \
37 | $(call gb_ExternalExecutable_get_dependencies,xsltproc)
38 $(call gb_Output_announce,$*.xml,$(true),XSL,1)
39 $(call gb_ExternalExecutable_get_command,xsltproc) -o $@ $(SRCDIR)/extras/util/compact.xsl $<
41 $(call gb_CustomTarget_get_workdir,extras/source/autotext/user)/%.bau :
42 $(call gb_Output_announce,$*.bau,$(true),ZIP,2)
43 $(call gb_Helper_abbreviate_dirs,\
44 cd $(EXTRAS_AUTOTEXTUSER_DIR) && \
45 zip -qrX --filesync --must-match $@ $(EXTRAS_AUTOTEXTUSER_FILES) \
48 define extras_Autotextuser_make_file_deps
49 $(call gb_CustomTarget_get_workdir,$(1)/user)/$(2) : $(SRCDIR)/$(1)/$(2) \
50 | $(dir $(call gb_CustomTarget_get_workdir,$(1)/user)/$(2)).dir
52 endef
54 define extras_Autotextuser_make_zip_deps
55 $(call gb_CustomTarget_get_workdir,$(1)/user)/$(2) : \
56 $(addprefix $(call gb_CustomTarget_get_workdir,$(1)/user)/,$(filter $(3)/%,$(extras_AUTOTEXTUSER_MIMETYPEFILES) $(extras_AUTOTEXTUSER_XMLFILES))) \
57 | $(dir $(call gb_CustomTarget_get_workdir,$(1)/user)/$(2)).dir
59 $(call gb_CustomTarget_get_workdir,$(1)/user)/$(2) : \
60 EXTRAS_AUTOTEXTUSER_FILES := $(foreach file,$(filter $(3)/%,$(extras_AUTOTEXTUSER_MIMETYPEFILES) $(extras_AUTOTEXTUSER_XMLFILES)),$(subst $(3)/,,$(file)))
61 $(call gb_CustomTarget_get_workdir,$(1)/user)/$(2) : \
62 EXTRAS_AUTOTEXTUSER_DIR := $(call gb_CustomTarget_get_workdir,$(1)/user)/$(3)
64 endef
66 $(eval $(foreach file,$(extras_AUTOTEXTUSER_MIMETYPEFILES) $(extras_AUTOTEXTUSER_XMLFILES),\
67 $(call extras_Autotextuser_make_file_deps,extras/source/autotext,$(file)) \
70 $(eval $(foreach atexts,$(extras_AUTOTEXTUSER_AUTOTEXTS),\
71 $(call extras_Autotextuser_make_zip_deps,extras/source/autotext,$(atexts).bau,$(atexts)) \
74 # vim: set noet sw=4 ts=4: