bump product version to 6.3.0.0.beta1
[LibreOffice.git] / solenv / gbuild / Extension.mk
blobf23165e1d7bbf8241eec16ae3c8e52711bfe9d7c
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 # Extension class
12 # platform
13 # gb_Extension_LICENSEFILE_DEFAULT
15 gb_Extension__get_preparation_target = $(WORKDIR)/Extension/$(1).prepare
17 gb_Extension_ZIPCOMMAND := zip $(if $(findstring s,$(MAKEFLAGS)),-q)
18 gb_Extension_XRMEXDEPS := $(call gb_Executable_get_runtime_dependencies,xrmex)
19 gb_Extension_XRMEXCOMMAND := $(call gb_Executable_get_command,xrmex)
21 gb_Extension_PROPMERGEDEPS := $(call gb_Executable_get_runtime_dependencies,propex)
22 gb_Extension_PROPMERGECOMMAND := $(call gb_Executable_get_command,propex)
24 gb_Extension_TREEXDEPS := $(call gb_Executable_get_runtime_dependencies,treex)
25 gb_Extension_TREEXCOMMAND := $(call gb_Executable_get_command,treex)
27 gb_Extension_HELPEXDEPS := $(call gb_Executable_get_runtime_dependencies,helpex)
28 gb_Extension_HELPEXCOMMAND := $(call gb_Executable_get_command,helpex)
29 gb_Extension_HELPINDEXERDEPS := $(call gb_Executable_get_runtime_dependencies,HelpIndexer)
30 gb_Extension_HELPINDEXERCOMMAND := $(call gb_Executable_get_command,HelpIndexer)
31 gb_Extension_HELPLINKERDEPS := $(call gb_Executable_get_runtime_dependencies,HelpLinker)
32 gb_Extension_HELPLINKERCOMMAND := $(call gb_Executable_get_command,HelpLinker)
33 # does not contain en-US because it is special cased in gb_Extension_Extension
34 gb_Extension_TRANS_LANGS := $(filter-out en-US,$(gb_WITH_LANG))
35 gb_Extension_ALL_LANGS := en-US $(gb_Extension_TRANS_LANGS)
37 # target ensuring delivery of the extension to instdir
38 gb_Extension__get_final_target = $(WORKDIR)/Extension/$(1).final
40 # Substitute platform or copy if no platform has been set
41 define gb_Extension__subst_platform
42 $(if $(PLATFORM),\
43 sed \
44 -e 's/@PLATFORM@/$(PLATFORM)/' \
45 -e 's/@EXEC_EXTENSION@/$(gb_Executable_EXT)/' \
46 -e 's/@SHARED_EXTENSION@/$(gb_Library_DLLEXT)/' \
47 $(1) > $(2),\
48 cp -f $(1) $(2))
49 endef
51 $(call gb_Extension_get_workdir,%)/.dir :
52 $(if $(wildcard $(dir $@)),,mkdir -p $(dir $@))
54 # remove extension directory in workdir and oxt file in workdir
55 $(call gb_Extension_get_clean_target,%) :
56 $(call gb_Output_announce,$*,$(false),OXT,3)
57 $(call gb_Helper_abbreviate_dirs,\
58 rm -f -r $(call gb_Extension_get_workdir,$*) && \
59 rm -f $(call gb_Extension__get_preparation_target,$*) \
60 $(call gb_Extension_get_target,$*) \
63 $(call gb_Extension__get_final_target,%) :
64 $(call gb_Helper_abbreviate_dirs,\
65 mkdir -p $(dir $@) && touch $@)
67 # preparation target to delay adding files produced by e.g. UnpackedTarball
68 $(call gb_Extension__get_preparation_target,%) :
69 $(call gb_Helper_abbreviate_dirs,\
70 mkdir -p $(dir $@) && touch $@)
72 ifeq ($(strip $(gb_WITH_LANG)),)
73 $(call gb_Extension_get_workdir,%)/description.xml : $(gb_Helper_LANGSTARGET)
74 $(call gb_Output_announce,$*/description.xml,$(true),CPY,3)
75 $(call gb_Helper_abbreviate_dirs,\
76 mkdir -p $(call gb_Extension_get_workdir,$*) && \
77 cp -f $(LOCATION)/description.xml $@)
78 else
79 $(call gb_Extension_get_workdir,%)/description.xml : $(gb_Extension_XRMEXDEPS) $(gb_Helper_LANGSTARGET)
80 $(call gb_Output_announce,$*/description.xml,$(true),XRM,3)
81 MERGEINPUT=$(call var2file,$(shell $(gb_MKTEMP)),100,$(POFILES)) && \
82 $(call gb_Helper_abbreviate_dirs,\
83 mkdir -p $(call gb_Extension_get_workdir,$*) && \
84 $(gb_Extension_XRMEXCOMMAND) \
85 -i $(filter %.xml,$^) \
86 -o $@ \
87 -m $${MERGEINPUT} \
88 -l all) && \
89 rm -rf $${MERGEINPUT}
91 endif
93 # rule to create oxt package in workdir
94 # --filesync makes sure that all files in the oxt package will be removed that no longer are in $(FILES)
95 $(call gb_Extension_get_target,%) : \
96 $(call gb_Extension_get_workdir,%)/description.xml
97 $(call gb_Output_announce,$*,$(true),OXT,3)
98 $(call gb_Helper_abbreviate_dirs,\
99 mkdir -p $(call gb_Extension_get_rootdir,$*)/META-INF \
100 $(if $(LICENSE),$(call gb_Extension_get_rootdir,$*)/registration) && \
101 $(call gb_Extension__subst_platform,$(call gb_Extension_get_workdir,$*)/description.xml,$(call gb_Extension_get_rootdir,$*)/description.xml) && \
102 $(call gb_Extension__subst_platform,$(LOCATION)/META-INF/manifest.xml,$(call gb_Extension_get_rootdir,$*)/META-INF/manifest.xml) && \
103 $(if $(LICENSE),cp -f $(LICENSE) $(call gb_Extension_get_rootdir,$*)/registration &&) \
104 $(if $(and $(gb_Extension_TRANS_LANGS),$(DESCRIPTION)),cp $(foreach lang,$(gb_Extension_TRANS_LANGS),$(call gb_Extension_get_workdir,$*)/description-$(lang).txt) $(call gb_Extension_get_rootdir,$*) &&) \
105 cd $(call gb_Extension_get_rootdir,$*) && \
106 ZIPFILES=$(call var2file,$(shell $(gb_MKTEMP)),500,$(sort $(FILES))) && \
107 $(gb_Extension_ZIPCOMMAND) -rX --filesync --must-match \
108 $(call gb_Extension_get_target,$*) \
109 `cat $${ZIPFILES} | tr -d '\r'` && rm $${ZIPFILES})
111 # set file list and location of manifest and description files
112 # register target and clean target
113 # add deliverable
114 # add dependency for outdir target to workdir target (pattern rule for delivery is in Package.mk)
116 # gb_Extension_Extension extension srcdir nodeliver
117 define gb_Extension_Extension
118 $(call gb_Extension_get_target,$(1)) : DESCRIPTION :=
119 $(call gb_Extension_get_target,$(1)) : FILES := META-INF description.xml
120 $(call gb_Extension_get_target,$(1)) : LICENSE :=
121 $(call gb_Extension_get_target,$(1)) : LOCATION := $(SRCDIR)/$(2)
122 $(call gb_Extension_get_target,$(1)) : PLATFORM := $(PLATFORMID)
123 $(call gb_Extension_get_target,$(1)) : $(SRCDIR)/$(2)/META-INF/manifest.xml
124 $(call gb_Extension_get_workdir,$(1))/description.xml : \
125 $(SRCDIR)/$(2)/description.xml
126 $(call gb_Extension_get_workdir,$(1))/description.xml :| \
127 $(call gb_Extension__get_preparation_target,$(1))
128 $(call gb_Extension__get_final_target,$(1)) : $(call gb_Extension_get_target,$(1))
130 $(if $(filter nodeliver,$(3)),,$(call gb_Extension__Extension_deliver,$(1),Extension/$(1)))
132 ifneq ($(strip $(gb_WITH_LANG)),)
133 $(call gb_Extension_get_target,$(1)) : \
134 POFILES := $(wildcard $(foreach lang,$(gb_TRANS_LANGS),$(gb_POLOCATION)/$(lang)/$(2).po))
135 $(call gb_Extension_get_workdir,$(1))/description.xml : \
136 $(wildcard $(foreach lang,$(gb_TRANS_LANGS),$(gb_POLOCATION)/$(lang)/$(2).po))
137 $(foreach lang,$(gb_TRANS_LANGS),$(gb_POLOCATION)/$(lang)/$(2).po) :
138 endif
140 $(foreach lang,$(gb_Extension_ALL_LANGS), \
141 $(call gb_Extension__compile_help_onelang,$(1),$(lang)))
143 $$(eval $$(call gb_Module_register_target,$(call gb_Extension__get_final_target,$(1)),$(call gb_Extension_get_clean_target,$(1))))
144 $(call gb_Helper_make_userfriendly_targets,$(1),Extension,$(call gb_Extension__get_final_target,$(1)))
146 endef
148 # Ensure delivery of the extension to instdir.
150 # gb_Extension__Extension_deliver extension package-name
151 define gb_Extension__Extension_deliver
152 $(call gb_GeneratedPackage_GeneratedPackage,$(2),$(dir $(call gb_Extension_get_rootdir,$(1))))
153 $(call gb_GeneratedPackage_add_dir,$(2),$(INSTROOT)/$(LIBO_SHARE_FOLDER)/extensions/$(1),$(notdir $(call gb_Extension_get_rootdir,$(1))))
155 $(call gb_GeneratedPackage_get_target,$(2)) : $(call gb_Extension_get_target,$(1))
156 $(call gb_Extension__get_final_target,$(1)) : $(call gb_GeneratedPackage_get_target,$(2))
158 endef
160 # adding a file creates a dependency to it
161 # file is copied to $(WORKDIR)
162 define gb_Extension_add_file
163 $(call gb_Extension_get_target,$(1)) : FILES += $(2)
164 $(call gb_Extension_get_target,$(1)) : $(call gb_Extension_get_rootdir,$(1))/$(2)
165 $(3) :| $(call gb_Extension__get_preparation_target,$(1))
166 $(call gb_Extension_get_rootdir,$(1))/$(2) : $(3)
167 mkdir -p $$(dir $$@) && \
168 cp -f $(3) $$@
170 endef
172 # Add several files at once
174 # This function avoids the need to specify each file's name twice. The
175 # files are added directly under specified path in the extension,
176 # without any subpath. If no path is specified, they are added directly
177 # to the root dir of the extension.
178 define gb_Extension_add_files
179 $(foreach file,$(3),$(call gb_Extension_add_file,$(1),$(if $(strip $(2)),$(strip $(2))/)$(notdir $(file)),$(file)))
181 endef
183 # add a library from workdir; DO NOT use gb_Library_get_target
184 define gb_Extension_add_library
185 $(call gb_Extension_add_file,$(1),$(call gb_Library_get_runtime_filename,$(2)),\
186 $(call gb_LinkTarget_get_target,$(call gb_Library_get_linktarget,$(2))))
188 endef
190 define gb_Extension_add_libraries
191 $(foreach lib,$(2),$(call gb_Extension_add_library,$(1),$(lib)))
193 endef
195 # add an executable
196 define gb_Extension_add_executable
197 $(call gb_Extension_add_file,$(1),$(notdir $(call gb_Executable_get_target,$(2))),\
198 $(call gb_Executable_get_target,$(2)))
200 endef
202 define gb_Extension_add_executables
203 $(foreach exe,$(2),$(call gb_Extension_add_executable,$(1),$(exe)))
205 endef
207 # localize .properties file
208 # source file is copied to $(WORKDIR)
209 define gb_Extension_localize_properties
210 $(foreach lang,$(gb_Extension_ALL_LANGS),\
211 $(call gb_Extension__localize_properties_onelang,$(1),$(subst en_US,$(subst -,_,$(lang)),$(2)),$(3),$(lang)))
213 endef
216 # add an .xhp help file, to be localized and compiled
217 # $(1): extension identifier
218 # $(2): absolute path prefix of en-US source file without $(3) (resp. $(4))
219 # suffix
220 # $(3): relative path of (target) .xhp file (e.g.,
221 # com.sun.wiki-publisher/wiki.xhp)
222 # $(4): optional relative path of source .xhp file, when it differs from $(3)
223 # (i.e., if $(4) is empty the en-US source file is $(2)/$(3), otherwise it
224 # is $(2)/$(4))
225 define gb_Extension_add_helpfile
226 $(foreach lang,$(gb_Extension_ALL_LANGS), \
227 $(call gb_Extension__localize_helpfile_onelang,$(1),$(2),$(3),$(4),$(lang)) \
228 $(call gb_Extension__add_compiled_help_dependency_onelang,$(1),$(lang)))
230 endef
232 # add a list of .xhp help files, to be localized and compiled
233 # $(1): extension identifier
234 # $(2): absolute path prefix of en-US source files without $(3) suffixes
235 # $(3): list of relative paths of .xhp files (see gb_Extension_add_helpfile)
236 define gb_Extension_add_helpfiles
237 $(foreach helpfile,$(3), \
238 $(call gb_Extension_add_helpfile,$(1),$(2),$(helpfile),))
240 endef
242 # add a help.tree file, to be localized and compiled
243 # $(1): extension identifier
244 # $(2): absolute path prefix of en-US source file without $(3) (resp. $(4))
245 # suffix
246 # $(3): relative path of (target) help.tree file (e.g.,
247 # com.sun.wiki-publisher/help.tree)
248 # $(4): relative path of source help.tree file
249 # $(5): relative path of localized xhp files (PlatformID included)
250 define gb_Extension_add_helptreefile
251 $(foreach lang,$(gb_Extension_ALL_LANGS), \
252 $(call gb_Extension__localize_helptreefile_onelang,$(1),$(2),$(3),$(4),$(lang),$(5)) \
253 $(call gb_Extension__add_compiled_help_dependency_onelang,$(1),$(lang)))
255 endef
257 # Use the given file as description-en-US.txt
258 define gb_Extension_use_default_description
259 $(call gb_Extension_add_file,$(1),description-en-US.txt,$(SRCDIR)/$(2))
260 $(call gb_Extension_get_target,$(1)) : DESCRIPTION := $(true)
261 ifneq ($(strip $(gb_WITH_LANG)),)
262 $(call gb_Extension_get_target,$(1)) : FILES += $(foreach lang,$(gb_Extension_TRANS_LANGS),description-$(lang).txt)
263 endif
265 endef
267 # Use the default license file
268 define gb_Extension_use_default_license
269 $(call gb_Extension_get_target,$(1)) : FILES += registration
270 $(call gb_Extension_get_target,$(1)) : LICENSE := $(gb_Extension_LICENSEFILE_DEFAULT)
271 $(call gb_Extension_get_target,$(1)) : $(gb_Extension_LICENSEFILE_DEFAULT)
273 endef
275 define gb_Extension_use_unpacked
276 $(call gb_Extension__get_preparation_target,$(1)) \
277 :| $(call gb_UnpackedTarball_get_final_target,$(2))
279 endef
281 # Add a dependency on an ExternalProject.
283 # call gb_Extension_use_external_project,extension,externalproject
284 define gb_Extension_use_external_project
285 $(call gb_Extension__get_preparation_target,$(1)) \
286 :| $(call gb_ExternalProject_get_target,$(2))
288 endef
290 define gb_Extension__localize_properties_onelang
291 $(call gb_Extension_get_target,$(1)) : FILES += $(2)
292 ifneq ($(filter-out en-US,$(4)),)
293 ifneq ($(filter-out qtz,$(4)),)
294 $(call gb_Extension_get_rootdir,$(1))/$(2) : \
295 POFILE := $(gb_POLOCATION)/$(or $(5),$(4))/$(patsubst /%/,%,$(subst $(SRCDIR),,$(dir $(3)))).po
296 $(call gb_Extension_get_rootdir,$(1))/$(2) : \
297 $(gb_POLOCATION)/$(or $(5),$(4))/$(patsubst /%/,%,$(subst $(SRCDIR),,$(dir $(3)))).po
298 $(gb_POLOCATION)/$(or $(5),$(4))/$(patsubst /%/,%,$(subst $(SRCDIR),,$(dir $(3)))).po :
299 endif
300 endif
301 $(call gb_Extension_get_target,$(1)) : $(call gb_Extension_get_rootdir,$(1))/$(2)
302 $(call gb_Extension_get_rootdir,$(1))/$(2) \
303 :| $(call gb_Extension__get_preparation_target,$(1))
304 $(call gb_Extension_get_rootdir,$(1))/$(2) : $(3) \
305 $(gb_Extension_PROPMERGEDEPS)
306 $$(call gb_Output_announce,$(2),$(true),PRP,3)
307 $$(call gb_Helper_abbreviate_dirs, \
308 mkdir -p $$(dir $$@) && \
309 $(if $(filter qtz,$(4)), \
310 $(subst $$,$$$$,$(gb_Extension_PROPMERGECOMMAND)) -i $$< -o $$@ -m -l $(4) \
312 $(if $(filter-out en-US,$(4)), \
313 MERGEINPUT=`$(gb_MKTEMP)` && \
314 echo $$(POFILE) > $$$${MERGEINPUT} && \
315 $(subst $$,$$$$,$(gb_Extension_PROPMERGECOMMAND)) -i $$< -o $$@ -m $$$${MERGEINPUT} -l $(4) && \
316 rm -rf $$$${MERGEINPUT} \
318 cp -f $$< $$@ \
323 endef
325 # localize one .xhp help file for one language; the result is stored as
326 # help/$(4)/$(3) in the extension's workdir; as a special case, if $(4) is
327 # "en-US", the source file is just copied, not passed through helpex
328 # $(1): extension identifier
329 # $(2): absolute path prefix of en-US source file without $(3) (resp. $(4))
330 # suffix
331 # $(3): relative path of (target) .xhp file (see
332 # gb_Extension_add_helpfile)
333 # $(4): optional relative path of source .xhp file (see
334 # gb_Extension_add_helpfile)
335 # $(5): language
336 define gb_Extension__localize_helpfile_onelang
337 $(call gb_Extension_get_rootdir,$(1))/help/$(5).done : HELPFILES += $(3)
338 $(call gb_Extension_get_rootdir,$(1))/help/$(5).done : \
339 $(call gb_Extension_get_workdir,$(1))/help/$(5)/$(3)
340 $(call gb_Extension_get_rootdir,$(1))/help/$(5)-xhp.done : \
341 $(call gb_Extension_get_workdir,$(1))/help/$(5)/$(3)
342 ifneq ($(filter-out en-US,$(5)),)
343 ifneq ($(filter-out qtz,$(5)),)
344 $(call gb_Extension_get_workdir,$(1))/help/$(5)/$(3) : \
345 POFILE := $(gb_POLOCATION)/$(5)$(subst $(SRCDIR),,$(2))$(patsubst %/,/%.po,$(patsubst ./,.po,$(dir $(or $(4),$(3)))))
346 $(call gb_Extension_get_workdir,$(1))/help/$(5)/$(3) : \
347 $(gb_POLOCATION)/$(5)$(subst $(SRCDIR),,$(2))$(patsubst %/,/%.po,$(patsubst ./,.po,$(dir $(or $(4),$(3)))))
348 $(gb_POLOCATION)/$(5)$(subst $(SRCDIR),,$(2))$(patsubst %/,/%.po,$(patsubst ./,.po,$(dir $(or $(4),$(3))))) :
349 endif
350 endif
351 $(call gb_Extension_get_workdir,$(1))/help/$(5)/$(3) : \
352 $(if $(filter-out en-US,$(5)),$(gb_Extension_HELPEXDEPS)) | \
353 $(call gb_Extension_get_workdir,$(1))/help/.dir
354 $(call gb_Extension_get_workdir,$(1))/help/$(5)/$(3) : \
355 $(2)/$(or $(4),$(3))
356 $$(call gb_Output_announce,$(1) $(3) $(5),$(true),XHP,3)
357 $$(call gb_Helper_abbreviate_dirs, \
358 mkdir -p $$(dir $$@) && \
359 $(if $(filter qtz,$(5)), \
360 $(gb_Extension_HELPEXCOMMAND) -i $$< -o $$@ -l $(5) -m \
362 $(if $(filter-out en-US,$(5)), \
363 MERGEINPUT=`$(gb_MKTEMP)` && \
364 echo $$(POFILE) > $$$${MERGEINPUT} && \
365 $$(gb_Extension_HELPEXCOMMAND) -i $$< -o $$@ -l $(5) \
366 -m $$$${MERGEINPUT} && \
367 rm -rf $$$${MERGEINPUT} \
369 cp $$< $$@ \
371 ) && \
372 touch $(call gb_Extension_get_rootdir,$(1))/help/$(5)-xhp.done \
375 endef
377 # localize one help.tree for one language; the result is stored as
378 # help/$(4)/$(3) in the extension's workdir;
379 # $(1): extension identifier
380 # $(2): absolute path prefix of en-US source file without $(3) (resp. $(4))
381 # suffix
382 # $(3): relative path of (target) help.tree file (see
383 # gb_Extension_add_helptreefile)
384 # $(4): relative path of source help.tree file (see
385 # gb_Extension_add_helptreefile)
386 # $(5): language
387 # $(6): relative path of localized xhp files (PlatformID included)
388 define gb_Extension__localize_helptreefile_onelang
389 $(call gb_Extension_get_rootdir,$(1))/help/$(5).done : \
390 $(call gb_Extension_get_rootdir,$(1))/help/$(5)/$(3)
391 ifneq ($(filter-out en-US,$(5)),)
392 ifneq ($(filter-out qtz,$(5)),)
393 $(call gb_Extension_get_rootdir,$(1))/help/$(5)/$(3) : \
394 POFILE := $(gb_POLOCATION)/$(5)$(subst $(SRCDIR),,$(2))$(patsubst %/,/%.po,$(patsubst ./,.po,$(dir $(4))))
395 $(call gb_Extension_get_rootdir,$(1))/help/$(5)/$(3) : \
396 $(gb_POLOCATION)/$(5)$(subst $(SRCDIR),,$(2))$(patsubst %/,/%.po,$(patsubst ./,.po,$(dir $(4))))
397 $(gb_POLOCATION)/$(5)$(subst $(SRCDIR),,$(2))$(patsubst %/,/%.po,$(patsubst ./,.po,$(dir $(4)))) :
398 endif
399 endif
400 $(call gb_Extension_get_rootdir,$(1))/help/$(5)/$(3) : \
401 $(call gb_Extension_get_rootdir,$(1))/help/$(5)-xhp.done
402 $(call gb_Extension_get_rootdir,$(1))/help/$(5)/$(3) : \
403 $(gb_Extension_TREEXDEPS) | \
404 $(2)/$(4)
405 $(call gb_Extension_get_rootdir,$(1))/help/$(5)/$(3) : \
406 $(2)/$(or $(4),$(3))
407 $$(call gb_Output_announce,$(1) $(3) $(5),$(true),TRE,3)
408 $$(call gb_Helper_abbreviate_dirs, \
409 mkdir -p $$(dir $$@) && \
410 $(if $(filter qtz,$(5)), \
411 $(subst $$,$$$$,$(gb_Extension_TREEXCOMMAND)) -i $$< -o $$@ -l $(5) -m \
412 -r $$(call gb_Extension_get_workdir,$(1))/help/$(5)/$(6) \
414 $(if $(filter-out en-US,$(5)), \
415 MERGEINPUT=`$(gb_MKTEMP)` && \
416 echo $$(POFILE) > $$$${MERGEINPUT} && \
417 $(subst $$,$$$$,$(gb_Extension_TREEXCOMMAND)) -i $$< -o $$@ -l $(5) \
418 -m $$$${MERGEINPUT} \
419 -r $$(call gb_Extension_get_workdir,$(1))/help/$(5)/$(6) && \
420 rm -rf $$$${MERGEINPUT} \
422 $(subst $$,$$$$,$(gb_Extension_TREEXCOMMAND)) -i $$< -o $$@ -l $(5) \
423 -r $$(call gb_Extension_get_workdir,$(1))/help/$(5)/$(6) \
428 endef
430 # compile help for one language; the result is stored as help/$(3)/ in the
431 # extension's rootdir and marked for zipping into the .oxt
432 # $(1): extension identifier
433 # $(2): language
434 # Target-specific HELPFILES: list of relative paths of .xhp files (see
435 # gb_Extension_add_helpfile)
436 define gb_Extension__compile_help_onelang
437 $(call gb_Extension_get_rootdir,$(1))/help/$(2).done : \
438 $(gb_Extension_HELPINDEXERDEPS) \
439 $(gb_Extension_HELPLINKERDEPS) \
440 $(SRCDIR)/xmlhelp/util/embed.xsl \
441 $(SRCDIR)/xmlhelp/util/idxcaption.xsl \
442 $(SRCDIR)/xmlhelp/util/idxcontent.xsl | \
443 $(call gb_Extension_get_rootdir,$(1))/help/.dir
444 $$(call gb_Output_announce,$(1) $(2),$(true),XHC,3)
445 $$(call gb_Helper_abbreviate_dirs, \
446 mkdir -p $$(basename $$@) && \
447 $$(gb_Extension_HELPLINKERCOMMAND) -mod help \
448 -extlangsrc $(call gb_Extension_get_workdir,$(1))/help/$(2) \
449 -sty $(SRCDIR)/xmlhelp/util/embed.xsl \
450 -extlangdest $$(basename $$@) \
451 -idxcaption $(SRCDIR)/xmlhelp/util/idxcaption.xsl \
452 -idxcontent $(SRCDIR)/xmlhelp/util/idxcontent.xsl \
453 $$(HELPFILES) && \
454 (cd $(call gb_Extension_get_workdir,$(1))/help/$(2) && \
455 $$(gb_Extension_ZIPCOMMAND) -r $$(basename $$@)/help.jar \
456 $$(HELPFILES)) && \
457 $$(gb_Extension_HELPINDEXERCOMMAND) -lang $(2) -mod help \
458 -dir $$(basename $$@) && \
459 rm -fr $$(basename $$@)/caption $$(basename $$@)/content && \
460 touch $$@)
462 endef
464 # establish the dependency that actually causes inclusion of the compiled help
465 # into the .oxt, for one language; in principle, this would only need to be done
466 # once per language iff the extension uses any help -- currently it is done from
467 # each individual gb_Extension_add_helpfile call (and thus requires $strip
468 # to remove duplicates from FILES)
469 # $(1): extension identifier
470 # $(2): language
471 define gb_Extension__add_compiled_help_dependency_onelang
472 $(call gb_Extension_get_target,$(1)) : FILES += help/$(2)
473 $(call gb_Extension_get_target,$(1)) : \
474 $(call gb_Extension_get_rootdir,$(1))/help/$(2).done
475 $(call gb_Extension_get_rootdir,$(1))/help/$(2).done \
476 :| $(call gb_Extension__get_preparation_target,$(1))
478 endef
480 # vim: set noet sw=4 ts=4: