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 # SdiTarget is evil, in that it does not support multiple repositories for now (hardcoded to SRCDIR)
21 # Also there is no way to cleanly deliver the generated header to OUTDIR.
22 # (This can be workarounded by using gb_Package, but really should not.)
25 gb_SdiTarget_SVIDLDEPS
:= $(call gb_Executable_get_runtime_dependencies
,svidl
)
26 gb_SdiTarget_SVIDLCOMMAND
:= $(call gb_Executable_get_command
,svidl
)
28 $(call gb_SdiTarget_get_target
,%) : $(SRCDIR
)/%.sdi
$(gb_SdiTarget_SVIDLDEPS
)
29 $(call gb_Output_announce
,$*,$(true
),SDI
,1)
30 $(call gb_Helper_abbreviate_dirs
,\
31 mkdir
-p
$(dir $@
) $(dir $(call gb_SdiTarget_get_dep_target
,$*)))
32 $(call gb_Helper_abbreviate_dirs
,\
34 $(gb_SdiTarget_SVIDLCOMMAND
) -quiet \
42 -fM
$(call gb_SdiTarget_get_dep_target
,$*) \
45 # rule necessary to rebuild cxx files that include the header
46 $(call gb_SdiTarget_get_target
,%.hxx
) : $(call gb_SdiTarget_get_target
,%)
49 ifeq ($(gb_FULLDEPS
),$(true
))
50 $(call gb_SdiTarget_get_dep_target
,%) :
51 $(if
$(wildcard $@
),touch
$@
,\
52 $(call gb_Object__command_dep
,$@
,$(call gb_SdiTarget_get_target
,$*)))
55 .PHONY
: $(call gb_SdiTarget_get_clean_target
,%)
56 $(call gb_SdiTarget_get_clean_target
,%) :
57 $(call gb_Output_announce
,$*,$(false
),SDI
,1)
58 -$(call gb_Helper_abbreviate_dirs
,\
59 rm -f
$(foreach ext
,.hxx .ilb .lst .sid
,\
60 $(call gb_SdiTarget_get_target
,$*)$(ext
)) \
61 $(call gb_SdiTarget_get_dep_target
,$*) \
62 $(call gb_SdiTarget_get_target
,$*))
64 define gb_SdiTarget_SdiTarget
65 $(call gb_SdiTarget_get_target
,$(1)) : INCLUDE
:= $$(subst -I.
,-I
$$(dir $(SRCDIR
)/$(1)) ,$$(SOLARINC
))
66 $(call gb_SdiTarget_get_target
,$(1)) : EXPORTS
:= $(SRCDIR
)/$(2).sdi
67 ifeq ($(gb_FULLDEPS
),$(true
))
68 -include $(call gb_SdiTarget_get_dep_target
,$(1))
72 define gb_SdiTarget_set_include
73 $(call gb_SdiTarget_get_target
,$(1)) : INCLUDE
:= $(2)