xref: /aoo41x/main/solenv/gbuild/Executable.mk (revision cdf0e10c)
1#*************************************************************************
2#
3# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4#
5# Copyright 2000, 2011 Oracle and/or its affiliates.
6#
7# OpenOffice.org - a multi-platform office productivity suite
8#
9# This file is part of OpenOffice.org.
10#
11# OpenOffice.org is free software: you can redistribute it and/or modify
12# it under the terms of the GNU Lesser General Public License version 3
13# only, as published by the Free Software Foundation.
14#
15# OpenOffice.org is distributed in the hope that it will be useful,
16# but WITHOUT ANY WARRANTY; without even the implied warranty of
17# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18# GNU Lesser General Public License version 3 for more details
19# (a copy is included in the LICENSE file that accompanied this code).
20#
21# You should have received a copy of the GNU Lesser General Public License
22# version 3 along with OpenOffice.org.  If not, see
23# <http://www.openoffice.org/license.html>
24# for a copy of the LGPLv3 License.
25#
26#*************************************************************************
27
28# Executable class
29
30# defined by platform
31#  gb_Executable_Executable_platform
32
33.PHONY : $(call gb_Executable_get_clean_target,%)
34$(call gb_Executable_get_clean_target,%) :
35	$(call gb_Helper_abbreviate_dirs,\
36		rm -f $(call gb_Executable_get_target,$*) \
37			$(AUXTARGETS))
38
39$(call gb_Executable_get_target,%) :
40	$(call gb_Helper_abbreviate_dirs,\
41		$(call gb_Deliver_deliver,$<,$@) \
42			$(foreach target,$(AUXTARGETS), && $(call gb_Deliver_deliver,$(dir $<)/$(notdir $(target)),$(target))))
43
44define gb_Executable_Executable
45$(call gb_Executable__Executable_impl,$(1),Executable/$(1)$(gb_Executable_EXT))
46
47endef
48
49define gb_Executable__Executable_impl
50$(call gb_LinkTarget_LinkTarget,$(2))
51$(call gb_LinkTarget_set_targettype,$(2),Executable)
52$(call gb_Executable_get_target,$(1)) : $(call gb_LinkTarget_get_target,$(2))
53$(call gb_Executable_get_clean_target,$(1)) : $(call gb_LinkTarget_get_clean_target,$(2))
54$(call gb_Executable_Executable_platform,$(1),$(2))
55$$(eval $$(call gb_Module_register_target,$(call gb_Executable_get_target,$(1)),$(call gb_Executable_get_clean_target,$(1))))
56$(call gb_Deliver_add_deliverable,$(call gb_Executable_get_target,$(1)),$(call gb_LinkTarget_get_target,$(2)))
57
58endef
59
60define gb_Executable_forward_to_Linktarget
61gb_Executable_$(1) = $$(call gb_LinkTarget_$(1),Executable/$$(1)$$(gb_Executable_EXT),$$(2),$$(3))
62
63endef
64
65$(eval $(foreach method,\
66	add_cobject \
67	add_cobjects \
68	add_cxxobject \
69	add_cxxobjects \
70	add_objcxxobject \
71	add_objcxxobjects \
72	add_exception_objects \
73	add_noexception_objects \
74	add_generated_exception_objects \
75	set_cflags \
76	set_cxxflags \
77	set_objcxxflags \
78	set_defs \
79	set_include \
80	set_ldflags \
81	set_library_path_flags \
82	add_linked_libs \
83	add_linked_static_libs \
84	add_package_headers \
85	add_sdi_headers \
86	add_precompiled_header \
87,\
88	$(call gb_Executable_forward_to_Linktarget,$(method))\
89))
90
91# vim: set noet sw=4 ts=4:
92