bump product version to 4.1.6.2
[LibreOffice.git] / solenv / gbuild / AllLangHelp.mk
bloba5547dd27c86e10ab07312bf05b03922ea98fc58
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 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)
61 endef
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) \
69 endef
71 # Add a help file.
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)) \
79 endef
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)) \
89 endef
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)) \
99 endef
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))) \
109 endef
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)) \
121 endef
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)))
127 endef
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)))
135 endef
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)))
143 endef
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))
151 endef
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)))
159 endef
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)))
167 endef
169 # vim: set noet sw=4 ts=4: