bump product version to 7.2.5.1
[LibreOffice.git] / solenv / gbuild / AllLangHelp.mk
blob32d38166d53f8567094d0ceb7cda689824e19127
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 $(call gb_Trace_MakeMark,$*,ALH)
37 endif
38 touch $@
40 $(call gb_AllLangHelp_get_clean_target,%) :
41 ifeq ($(ENABLE_HTMLHELP),)
42 $(call gb_Output_announce,$*,$(false),ALH,5)
43 endif
44 $(call gb_Helper_abbreviate_dirs,\
45 rm -f $(call gb_AllLangHelp_get_target,$*) $(call gb_AllLangHelp_get_helpfiles_target,$*) \
48 # gb_AllLangHelp_AllLangHelp__one_lang module lang helpname
49 define gb_AllLangHelp_AllLangHelp__one_lang
50 $(call gb_HelpTarget_HelpTarget,$(3),$(1),$(2))
51 $(call gb_HelpTarget_set_helpdir,$(3),$(gb_AllLangHelp_HELPDIR))
53 $(call gb_AllLangHelp_get_target,$(1)) : $(call gb_HelpTarget_get_target,$(3))
54 ifeq ($(ENABLE_HTMLHELP),)
55 $(call gb_AllLangHelp_get_target,$(1)) : $(call gb_Package_get_target,$(call gb_HelpTarget_get_packagename,$(3)))
56 endif
57 $(call gb_AllLangHelp_get_clean_target,$(1)) : $(call gb_HelpTarget_get_clean_target,$(3))
58 ifeq ($(ENABLE_HTMLHELP),)
59 $(call gb_AllLangHelp_get_clean_target,$(1)) : $(call gb_Package_get_clean_target,$(call gb_HelpTarget_get_packagename,$(3)))
60 endif
62 endef
64 # Create and deliver help packs for a module for all languages.
66 # gb_AllLangHelp_AllLangHelp module
67 gb_AllLangHelp_ALLTARGETS :=
69 define gb_AllLangHelp_AllLangHelp
70 gb_AllLangHelp_ALLTARGETS += $(1)
71 $(foreach lang,$(gb_HELP_LANGS),\
72 $(call gb_AllLangHelp_AllLangHelp__one_lang,$(1),$(lang),$(call gb_AllLangHelp__get_helpname,$(1),$(lang))))
74 $(call gb_AllLangHelp_get_target,$(1)) :| $(dir $(call gb_AllLangHelp_get_target,$(1))).dir
76 $$(eval $$(call gb_Module_register_target,$(call gb_AllLangHelp_get_target,$(1)),$(call gb_AllLangHelp_get_clean_target,$(1))))
77 $(call gb_Helper_make_userfriendly_targets,$(1),AllLangHelp)
79 endef
81 # gb_AllLangHelp_set_treefile module treefile
82 define gb_AllLangHelp_set_treefile
83 $(foreach lang,$(gb_HELP_LANGS),\
84 $(call gb_HelpTarget_set_treefile,$(call gb_AllLangHelp__get_helpname,$(1),$(lang)),$(2),$(gb_AllLangHelp_HELPDIR)/text) \
87 endef
89 # Add one or more help files.
91 # gb_AllLangHelp_add_helpfiles module file(s) [optional bookmark token]
92 define gb_AllLangHelp_add_helpfiles
93 $(foreach lang,$(gb_HELP_LANGS),\
94 $(call gb_HelpTarget_add_helpfiles,$(call gb_AllLangHelp__get_helpname,$(1),$(lang)),$(2)) \
96 ifneq ($(ENABLE_HTMLHELP),)
97 gb_AllLangHelp_$(1)_HELPFILES += $(addsuffix .xhp,$(2))
98 gb_AllLangHelp_$(or $(3),$(1))_BOOKMARK_HELPFILES += $(addsuffix .xhp,$(2))
99 $(call gb_AllLangHelp_get_helpfiles_target,$(1)): $(addprefix $(SRCDIR)/,$(addsuffix .xhp,$(2)))
100 endif
102 endef
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))) \
112 endef
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)) \
124 endef
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)))
130 endef
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)))
138 endef
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)))
146 endef
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))
154 endef
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)))
162 endef
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)))
170 endef
172 # vim: set noet sw=4 ts=4: