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 define gb_AllLangHelp_AllLangHelp
53 $(foreach lang
,$(gb_HELP_LANGS
),\
54 $(call gb_AllLangHelp_AllLangHelp__one_lang
,$(1),$(lang
),$(call gb_AllLangHelp__get_helpname
,$(1),$(lang
))))
56 $(call gb_AllLangHelp_get_target
,$(1)) :|
$(dir $(call gb_AllLangHelp_get_target
,$(1))).
dir
58 $$(eval
$$(call gb_Module_register_target
,$(call gb_AllLangHelp_get_target
,$(1)),$(call gb_AllLangHelp_get_clean_target
,$(1))))
59 $(call gb_Helper_make_userfriendly_targets
,$(1),AllLangHelp
)
63 # gb_AllLangHelp_set_treefile module treefile
64 define gb_AllLangHelp_set_treefile
65 $(foreach lang
,$(gb_HELP_LANGS
),\
66 $(call gb_HelpTarget_set_treefile
,$(call gb_AllLangHelp__get_helpname
,$(1),$(lang
)),$(2),$(gb_AllLangHelp_HELPDIR
)/text
) \
73 # gb_AllLangHelp_add_helpfile module file
74 define gb_AllLangHelp_add_helpfile
75 $(foreach lang
,$(gb_HELP_LANGS
),\
76 $(call gb_HelpTarget_add_helpfile
,$(call gb_AllLangHelp__get_helpname
,$(1),$(lang
)),$(2)) \
81 # Add one or more help files.
83 # gb_AllLangHelp_add_helpfiles module file(s)
84 define gb_AllLangHelp_add_helpfiles
85 $(foreach lang
,$(gb_HELP_LANGS
),\
86 $(call gb_HelpTarget_add_helpfiles
,$(call gb_AllLangHelp__get_helpname
,$(1),$(lang
)),$(2)) \
91 # Add additional localized file to the help pack.
93 # gb_AllLangHelp_add_localized_file module basedir file
94 define gb_AllLangHelp_add_localized_file
95 $(foreach lang
,$(gb_HELP_LANGS
),\
96 $(call gb_HelpTarget_add_file
,$(call gb_AllLangHelp__get_helpname
,$(1),$(lang
)),$(2)/$(lang
)/$(3)) \
101 # Add additional localized file(s) to the help pack.
103 # gb_AllLangHelp_add_localized_files module basedir file(s)
104 define gb_AllLangHelp_add_localized_files
105 $(foreach lang
,$(gb_HELP_LANGS
),\
106 $(call gb_HelpTarget_add_files
,$(call gb_AllLangHelp__get_helpname
,$(1),$(lang
)),$(addprefix $(2)/$(lang
)/,$(3))) \
111 # Add a localized file from helpdir under a new name.
113 # This is a hack needed for err.html in shared help module.
115 # gb_AllLangHelp_add_helpdir_file module filename file
116 define gb_AllLangHelp_add_helpdir_file
117 $(foreach lang
,$(gb_HELP_LANGS
),\
118 $(call gb_HelpTarget_add_helpdir_file
,$(call gb_AllLangHelp__get_helpname
,$(1),$(lang
)),$(2),$(3)) \
123 # gb_AllLangHelp__use_module module other-module lang
124 define gb_AllLangHelp__use_module
125 $(call gb_HelpTarget_use_module
,$(call gb_AllLangHelp__get_helpname
,$(1),$(3)),$(call gb_AllLangHelp__get_helpname
,$(2),$(3)))
129 # Use references from another help module's files.
131 # gb_AllLangHelp_use_module module other-module
132 define gb_AllLangHelp_use_module
133 $(foreach lang
,$(gb_HELP_LANGS
),$(call gb_AllLangHelp__use_module
,$(1),$(2),$(lang
)))
137 # Use references from other help modules' files.
139 # gb_AllLangHelp_use_module module other-module(s)
140 define gb_AllLangHelp_use_modules
141 $(foreach module
,$(2),$(call gb_AllLangHelp_use_module
,$(1),$(module
)))
145 # gb_AllLangHelp__use_linked_module module other-module lang
146 define gb_AllLangHelp__use_linked_module
147 $(call gb_HelpTarget_use_linked_module
,$(call gb_AllLangHelp__get_helpname
,$(1),$(3)),$(call gb_AllLangHelp__get_helpname
,$(2),$(3)))
148 $(call gb_HelpTarget_set_indexed
,$(call gb_AllLangHelp__get_helpname
,$(1),$(3)))
149 $(call gb_HelpTarget_set_configfile
,$(call gb_AllLangHelp__get_helpname
,$(1),$(3)),$(gb_AllLangHelp_AUXDIR
)/$(3)/$(1))
153 # Link with another help module.
155 # gb_AllLangHelp_use_linked_module module other-module
156 define gb_AllLangHelp_use_linked_module
157 $(foreach lang
,$(gb_HELP_LANGS
),$(call gb_AllLangHelp__use_linked_module
,$(1),$(2),$(lang
)))
161 # Link with other help module(s).
163 # gb_AllLangHelp_use_linked_module module other-module(s)
164 define gb_AllLangHelp_use_linked_modules
165 $(foreach module
,$(2),$(call gb_AllLangHelp_use_linked_module
,$(1),$(module
)))
169 # vim: set noet sw=4 ts=4: