xref: /aoo4110/main/solenv/gbuild/SdiTarget.mk (revision b1cdbd2c)
1#**************************************************************
2#
3#  Licensed to the Apache Software Foundation (ASF) under one
4#  or more contributor license agreements.  See the NOTICE file
5#  distributed with this work for additional information
6#  regarding copyright ownership.  The ASF licenses this file
7#  to you under the Apache License, Version 2.0 (the
8#  "License"); you may not use this file except in compliance
9#  with the License.  You may obtain a copy of the License at
10#
11#    http://www.apache.org/licenses/LICENSE-2.0
12#
13#  Unless required by applicable law or agreed to in writing,
14#  software distributed under the License is distributed on an
15#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16#  KIND, either express or implied.  See the License for the
17#  specific language governing permissions and limitations
18#  under the License.
19#
20#**************************************************************
21
22
23
24# SdiTarget is evil, in that it does not support multiple repositories for now (hardcoded to SRCDIR)
25# Also there is no way to cleanly deliver the generated header to OUTDIR.
26# (This can be workarounded by using gb_Package, but really should not.)
27
28# SdiTarget class
29
30gb_SdiTarget_SVIDLTARGET := $(call gb_Executable_get_target,svidl)
31gb_SdiTarget_SVIDLCOMMAND := $(gb_SdiTarget_SVIDLPRECOMMAND) $(gb_SdiTarget_SVIDLTARGET)
32
33$(call gb_SdiTarget_get_target,%) : $(SRCDIR)/%.sdi | $(gb_SdiTarget_SVIDLTARGET)
34	$(call gb_Output_announce,$*,$(true),SDI,1)
35	$(call gb_Helper_abbreviate_dirs,\
36		mkdir -p $(dir $@))
37	$(call gb_Helper_abbreviate_dirs_native,\
38		cd $(dir $<) && \
39		$(gb_SdiTarget_SVIDLCOMMAND) -quiet \
40			$(INCLUDE) \
41			-fs$@.hxx \
42			-fd$@.ilb \
43			-fl$@.lst \
44			-fz$@.sid \
45			-fx$(EXPORTS) \
46			-fm$@ \
47			$<)
48
49.PHONY : $(call gb_SdiTarget_get_clean_target,%)
50$(call gb_SdiTarget_get_clean_target,%) :
51	$(call gb_Output_announce,$*,$(false),SDI,1)
52	-$(call gb_Helper_abbreviate_dirs,\
53		rm -f $(foreach ext,.hxx .ilb .lst .sid,\
54			$(call gb_SdiTarget_get_target,$*)$(ext)) \
55			$(call gb_SdiTarget_get_target,$*))
56
57define gb_SdiTarget_SdiTarget
58$(call gb_SdiTarget_get_target,$(1)) : INCLUDE := $$(subst -I. ,-I$$(dir $(SRCDIR)/$(1)) ,$$(SOLARINC))
59$(call gb_SdiTarget_get_target,$(1)) : EXPORTS := $(SRCDIR)/$(2).sdi
60endef
61
62define gb_SdiTarget_set_include
63$(call gb_SdiTarget_get_target,$(1)) : INCLUDE := $(2)
64
65endef
66
67# vim: set noet sw=4 ts=4:
68