xref: /aoo42x/main/solenv/gbuild/Executable.mk (revision 52d905a6)
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_Executable_set_targettype_gui,$(2))
47$(call gb_LinkTarget_LinkTarget,$(2))
48$(call gb_LinkTarget_set_targettype,$(2),Executable)
49$(call gb_Executable_get_target,$(1)) : $(call gb_LinkTarget_get_target,$(2))
50$(call gb_Executable_get_clean_target,$(1)) : $(call gb_LinkTarget_get_clean_target,$(2))
51$(call gb_Executable_Executable_platform,$(1),$(2))
52$$(eval $$(call gb_Module_register_target,$(call gb_Executable_get_target,$(1)),$(call gb_Executable_get_clean_target,$(1))))
53$(call gb_Deliver_add_deliverable,$(call gb_Executable_get_target,$(1)),$(call gb_LinkTarget_get_target,$(2)),$(1))
54
55endef
56
57define gb_Executable_set_targettype_gui
58$(call gb_Executable_get_target,$(1)) : gb_Executable_TARGETGUI := $(2)
59endef
60
61
62define gb_Executable_forward_to_Linktarget
63gb_Executable_$(1) = $$(call gb_LinkTarget_$(1),Executable/$$(1)$$(gb_Executable_EXT),$$(2),$$(3),$$(4))
64
65endef
66
67$(eval $(foreach method,\
68	add_cobject \
69	add_cobjects \
70	add_cxxobject \
71	add_cxxobjects \
72	add_objcxxobject \
73	add_objcxxobjects \
74	add_exception_objects \
75	add_noexception_objects \
76	add_generated_cobjects \
77	add_generated_exception_objects \
78	set_yaccflags \
79	add_cflags \
80	set_cflags \
81	add_cxxflags \
82	set_cxxflags \
83	add_objcxxflags \
84	set_objcxxflags \
85	add_defs \
86	set_defs \
87	set_include \
88	add_ldflags \
89	set_ldflags \
90	add_libs \
91	set_library_path_flags \
92	add_api \
93	set_private_api \
94	add_linked_libs \
95	add_linked_static_libs \
96	use_external \
97	use_externals \
98	add_package_headers \
99	add_sdi_headers \
100	add_precompiled_header \
101	set_private_extract_of_public_api \
102	add_bison_files \
103	add_flex_files \
104,\
105	$(call gb_Executable_forward_to_Linktarget,$(method))\
106))
107
108# vim: set noet sw=4 ts=4:
109