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/.
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)
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)))
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
)
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
) \
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)) \
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)) \
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)) \
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))) \
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)) \
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)))
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
)))
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
)))
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))
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
)))
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
)))
172 # vim: set noet sw=4 ts=4: