Bump for 3.6-28
[LibreOffice.git] / solenv / gbuild / Executable.mk
bloba89676edeed7bcd8c07e0cd5c1c188afbce49749
1 # -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
2 #*************************************************************************
4 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 #
6 # Copyright 2000, 2011 Oracle and/or its affiliates.
8 # OpenOffice.org - a multi-platform office productivity suite
10 # This file is part of OpenOffice.org.
12 # OpenOffice.org is free software: you can redistribute it and/or modify
13 # it under the terms of the GNU Lesser General Public License version 3
14 # only, as published by the Free Software Foundation.
16 # OpenOffice.org is distributed in the hope that it will be useful,
17 # but WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 # GNU Lesser General Public License version 3 for more details
20 # (a copy is included in the LICENSE file that accompanied this code).
22 # You should have received a copy of the GNU Lesser General Public License
23 # version 3 along with OpenOffice.org. If not, see
24 # <http://www.openoffice.org/license.html>
25 # for a copy of the LGPLv3 License.
27 #*************************************************************************
29 # Executable class
31 # defined by platform
32 # gb_Executable_Executable_platform
34 .PHONY : $(call gb_Executable_get_clean_target,%)
35 $(call gb_Executable_get_clean_target,%) :
36 $(call gb_Helper_abbreviate_dirs,\
37 rm -f $(call gb_Executable_get_target,$*) \
38 $(AUXTARGETS))
40 $(call gb_Executable_get_target,%) :
41 $(call gb_Helper_abbreviate_dirs,\
42 $(call gb_Deliver_deliver,$<,$@) \
43 $(foreach target,$(AUXTARGETS), && $(call gb_Deliver_deliver,$(dir $<)/$(notdir $(target)),$(target))))
45 define gb_Executable_Executable
46 ifeq (,$$(findstring $(1),$$(gb_Executable_KNOWN)))
47 $$(eval $$(call gb_Output_info,Currently known executables: $(sort $(gb_Executable_KNOWN)),ALL))
48 $$(eval $$(call gb_Output_error,Executable $(1) must be registered in Repository.mk))
49 endif
50 $(call gb_Executable__Executable_impl,$(1),Executable/$(1)$(gb_Executable_EXT))
52 endef
54 define gb_Executable__Executable_impl
55 $(call gb_Executable_set_targettype_gui,$(2))
56 $(call gb_LinkTarget_LinkTarget,$(2))
57 $(call gb_LinkTarget_set_targettype,$(2),Executable)
58 $(call gb_Executable_get_target,$(1)) : $(call gb_LinkTarget_get_target,$(2)) \
59 | $(dir $(call gb_Executable_get_target,$(1))).dir
60 $(call gb_Executable_get_clean_target,$(1)) : $(call gb_LinkTarget_get_clean_target,$(2))
61 $(call gb_Executable_Executable_platform,$(1),$(2))
62 $$(eval $$(call gb_Module_register_target,$(call gb_Executable_get_target,$(1)),$(call gb_Executable_get_clean_target,$(1))))
63 $(call gb_Deliver_add_deliverable,$(call gb_Executable_get_target,$(1)),$(call gb_LinkTarget_get_target,$(2)),$(1))
65 endef
67 define gb_Executable_set_targettype_gui
68 $(call gb_LinkTarget_get_target,Executable/$(1)$(gb_Executable_EXT)) : TARGETGUI := $(2)
69 endef
72 define gb_Executable_forward_to_Linktarget
73 gb_Executable_$(1) = $$(call gb_LinkTarget_$(1),$$(call gb_Executable_get_linktargetname,$$(1)),$$(2),$$(3),Executable_$$(1))
75 endef
77 $(eval $(foreach method,\
78 add_cobject \
79 add_cobjects \
80 add_cxxobject \
81 add_cxxobjects \
82 add_objcobject \
83 add_objcobjects \
84 add_objcxxobject \
85 add_objcxxobjects \
86 add_grammar \
87 add_grammars \
88 add_scanner \
89 add_scanners \
90 add_exception_objects \
91 add_noexception_objects \
92 add_generated_cobjects \
93 add_generated_cxxobjects \
94 add_generated_exception_objects \
95 add_cflags \
96 set_cflags \
97 add_cxxflags \
98 set_cxxflags \
99 add_objcflags \
100 add_objcxxflags \
101 set_objcflags \
102 set_objcxxflags \
103 add_defs \
104 set_defs \
105 set_include \
106 add_ldflags \
107 set_ldflags \
108 add_libs \
109 set_library_path_flags \
110 add_api \
111 use_api \
112 add_internal_api \
113 use_internal_api \
114 add_internal_bootstrap_api \
115 use_internal_bootstrap_api \
116 add_internal_comprehensive_api \
117 use_internal_comprehensive_api \
118 add_linked_libs \
119 use_libraries \
120 add_linked_static_libs \
121 use_static_libraries \
122 use_external \
123 use_externals \
124 add_custom_headers \
125 use_custom_headers \
126 add_package_headers \
127 use_package \
128 use_packages \
129 add_sdi_headers \
130 add_nativeres \
131 set_warnings_not_errors \
133 $(call gb_Executable_forward_to_Linktarget,$(method))\
136 # vim: set noet sw=4: