Version 6.1.0.2, tag libreoffice-6.1.0.2
[LibreOffice.git] / solenv / gbuild / AllLangHelp.mk
blob475e7c0b326cf93a7f322b3bd6d7c77c97704574
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 ifneq ($(ENABLE_HTMLHELP),)
22 $(call gb_AllLangHelp_get_helpfiles_target,%): | \
23 $(dir $(call gb_AllLangHelp_get_helpfiles_target,%)).dir
24 touch $@
25 endif
27 $(dir $(call gb_AllLangHelp_get_target,%)).dir :
28 $(if $(wildcard $(dir $@)),,mkdir -p $(dir $@))
30 $(dir $(call gb_AllLangHelp_get_target,%))%/.dir :
31 $(if $(wildcard $(dir $@)),,mkdir -p $(dir $@))
33 $(call gb_AllLangHelp_get_target,%) :
34 ifeq ($(ENABLE_HTMLHELP),)
35 $(call gb_Output_announce,$*,$(true),ALH,5)
36 endif
37 touch $@
39 $(call gb_AllLangHelp_get_clean_target,%) :
40 ifeq ($(ENABLE_HTMLHELP),)
41 $(call gb_Output_announce,$*,$(false),ALH,5)
42 endif
43 $(call gb_Helper_abbreviate_dirs,\
44 rm -f $(call gb_AllLangHelp_get_target,$*) $(call gb_AllLangHelp_get_helpfiles_target,$*) \
47 # gb_AllLangHelp_AllLangHelp__one_lang module lang helpname
48 define gb_AllLangHelp_AllLangHelp__one_lang
49 $(call gb_HelpTarget_HelpTarget,$(3),$(1),$(2))
50 $(call gb_HelpTarget_set_helpdir,$(3),$(gb_AllLangHelp_HELPDIR))
52 $(call gb_AllLangHelp_get_target,$(1)) : $(call gb_HelpTarget_get_target,$(3))
53 ifeq ($(ENABLE_HTMLHELP),)
54 $(call gb_AllLangHelp_get_target,$(1)) : $(call gb_Package_get_target,$(call gb_HelpTarget_get_packagename,$(3)))
55 endif
56 $(call gb_AllLangHelp_get_clean_target,$(1)) : $(call gb_HelpTarget_get_clean_target,$(3))
57 ifeq ($(ENABLE_HTMLHELP),)
58 $(call gb_AllLangHelp_get_clean_target,$(1)) : $(call gb_Package_get_clean_target,$(call gb_HelpTarget_get_packagename,$(3)))
59 endif
61 endef
63 # Create and deliver help packs for a module for all languages.
65 # gb_AllLangHelp_AllLangHelp module
66 gb_AllLangHelp_ALLTARGETS :=
68 define gb_AllLangHelp_AllLangHelp
69 gb_AllLangHelp_ALLTARGETS += $(1)
70 $(foreach lang,$(gb_HELP_LANGS),\
71 $(call gb_AllLangHelp_AllLangHelp__one_lang,$(1),$(lang),$(call gb_AllLangHelp__get_helpname,$(1),$(lang))))
73 $(call gb_AllLangHelp_get_target,$(1)) :| $(dir $(call gb_AllLangHelp_get_target,$(1))).dir
75 $$(eval $$(call gb_Module_register_target,$(call gb_AllLangHelp_get_target,$(1)),$(call gb_AllLangHelp_get_clean_target,$(1))))
76 $(call gb_Helper_make_userfriendly_targets,$(1),AllLangHelp)
78 endef
80 # gb_AllLangHelp_set_treefile module treefile
81 define gb_AllLangHelp_set_treefile
82 $(foreach lang,$(gb_HELP_LANGS),\
83 $(call gb_HelpTarget_set_treefile,$(call gb_AllLangHelp__get_helpname,$(1),$(lang)),$(2),$(gb_AllLangHelp_HELPDIR)/text) \
86 endef
88 # Add a help file.
90 # gb_AllLangHelp_add_helpfile module file
91 define gb_AllLangHelp_add_helpfile
92 $(foreach lang,$(gb_HELP_LANGS),\
93 $(call gb_HelpTarget_add_helpfile,$(call gb_AllLangHelp__get_helpname,$(1),$(lang)),$(2)) \
96 endef
98 # Add one or more help files.
100 # gb_AllLangHelp_add_helpfiles module file(s)
101 define gb_AllLangHelp_add_helpfiles
102 $(foreach lang,$(gb_HELP_LANGS),\
103 $(call gb_HelpTarget_add_helpfiles,$(call gb_AllLangHelp__get_helpname,$(1),$(lang)),$(2)) \
105 ifneq ($(ENABLE_HTMLHELP),)
106 gb_AllLangHelp_$(1)_HELPFILES += $(addsuffix .xhp,$(2))
107 $(call gb_AllLangHelp_get_helpfiles_target,$(1)): $(addprefix $(SRCDIR)/,$(addsuffix .xhp,$(2)))
108 endif
110 endef
112 # Add additional localized file to the help pack.
114 # gb_AllLangHelp_add_localized_file module basedir file
115 define gb_AllLangHelp_add_localized_file
116 $(foreach lang,$(gb_HELP_LANGS),\
117 $(call gb_HelpTarget_add_file,$(call gb_AllLangHelp__get_helpname,$(1),$(lang)),$(2)/$(lang)/$(3)) \
120 endef
122 # Add additional localized file(s) to the help pack.
124 # gb_AllLangHelp_add_localized_files module basedir file(s)
125 define gb_AllLangHelp_add_localized_files
126 $(foreach lang,$(gb_HELP_LANGS),\
127 $(call gb_HelpTarget_add_files,$(call gb_AllLangHelp__get_helpname,$(1),$(lang)),$(addprefix $(2)/$(lang)/,$(3))) \
130 endef
132 # Add a localized file from helpdir under a new name.
134 # This is a hack needed for err.html in shared help module.
136 # gb_AllLangHelp_add_helpdir_file module filename file
137 define gb_AllLangHelp_add_helpdir_file
138 $(foreach lang,$(gb_HELP_LANGS),\
139 $(call gb_HelpTarget_add_helpdir_file,$(call gb_AllLangHelp__get_helpname,$(1),$(lang)),$(2),$(3)) \
142 endef
144 # gb_AllLangHelp__use_module module other-module lang
145 define gb_AllLangHelp__use_module
146 $(call gb_HelpTarget_use_module,$(call gb_AllLangHelp__get_helpname,$(1),$(3)),$(call gb_AllLangHelp__get_helpname,$(2),$(3)))
148 endef
150 # Use references from another help module's files.
152 # gb_AllLangHelp_use_module module other-module
153 define gb_AllLangHelp_use_module
154 $(foreach lang,$(gb_HELP_LANGS),$(call gb_AllLangHelp__use_module,$(1),$(2),$(lang)))
156 endef
158 # Use references from other help modules' files.
160 # gb_AllLangHelp_use_module module other-module(s)
161 define gb_AllLangHelp_use_modules
162 $(foreach module,$(2),$(call gb_AllLangHelp_use_module,$(1),$(module)))
164 endef
166 # gb_AllLangHelp__use_linked_module module other-module lang
167 define gb_AllLangHelp__use_linked_module
168 $(call gb_HelpTarget_use_linked_module,$(call gb_AllLangHelp__get_helpname,$(1),$(3)),$(call gb_AllLangHelp__get_helpname,$(2),$(3)))
169 $(call gb_HelpTarget_set_indexed,$(call gb_AllLangHelp__get_helpname,$(1),$(3)))
170 $(call gb_HelpTarget_set_configfile,$(call gb_AllLangHelp__get_helpname,$(1),$(3)),$(gb_AllLangHelp_AUXDIR)/$(3)/$(1))
172 endef
174 # Link with another help module.
176 # gb_AllLangHelp_use_linked_module module other-module
177 define gb_AllLangHelp_use_linked_module
178 $(foreach lang,$(gb_HELP_LANGS),$(call gb_AllLangHelp__use_linked_module,$(1),$(2),$(lang)))
180 endef
182 # Link with other help module(s).
184 # gb_AllLangHelp_use_linked_module module other-module(s)
185 define gb_AllLangHelp_use_linked_modules
186 $(foreach module,$(2),$(call gb_AllLangHelp_use_linked_module,$(1),$(module)))
188 endef
190 # vim: set noet sw=4 ts=4: