xref: /aoo42x/main/solenv/gbuild/Executable.mk (revision 390c74e1)
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_exception_objects \
77	set_yaccflags \
78	add_cflags \
79	set_cflags \
80	add_cxxflags \
81	set_cxxflags \
82	add_objcxxflags \
83	set_objcxxflags \
84	add_defs \
85	set_defs \
86	set_include \
87	add_ldflags \
88	set_ldflags \
89	add_libs \
90	set_library_path_flags \
91	add_api \
92	set_private_api \
93	add_linked_libs \
94	add_linked_static_libs \
95	use_external \
96	use_externals \
97	add_package_headers \
98	add_sdi_headers \
99	add_precompiled_header \
100	set_private_extract_of_public_api \
101	add_bison_files \
102,\
103	$(call gb_Executable_forward_to_Linktarget,$(method))\
104))
105
106# vim: set noet sw=4 ts=4:
107