1 # -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
3 # This file is part of the LibreOffice project.
5 # This Source Code Form is subject to the terms of the Mozilla Public
6 # License, v. 2.0. If a copy of the MPL was not distributed with this
7 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 # This file incorporates work covered by the following license notice:
11 # Licensed to the Apache Software Foundation (ASF) under one or more
12 # contributor license agreements. See the NOTICE file distributed
13 # with this work for additional information regarding copyright
14 # ownership. The ASF licenses this file to you under the Apache
15 # License, Version 2.0 (the "License"); you may not use this file
16 # except in compliance with the License. You may obtain a copy of
17 # the License at http://www.apache.org/licenses/LICENSE-2.0 .
23 # gb_Executable_Executable_platform
25 # NOTE: SDKBIN executables are already packaged in module odk
26 gb_Executable_LAYER_DIRS
:= \
30 $(dir $(call gb_Executable_get_runtime_target
,%)).
dir :
31 $(if
$(wildcard $(dir $@
)),,mkdir
-p
$(dir $@
))
33 $(dir $(call gb_Executable_get_runtime_target
,%))%/.
dir :
34 $(if
$(wildcard $(dir $@
)),,mkdir
-p
$(dir $@
))
36 $(call gb_Executable_get_runtime_target
,%) : $(call gb_Executable_get_target_for_build
,%)
39 .PHONY
: $(call gb_Executable_get_clean_target
,%)
40 $(call gb_Executable_get_clean_target
,%) :
41 $(call gb_Helper_abbreviate_dirs
,\
42 rm -f
$(call gb_Executable_get_target
,$*) \
43 $(call gb_Executable_get_runtime_target
,$*) \
46 gb_Executable_get_packagename
= Executable
/$(1)
48 gb_Executable__get_dir_for_layer
= $(patsubst $(1):%,%,$(filter $(1):%,$(gb_Executable_LAYER_DIRS
)))
49 gb_Executable__get_instdir
= $(call gb_Executable__get_dir_for_layer
,$(call gb_Executable_get_layer
,$(1)))
51 define gb_Executable_Executable
52 $(call gb_Postprocess_get_target
,AllExecutables
) : $(call gb_Executable_get_target
,$(1))
53 ifeq (,$$(findstring $(1),$$(gb_Executable_KNOWN
)))
54 $$(eval
$$(call gb_Output_info
,Currently known executables
: $(sort $(gb_Executable_KNOWN
)),ALL
))
55 $$(eval
$$(call gb_Output_error
,Executable
$(1) must be registered in Repository.mk
))
57 $(call gb_Executable__Executable_impl
,$(1),Executable
/$(1)$(gb_Executable_EXT
))
61 define gb_Executable__Executable_impl
62 $(call gb_LinkTarget_LinkTarget
,$(2),Executable_
$(1))
63 $(call gb_LinkTarget_set_targettype
,$(2),Executable
)
64 $(call gb_LinkTarget_add_libs
,$(2),$(gb_STDLIBS
))
65 $(call gb_Executable_get_target
,$(1)) : $(call gb_LinkTarget_get_target
,$(2)) \
66 |
$(dir $(call gb_Executable_get_target
,$(1))).
dir
67 $(call gb_Executable_get_runtime_target
,$(1)) :|
$(dir $(call gb_Executable_get_runtime_target
,$(1))).
dir
68 $(call gb_Executable_get_clean_target
,$(1)) : $(call gb_LinkTarget_get_clean_target
,$(2))
69 $(call gb_Executable_get_clean_target
,$(1)) : AUXTARGETS
:=
70 $(call gb_Executable_Executable_platform
,$(1),$(2))
72 ifneq ($(gb_RUNNABLE_INSTDIR
),)
73 $(if
$(filter $(call gb_Executable_get_layer
,$(1)):%,$(gb_Executable_LAYER_DIRS
)),\
74 $(call gb_Executable__Executable_package
,$(1),$(call gb_Executable_get_packagename
,$(1)),$(2),$(notdir $(call gb_Executable_get_target
,$(1)))) \
78 $$(eval
$$(call gb_Module_register_target
,$(call gb_Executable_get_target
,$(1)),$(call gb_Executable_get_clean_target
,$(1))))
79 $(call gb_Helper_make_userfriendly_targets
,$(1),Executable
)
80 $(call gb_Deliver_add_deliverable
,$(call gb_Executable_get_target
,$(1)),$(call gb_LinkTarget_get_target
,$(2)),$(1))
84 # gb_Executable__Executable_package executable package linktarget filename
85 define gb_Executable__Executable_package
86 $(call gb_Package_Package_internal
,$(2),$(WORKDIR
))
87 $(call gb_Package_set_outdir
,$(2),$(INSTDIR
))
88 $(call gb_Package_add_file
,$(2),$(call gb_Executable__get_instdir
,$(1))/$(4),$(subst $(WORKDIR
)/,,$(call gb_LinkTarget_get_target
,$(3))))
90 $(call gb_Executable_get_target
,$(1)) :|
$(call gb_Package_get_target
,$(2))
91 $(call gb_Package_get_target
,$(2)) : $(call gb_LinkTarget_get_target
,$(3))
92 $(call gb_Executable_get_clean_target
,$(1)) : $(call gb_Package_get_clean_target
,$(2))
96 define gb_Executable_set_targettype_gui
97 $(call gb_LinkTarget_get_target
,Executable
/$(1)$(gb_Executable_EXT
)) : TARGETGUI
:= $(2)
100 # The auxtarget is delivered via the rule in Package.mk.
101 # gb_Executable_add_auxtarget executable outdirauxtarget
102 define gb_Executable_add_auxtarget
103 $(call gb_LinkTarget_add_auxtarget
,$(call gb_Executable_get_linktargetname
,$(1)),$(dir $(call gb_LinkTarget_get_target
,$(call gb_Executable_get_linktargetname
,$(1))))/$(notdir $(2)))
104 $(call gb_Executable_get_target
,$(1)) : $(2)
105 $(2) : $(dir $(call gb_LinkTarget_get_target
,$(call gb_Executable_get_linktargetname
,$(1))))/$(notdir $(2))
106 $(call gb_Executable_get_clean_target
,$(1)) : AUXTARGETS
+= $(2)
110 define gb_Executable_forward_to_Linktarget
111 gb_Executable_
$(1) = $$(call gb_LinkTarget_
$(1),$$(call gb_Executable_get_linktargetname
,$$(1)),$$(2),$$(3),Executable_
$$(1))
115 $(eval
$(foreach method
,\
128 add_exception_objects \
129 add_noexception_objects \
130 add_generated_cobjects \
131 add_generated_cxxobjects \
132 add_generated_exception_objects \
147 disable_standard_system_libs \
148 use_system_darwin_frameworks \
149 use_system_win32_libs \
150 set_library_path_flags \
156 add_internal_bootstrap_api \
157 use_internal_bootstrap_api \
158 add_internal_comprehensive_api \
159 use_internal_comprehensive_api \
162 add_linked_static_libs \
163 use_static_libraries \
168 add_package_headers \
173 set_precompiled_header \
174 add_precompiled_header \
176 set_warnings_not_errors \
177 set_generated_cxx_suffix \
179 $(call gb_Executable_forward_to_Linktarget
,$(method
))\
184 # Add dependencies needed for running the executable
186 # gb_Executable_add_runtime_dependencies executable dependencies
187 define gb_Executable_add_runtime_dependencies
188 $(call gb_Executable_get_runtime_target
,$(1)) : $(2)
192 # vim: set noet sw=4: