Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / solenv / gbuild / Rdb.mk
blob136e1c2ee4dd780b233dcef2579ced03777be75a
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 gb_Rdb__get_install_target = $(INSTROOT)/$(LIBO_ETC_FOLDER)/services/$(1).rdb
12 define gb_Rdb__command
13 $(call gb_Helper_abbreviate_dirs,\
14 RESPONSEFILE=$(call gb_var2file,$(shell $(call gb_MKTEMP)),\
15 <list> \
16 $(foreach component,$(COMPONENTS),\
17 <filename>$(call gb_ComponentTarget_get_target,$(component))</filename>) \
18 </list>) && \
19 mkdir -p $(dir $@) && \
20 $(call gb_ExternalExecutable_get_command,xsltproc) --nonet -o $(1) \
21 $(SRCDIR)/solenv/bin/packcomponents.xslt $$RESPONSEFILE && \
22 rm $$RESPONSEFILE)
23 endef
25 $(call gb_Rdb_get_target,%) :| $(call gb_ExternalExecutable_get_dependencies,xsltproc)
26 $(call gb_Output_announce,$*,$(true),RDB,1)
27 $(call gb_Trace_StartRange,$*,RDB)
28 $(call gb_Rdb__command,$@,$*,$?,$^)
29 $(call gb_Trace_EndRange,$*,RDB)
31 .PHONY : $(call gb_Rdb_get_clean_target,%)
32 $(call gb_Rdb_get_clean_target,%) :
33 $(call gb_Output_announce,$*,$(false),RDB,1)
34 $(call gb_Helper_abbreviate_dirs,\
35 rm -f $(call gb_Rdb__get_install_target,$*) $(call gb_Rdb_get_target,$*))
37 define gb_Rdb__Rdb_impl
38 # gb_Rdb_add_component, which adds to the target-specific COMPONENTS variable, can be called (from
39 # gb_ComponentTarget_ComponentTarget) before gb_Rdb__Rdb_impl is called, so using `COMPONENTS :=`
40 # here could lose content; but still use `COMPONENTS ?=` here to establish COMPONENTS as target-
41 # specific even in the corner case of an empty Rdb with no gb_Rdb_add_component calls, so that the
42 # use of $(COMPONENTS) in gb_Rdb__command would not accidentally pick a global COMPONENTS variable:
43 $(call gb_Rdb_get_target,$(1)) : COMPONENTS ?=
44 $(call gb_Rdb_get_target,$(1)) : $(gb_Module_CURRENTMAKEFILE)
45 $$(eval $$(call gb_Module_register_target,$(2),$(call gb_Rdb_get_clean_target,$(1))))
46 $(call gb_Helper_make_userfriendly_targets,$(1),Rdb,$(2))
48 endef
50 define gb_Rdb_Rdb
51 $(call gb_Rdb__Rdb_impl,$(1),$(call gb_Rdb_get_target,$(1)))
53 endef
55 # FIXME this needs some layer-like thing for the special case in URE
56 define gb_Rdb_Rdb_install
57 $(call gb_Rdb__Rdb_impl,$(1),$(if $(2),$(INSTROOT)/$(2),$(call gb_Rdb__get_install_target,$(1))))
58 $(call gb_Helper_install_final, \
59 $(if $(2),$(INSTROOT)/$(2),$(call gb_Rdb__get_install_target,$(1))), \
60 $(call gb_Rdb_get_target,$(1)))
62 endef
64 define gb_Rdb_add_component
65 $(call gb_Rdb_get_target,$(1)) : $(call gb_ComponentTarget_get_target,$(2))
66 $(call gb_Rdb_get_target,$(1)) : COMPONENTS += $(2)
68 endef
70 define gb_Rdb_add_components
71 $(foreach component,$(2),$(call gb_Rdb_add_component,$(1),$(component)))
73 endef
75 # vim: set noet sw=4 ts=4: