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 gb_Executable_LAYER_DIRS
:= \
26 UREBIN
:$(INSTROOT
)/$(LIBO_URE_BIN_FOLDER
) \
27 OOO
:$(INSTROOT
)/$(LIBO_BIN_FOLDER
) \
28 SDKBIN
:$(INSTDIR
)/$(SDKDIRNAME
)/bin \
29 NONE
:$(gb_Executable_BINDIR
) \
31 gb_Executable_LAYER_DIRS_FOR_BUILD
:= \
32 UREBIN
:$(INSTROOT_FOR_BUILD
)/$(LIBO_URE_BIN_FOLDER_FOR_BUILD
) \
33 OOO
:$(INSTROOT_FOR_BUILD
)/$(LIBO_BIN_FOLDER_FOR_BUILD
) \
34 SDKBIN
:$(INSTDIR_FOR_BUILD
)/$(SDKDIRNAME_FOR_BUILD
)/bin \
35 NONE
:$(gb_Executable_BINDIR_FOR_BUILD
) \
37 $(dir $(call gb_Executable_get_runtime_target
,%)).
dir :
38 $(if
$(wildcard $(dir $@
)),,mkdir
-p
$(dir $@
))
40 $(dir $(call gb_Executable_get_runtime_target
,%))%/.
dir :
41 $(if
$(wildcard $(dir $@
)),,mkdir
-p
$(dir $@
))
43 $(call gb_Executable_get_runtime_target
,%) :
46 .PHONY
: $(call gb_Executable_get_clean_target
,%)
47 $(call gb_Executable_get_clean_target
,%) :
48 $(call gb_Helper_abbreviate_dirs
,\
49 rm -f
$(call gb_Executable_get_target
,$*) \
50 $(call gb_Executable_get_runtime_target
,$*) \
53 gb_Executable__get_dir_for_layer
= $(patsubst $(1):%,%,$(filter $(1):%,$(call gb_Executable_LAYER_DIRS
)))
54 gb_Executable__get_dir_for_layer_for_build
= $(patsubst $(1):%,%,$(filter $(1):%,$(call gb_Executable_LAYER_DIRS_FOR_BUILD
)))
55 gb_Executable__get_dir_for_exe
= $(call gb_Executable__get_dir_for_layer
,$(call gb_Executable_get_layer
,$(1)))
56 gb_Executable__get_dir_for_exe_for_build
= $(call gb_Executable__get_dir_for_layer_for_build
,$(call gb_Executable_get_layer
,$(1)))
58 define gb_Executable_Executable
59 $(call gb_Postprocess_register_target
,AllExecutables
,Executable
,$(1))
60 ifeq (,$$(findstring $(1),$$(gb_Executable_KNOWN
)))
61 $$(eval
$$(call gb_Output_info
,Currently known executables
: $(sort $(gb_Executable_KNOWN
)),ALL
))
62 $$(eval
$$(call gb_Output_error
,Executable
$(1) must be registered in Repository.mk or RepositoryExternal.mk
))
64 $(call gb_Executable__Executable_impl
,$(1),$(call gb_Executable_get_linktarget
,$(1)))
68 # call gb_Executable__Executable_impl,exe,linktarget
69 define gb_Executable__Executable_impl
70 $(call gb_LinkTarget_LinkTarget
,$(2),Executable_
$(1),$(call gb_Executable_get_layer
,$(1)))
71 $(call gb_LinkTarget_set_targettype
,$(2),Executable
)
72 $(call gb_LinkTarget_add_libs
,$(2),$(gb_STDLIBS
))
73 $(call gb_Executable_get_runtime_target
,$(1)) :|
$(dir $(call gb_Executable_get_runtime_target
,$(1))).
dir
74 $(call gb_Executable_get_runtime_target
,$(1)) : $(call gb_Executable_get_target_for_build
,$(1))
75 $(call gb_Executable_get_clean_target
,$(1)) : $(call gb_LinkTarget_get_clean_target
,$(2))
76 $(call gb_Executable_get_clean_target
,$(1)) : AUXTARGETS
:=
77 $(call gb_Executable_Executable_platform
,$(1),$(2),$(gb_Executable_BINDIR
)/$(1).lib
)
79 $$(eval
$$(call gb_Module_register_target
,$(call gb_Executable_get_target
,$(1)),$(call gb_Executable_get_clean_target
,$(1))))
80 $(call gb_Helper_make_userfriendly_targets
,$(1),Executable
)
84 define gb_Executable_set_targettype_gui
85 $(call gb_LinkTarget_get_target
,$(call gb_Executable_get_linktarget
,$(1))) : TARGETGUI
:= $(2)
88 define gb_Executable_forward_to_Linktarget
89 gb_Executable_
$(1) = $$(call gb_LinkTarget_
$(1),$$(call gb_Executable_get_linktarget
,$$(1)),$$(2),$$(3),Executable_
$$(1))
93 $(eval
$(foreach method
,\
106 add_exception_objects \
107 add_generated_cobjects \
108 add_generated_cxxobjects \
109 add_generated_exception_objects \
119 disable_standard_system_libs \
120 use_system_darwin_frameworks \
121 use_system_win32_libs \
122 set_library_path_flags \
127 use_internal_bootstrap_api \
128 use_internal_comprehensive_api \
130 use_static_libraries \
138 set_precompiled_header \
140 set_warnings_not_errors \
142 set_generated_cxx_suffix \
144 $(call gb_Executable_forward_to_Linktarget
,$(method
))\
149 # Add dependencies needed for running the executable
151 # gb_Executable_add_runtime_dependencies executable dependencies
152 define gb_Executable_add_runtime_dependencies
153 $(call gb_Executable_get_runtime_target
,$(1)) : $(2)
157 # vim: set noet sw=4: