xref: /AOO41X/main/solenv/gbuild/Executable.mk (revision 707fc0d4d52eb4f69d89a98ffec6918ca5de6326)
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# Executable class
25
26# defined by platform
27#  gb_Executable_Executable_platform
28
29.PHONY : $(call gb_Executable_get_clean_target,%)
30$(call gb_Executable_get_clean_target,%) :
31    $(call gb_Helper_abbreviate_dirs,\
32        rm -f $(call gb_Executable_get_target,$*) \
33            $(AUXTARGETS))
34
35$(call gb_Executable_get_target,%) :
36    $(call gb_Helper_abbreviate_dirs,\
37        $(call gb_Deliver_deliver,$<,$@) \
38            $(foreach target,$(AUXTARGETS), && $(call gb_Deliver_deliver,$(dir $<)/$(notdir $(target)),$(target))))
39
40define gb_Executable_Executable
41$(call gb_Executable__Executable_impl,$(1),Executable/$(1)$(gb_Executable_EXT))
42
43endef
44
45define gb_Executable__Executable_impl
46$(call gb_LinkTarget_LinkTarget,$(2))
47$(call gb_LinkTarget_set_targettype,$(2),Executable)
48$(call gb_Executable_get_target,$(1)) : $(call gb_LinkTarget_get_target,$(2))
49$(call gb_Executable_get_clean_target,$(1)) : $(call gb_LinkTarget_get_clean_target,$(2))
50$(call gb_Executable_Executable_platform,$(1),$(2))
51$$(eval $$(call gb_Module_register_target,$(call gb_Executable_get_target,$(1)),$(call gb_Executable_get_clean_target,$(1))))
52$(call gb_Deliver_add_deliverable,$(call gb_Executable_get_target,$(1)),$(call gb_LinkTarget_get_target,$(2)))
53
54endef
55
56define gb_Executable_forward_to_Linktarget
57gb_Executable_$(1) = $$(call gb_LinkTarget_$(1),Executable/$$(1)$$(gb_Executable_EXT),$$(2),$$(3))
58
59endef
60
61$(eval $(foreach method,\
62    add_cobject \
63    add_cobjects \
64    add_cxxobject \
65    add_cxxobjects \
66    add_objcxxobject \
67    add_objcxxobjects \
68    add_exception_objects \
69    add_noexception_objects \
70    add_generated_exception_objects \
71    set_cflags \
72    set_cxxflags \
73    set_objcxxflags \
74    set_defs \
75    set_include \
76    set_ldflags \
77    set_library_path_flags \
78    add_linked_libs \
79    add_linked_static_libs \
80    add_package_headers \
81    add_sdi_headers \
82    add_precompiled_header \
83,\
84    $(call gb_Executable_forward_to_Linktarget,$(method))\
85))
86
87# vim: set noet sw=4 ts=4:
88