Branch libreoffice-5-0-4
[LibreOffice.git] / solenv / gbuild / AllLangHelp.mk
blobdca6c7090b07e26cca9d3c2fd3852979aedd0979
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 # class AllLangHelp
12 # Creates and delivers all language versions of a module.
14 gb_AllLangHelp_HELPDIRNAME := helpcontent2
15 gb_AllLangHelp_AUXDIRNAME := auxiliary
16 gb_AllLangHelp_HELPDIR := $(gb_AllLangHelp_HELPDIRNAME)/source
17 gb_AllLangHelp_AUXDIR := $(gb_AllLangHelp_HELPDIR)/$(gb_AllLangHelp_AUXDIRNAME)
19 gb_AllLangHelp__get_helpname = $(1)/$(2)
21 $(dir $(call gb_AllLangHelp_get_target,%)).dir :
22 $(if $(wildcard $(dir $@)),,mkdir -p $(dir $@))
24 $(dir $(call gb_AllLangHelp_get_target,%))%/.dir :
25 $(if $(wildcard $(dir $@)),,mkdir -p $(dir $@))
27 $(call gb_AllLangHelp_get_target,%) :
28 $(call gb_Output_announce,$*,$(true),ALH,5)
29 touch $@
31 $(call gb_AllLangHelp_get_clean_target,%) :
32 $(call gb_Output_announce,$*,$(false),ALH,5)
33 $(call gb_Helper_abbreviate_dirs,\
34 rm -f $(call gb_AllLangHelp_get_target,$*) \
37 # gb_AllLangHelp_AllLangHelp__one_lang module lang helpname
38 define gb_AllLangHelp_AllLangHelp__one_lang
39 $(call gb_HelpTarget_HelpTarget,$(3),$(1),$(2))
40 $(call gb_HelpTarget_set_helpdir,$(3),$(gb_AllLangHelp_HELPDIR))
42 $(call gb_AllLangHelp_get_target,$(1)) : $(call gb_HelpTarget_get_target,$(3))
43 $(call gb_AllLangHelp_get_target,$(1)) : $(call gb_Package_get_target,$(call gb_HelpTarget_get_packagename,$(3)))
44 $(call gb_AllLangHelp_get_clean_target,$(1)) : $(call gb_HelpTarget_get_clean_target,$(3))
45 $(call gb_AllLangHelp_get_clean_target,$(1)) : $(call gb_Package_get_clean_target,$(call gb_HelpTarget_get_packagename,$(3)))
47 endef
49 # Create and deliver help packs for a module for all languages.
51 # gb_AllLangHelp_AllLangHelp module
52 gb_AllLangHelp_ALLTARGETS :=
54 define gb_AllLangHelp_AllLangHelp
55 gb_AllLangHelp_ALLTARGETS += $(1)
56 $(foreach lang,$(gb_HELP_LANGS),\
57 $(call gb_AllLangHelp_AllLangHelp__one_lang,$(1),$(lang),$(call gb_AllLangHelp__get_helpname,$(1),$(lang))))
59 $(call gb_AllLangHelp_get_target,$(1)) :| $(dir $(call gb_AllLangHelp_get_target,$(1))).dir
61 $$(eval $$(call gb_Module_register_target,$(call gb_AllLangHelp_get_target,$(1)),$(call gb_AllLangHelp_get_clean_target,$(1))))
62 $(call gb_Helper_make_userfriendly_targets,$(1),AllLangHelp)
64 endef
66 # gb_AllLangHelp_set_treefile module treefile
67 define gb_AllLangHelp_set_treefile
68 $(foreach lang,$(gb_HELP_LANGS),\
69 $(call gb_HelpTarget_set_treefile,$(call gb_AllLangHelp__get_helpname,$(1),$(lang)),$(2),$(gb_AllLangHelp_HELPDIR)/text) \
72 endef
74 # Add a help file.
76 # gb_AllLangHelp_add_helpfile module file
77 define gb_AllLangHelp_add_helpfile
78 $(foreach lang,$(gb_HELP_LANGS),\
79 $(call gb_HelpTarget_add_helpfile,$(call gb_AllLangHelp__get_helpname,$(1),$(lang)),$(2)) \
82 endef
84 # Add one or more help files.
86 # gb_AllLangHelp_add_helpfiles module file(s)
87 define gb_AllLangHelp_add_helpfiles
88 $(foreach lang,$(gb_HELP_LANGS),\
89 $(call gb_HelpTarget_add_helpfiles,$(call gb_AllLangHelp__get_helpname,$(1),$(lang)),$(2)) \
92 endef
94 # Add additional localized file to the help pack.
96 # gb_AllLangHelp_add_localized_file module basedir file
97 define gb_AllLangHelp_add_localized_file
98 $(foreach lang,$(gb_HELP_LANGS),\
99 $(call gb_HelpTarget_add_file,$(call gb_AllLangHelp__get_helpname,$(1),$(lang)),$(2)/$(lang)/$(3)) \
102 endef
104 # Add additional localized file(s) to the help pack.
106 # gb_AllLangHelp_add_localized_files module basedir file(s)
107 define gb_AllLangHelp_add_localized_files
108 $(foreach lang,$(gb_HELP_LANGS),\
109 $(call gb_HelpTarget_add_files,$(call gb_AllLangHelp__get_helpname,$(1),$(lang)),$(addprefix $(2)/$(lang)/,$(3))) \
112 endef
114 # Add a localized file from helpdir under a new name.
116 # This is a hack needed for err.html in shared help module.
118 # gb_AllLangHelp_add_helpdir_file module filename file
119 define gb_AllLangHelp_add_helpdir_file
120 $(foreach lang,$(gb_HELP_LANGS),\
121 $(call gb_HelpTarget_add_helpdir_file,$(call gb_AllLangHelp__get_helpname,$(1),$(lang)),$(2),$(3)) \
124 endef
126 # gb_AllLangHelp__use_module module other-module lang
127 define gb_AllLangHelp__use_module
128 $(call gb_HelpTarget_use_module,$(call gb_AllLangHelp__get_helpname,$(1),$(3)),$(call gb_AllLangHelp__get_helpname,$(2),$(3)))
130 endef
132 # Use references from another help module's files.
134 # gb_AllLangHelp_use_module module other-module
135 define gb_AllLangHelp_use_module
136 $(foreach lang,$(gb_HELP_LANGS),$(call gb_AllLangHelp__use_module,$(1),$(2),$(lang)))
138 endef
140 # Use references from other help modules' files.
142 # gb_AllLangHelp_use_module module other-module(s)
143 define gb_AllLangHelp_use_modules
144 $(foreach module,$(2),$(call gb_AllLangHelp_use_module,$(1),$(module)))
146 endef
148 # gb_AllLangHelp__use_linked_module module other-module lang
149 define gb_AllLangHelp__use_linked_module
150 $(call gb_HelpTarget_use_linked_module,$(call gb_AllLangHelp__get_helpname,$(1),$(3)),$(call gb_AllLangHelp__get_helpname,$(2),$(3)))
151 $(call gb_HelpTarget_set_indexed,$(call gb_AllLangHelp__get_helpname,$(1),$(3)))
152 $(call gb_HelpTarget_set_configfile,$(call gb_AllLangHelp__get_helpname,$(1),$(3)),$(gb_AllLangHelp_AUXDIR)/$(3)/$(1))
154 endef
156 # Link with another help module.
158 # gb_AllLangHelp_use_linked_module module other-module
159 define gb_AllLangHelp_use_linked_module
160 $(foreach lang,$(gb_HELP_LANGS),$(call gb_AllLangHelp__use_linked_module,$(1),$(2),$(lang)))
162 endef
164 # Link with other help module(s).
166 # gb_AllLangHelp_use_linked_module module other-module(s)
167 define gb_AllLangHelp_use_linked_modules
168 $(foreach module,$(2),$(call gb_AllLangHelp_use_linked_module,$(1),$(module)))
170 endef
172 # vim: set noet sw=4 ts=4: