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/.
9 # This file incorporates work covered by the following license notice:
11 # Licensed to the Apache Software Foundation (ASF) under one or more
12 # contributor license agreements. See the NOTICE file distributed
13 # with this work for additional information regarding copyright
14 # ownership. The ASF licenses this file to you under the Apache
15 # License, Version 2.0 (the "License"); you may not use this file
16 # except in compliance with the License. You may obtain a copy of
17 # the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 gb_ComponentTarget_XSLTCOMMANDFILE
:= $(SOLARENV
)/bin
/createcomponent.xslt
21 gb_ComponentTarget_get_source
= $(SRCDIR
)/$(1).component
23 # In the DISABLE_DYNLOADING case we don't need any COMPONENTPREFIX, we
24 # put just the static library filename into the uri parameter. For
25 # each statically linked app using some subset of LO components, there
26 # is a mapping from library filenames to direct pointers to the
27 # corresponding PREFIX_component_getFactory functions.
28 define gb_ComponentTarget__command
29 $(call gb_Output_announce
,$(3),$(true
),CMP
,1)
30 $(if
$(LIBFILENAME
),,$(call gb_Output_error
,No LIBFILENAME set at component target
: $(1)))
31 $(call gb_Helper_abbreviate_dirs
,\
32 mkdir
-p
$(dir $(1)) && \
33 $(call gb_ExternalExecutable_get_command
,xsltproc
) --nonet
--stringparam uri \
34 '$(if $(filter TRUE,$(DISABLE_DYNLOADING)),,$(subst \d,$$,$(COMPONENTPREFIX)))$(LIBFILENAME)' -o
$(1) \
35 $(gb_ComponentTarget_XSLTCOMMANDFILE
) $(2))
39 $(call gb_ComponentTarget_get_clean_target
,%) :
40 $(call gb_Output_announce
,$*,$(false
),CMP
,1)
41 rm -f
$(call gb_ComponentTarget_get_outdir_target
,$*) \
42 $(call gb_ComponentTarget_get_target
,$*) \
45 # when a library is renamed, the component file needs to be rebuilt to match.
46 # hence simply depend on Repository{,Fixes}.mk since the command runs quickly.
47 $(call gb_ComponentTarget_get_target
,%) : \
48 $(call gb_ComponentTarget_get_source
,%) \
49 $(SRCDIR
)/Repository.mk \
50 $(SRCDIR
)/RepositoryFixes.mk \
51 |
$(call gb_ExternalExecutable_get_dependencies
,xsltproc
)
52 $(call gb_ComponentTarget__command
,$@
,$<,$*)
54 define gb_ComponentTarget_ComponentTarget
55 $(call gb_ComponentTarget_get_target
,$(1)) : COMPONENTPREFIX
:= $(2)
56 $(call gb_ComponentTarget_get_target
,$(1)) : LIBFILENAME
:= $(3)
57 $(call gb_ComponentTarget_get_outdir_target
,$(1)) : \
58 $(call gb_ComponentTarget_get_target
,$(1)) \
59 |
$(dir $(call gb_ComponentTarget_get_outdir_target
,$(1))).
dir
60 $(call gb_Deliver_add_deliverable
,$(call gb_ComponentTarget_get_outdir_target
,$(1)),$(call gb_ComponentTarget_get_target
,$(1)),$(1))