Resolves: tdf#151441 queries don't show any content
[LibreOffice.git] / solenv / gbuild / ComponentTarget.mk
blob067f24e35ce683fba43735810b7a1a5e634becf3
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 := $(SRCDIR)/solenv/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 $(if $(LIBFILENAME),,$(call gb_Output_error,No LIBFILENAME set at component target: $(1)))
30 mkdir -p $(dir $(1)) && \
31 $(call gb_ExternalExecutable_get_command,xsltproc) --nonet \
32 --stringparam uri '$(if $(filter TRUE,$(DISABLE_DYNLOADING)),,$(subst \d,$$,$(COMPONENTPREFIX)))$(LIBFILENAME)' \
33 --stringparam cppu_env $(CPPU_ENV) -o $(1) \
34 $(gb_ComponentTarget_XSLTCOMMANDFILE) $(COMPONENTSOURCE)
35 endef
38 $(call gb_ComponentTarget_get_clean_target,%) :
39 $(call gb_Output_announce,$*,$(false),CMP,1)
40 rm -f $(call gb_ComponentTarget_get_target,$*) \
43 # when a library is renamed, the component file needs to be rebuilt to match.
44 # hence simply depend on Repository{,Fixes}.mk since the command runs quickly.
45 $(call gb_ComponentTarget_get_target,%) : \
46 $(SRCDIR)/Repository.mk \
47 $(SRCDIR)/RepositoryFixes.mk \
48 | $(call gb_ExternalExecutable_get_dependencies,xsltproc)
49 $(call gb_Output_announce,$*,$(true),CMP,1)
50 $(call gb_Trace_StartRange,$*,CMP)
51 $(call gb_ComponentTarget__command,$@,$*)
52 $(call gb_Trace_EndRange,$*,CMP)
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_target,$(1)) : COMPONENTSOURCE := $(call gb_ComponentTarget_get_source,$(patsubst CppunitTest/%,%,$(1)))
59 $(call gb_ComponentTarget_get_target,$(1)) : $(call gb_ComponentTarget_get_source,$(patsubst CppunitTest/%,%,$(1)))
61 endef
63 # vim: set noet sw=4: