Bump version to 6.4.7.2.M8
[LibreOffice.git] / solenv / gbuild / AllLangHelp.mk
blobd013c16cfe3a40cb7ae94c0f6bd053f18f92c8ea
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,AllLangHelp_$(1),$(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 one or more help files.
90 # gb_AllLangHelp_add_helpfiles module file(s) [optional bookmark token]
91 define gb_AllLangHelp_add_helpfiles
92 $(foreach lang,$(gb_HELP_LANGS),\
93 $(call gb_HelpTarget_add_helpfiles,$(call gb_AllLangHelp__get_helpname,$(1),$(lang)),$(2)) \
95 ifneq ($(ENABLE_HTMLHELP),)
96 gb_AllLangHelp_$(1)_HELPFILES += $(addsuffix .xhp,$(2))
97 gb_AllLangHelp_$(or $(3),$(1))_BOOKMARK_HELPFILES += $(addsuffix .xhp,$(2))
98 $(call gb_AllLangHelp_get_helpfiles_target,$(1)): $(addprefix $(SRCDIR)/,$(addsuffix .xhp,$(2)))
99 endif
101 endef
103 # Add additional localized file(s) to the help pack.
105 # gb_AllLangHelp_add_localized_files module basedir file(s)
106 define gb_AllLangHelp_add_localized_files
107 $(foreach lang,$(gb_HELP_LANGS),\
108 $(call gb_HelpTarget_add_files,$(call gb_AllLangHelp__get_helpname,$(1),$(lang)),$(addprefix $(2)/$(lang)/,$(3))) \
111 endef
113 # Add a localized file from helpdir under a new name.
115 # This is a hack needed for err.html in shared help module.
117 # gb_AllLangHelp_add_helpdir_file module filename file
118 define gb_AllLangHelp_add_helpdir_file
119 $(foreach lang,$(gb_HELP_LANGS),\
120 $(call gb_HelpTarget_add_helpdir_file,$(call gb_AllLangHelp__get_helpname,$(1),$(lang)),$(2),$(3)) \
123 endef
125 # gb_AllLangHelp__use_module module other-module lang
126 define gb_AllLangHelp__use_module
127 $(call gb_HelpTarget_use_module,$(call gb_AllLangHelp__get_helpname,$(1),$(3)),$(call gb_AllLangHelp__get_helpname,$(2),$(3)))
129 endef
131 # Use references from another help module's files.
133 # gb_AllLangHelp_use_module module other-module
134 define gb_AllLangHelp_use_module
135 $(foreach lang,$(gb_HELP_LANGS),$(call gb_AllLangHelp__use_module,$(1),$(2),$(lang)))
137 endef
139 # Use references from other help modules' files.
141 # gb_AllLangHelp_use_module module other-module(s)
142 define gb_AllLangHelp_use_modules
143 $(foreach module,$(2),$(call gb_AllLangHelp_use_module,$(1),$(module)))
145 endef
147 # gb_AllLangHelp__use_linked_module module other-module lang
148 define gb_AllLangHelp__use_linked_module
149 $(call gb_HelpTarget_use_linked_module,$(call gb_AllLangHelp__get_helpname,$(1),$(3)),$(call gb_AllLangHelp__get_helpname,$(2),$(3)))
150 $(call gb_HelpTarget_set_indexed,$(call gb_AllLangHelp__get_helpname,$(1),$(3)))
151 $(call gb_HelpTarget_set_configfile,$(call gb_AllLangHelp__get_helpname,$(1),$(3)),$(gb_AllLangHelp_AUXDIR)/$(3)/$(1))
153 endef
155 # Link with another help module.
157 # gb_AllLangHelp_use_linked_module module other-module
158 define gb_AllLangHelp_use_linked_module
159 $(foreach lang,$(gb_HELP_LANGS),$(call gb_AllLangHelp__use_linked_module,$(1),$(2),$(lang)))
161 endef
163 # Link with other help module(s).
165 # gb_AllLangHelp_use_linked_module module other-module(s)
166 define gb_AllLangHelp_use_linked_modules
167 $(foreach module,$(2),$(call gb_AllLangHelp_use_linked_module,$(1),$(module)))
169 endef
171 # vim: set noet sw=4 ts=4: