1 | # $Id: VCC143.kmk 3623 2024-10-22 08:22:02Z bird $
|
---|
2 | ## @file
|
---|
3 | # kBuild Tool Config - Visual C++ 14.3 (aka Visual 2022 and MSC v19.30+), default target.
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (c) 2004-2024 knut st. osmundsen <bird-kBuild-spam-xx@anduin.net>
|
---|
8 | #
|
---|
9 | # This file is part of kBuild.
|
---|
10 | #
|
---|
11 | # kBuild is free software; you can redistribute it and/or modify
|
---|
12 | # it under the terms of the GNU General Public License as published by
|
---|
13 | # the Free Software Foundation; either version 2 of the License, or
|
---|
14 | # (at your option) any later version.
|
---|
15 | #
|
---|
16 | # kBuild 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 General Public License for more details.
|
---|
20 | #
|
---|
21 | # You should have received a copy of the GNU General Public License
|
---|
22 | # along with kBuild; if not, write to the Free Software
|
---|
23 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
---|
24 | #
|
---|
25 | #
|
---|
26 | # As a special exception you are granted permission to include this file, via
|
---|
27 | # the kmk include directive, as you wish without this in itself causing the
|
---|
28 | # resulting makefile, program or whatever to be covered by the GPL license.
|
---|
29 | # This exception does not however invalidate any other reasons why the makefile,
|
---|
30 | # program, whatever should not be covered the GPL.
|
---|
31 | #
|
---|
32 | #
|
---|
33 |
|
---|
34 | TOOL_VCC143 := Visual C++ 14.3 (aka Visual 2022 and MSC v19.30+), targeting $(KBUILD_TARGET).
|
---|
35 |
|
---|
36 | ifndef INCLUDED_WIN_COMMON_KMK
|
---|
37 | include $(KBUILD_PATH)/win-common.kmk
|
---|
38 | endif
|
---|
39 |
|
---|
40 | #
|
---|
41 | # Tool Specific Properties
|
---|
42 | #
|
---|
43 | ifndef PATH_TOOL_VCC143
|
---|
44 | PATH_TOOL_VCC143 := $(firstfile $(rversortfiles $(qwildcard ,$(KBUILD_DEVTOOLS)/win/vcc/v14.[34]*/Tools/MSVC/14.[34]?.*)))
|
---|
45 | ifeq ($(PATH_TOOL_VCC143),)
|
---|
46 | PATH_TOOL_VCC143 := $(firstfile $(rversortfiles $(qwildcard ,$(KBUILD_DEVTOOLS)/win.amd64/vcc/v14.[34]*/Tools/MSVC/14.[34]?.*)))
|
---|
47 | ifeq ($(PATH_TOOL_VCC143),)
|
---|
48 | PATH_TOOL_VCC143 := $(firstfile $(rversortfiles $(qwildcard ,$(KBUILD_DEVTOOLS)/win.x86/vcc/v14.[34]*/Tools/MSVC/14.[34]?.*)))
|
---|
49 | ifeq ($(PATH_TOOL_VCC143),)
|
---|
50 | PATH_TOOL_VCC143 := $(firstfile $(rversortfiles $(qwildcard ,$(KBUILD_DEVTOOLS)/win.arm64/vcc/v14.[34]*/Tools/MSVC/14.[34]?.*)))
|
---|
51 | ifeq ($(PATH_TOOL_VCC143),)
|
---|
52 | PATH_TOOL_VCC143 := $(PATH_TOOL_VCC143X86)
|
---|
53 | ifeq ($(PATH_TOOL_VCC143),)
|
---|
54 | PATH_TOOL_VCC143 := $(PATH_TOOL_VCC143AMD64)
|
---|
55 | ifeq ($(PATH_TOOL_VCC143),)
|
---|
56 | PATH_TOOL_VCC143 := $(firstfile $(foreach ver,2022,$(foreachfile progfilesdir,$(WINCMN_PROGRAM_FILES_LIST)\
|
---|
57 | , $(rversortfiles $(qwildcard ,$(progfilesdir)/Microsoft\ Visual\ Studio/$(ver)/BuildTools/VC/Tools/MSVC/14.[34]?.*)))))
|
---|
58 | ifeq ($(PATH_TOOL_VCC143),)
|
---|
59 | $(warning kBuild: PATH_TOOL_VCC143 cannot be determined!)
|
---|
60 | PATH_TOOL_VCC143 := $(KBUILD_DEVTOOLS)/win/vcc/v14.3/Tools/MSVC/14.30.00000
|
---|
61 | endif
|
---|
62 | endif
|
---|
63 | endif
|
---|
64 | endif
|
---|
65 | endif
|
---|
66 | endif
|
---|
67 | endif
|
---|
68 | else
|
---|
69 | # Resolve any fancy stuff once and for all.
|
---|
70 | PATH_TOOL_VCC143 := $(PATH_TOOL_VCC143)
|
---|
71 | endif
|
---|
72 |
|
---|
73 | ifndef PATH_TOOL_VCC143_BASE_BIN
|
---|
74 | PATH_TOOL_VCC143_BASE_BIN := $(PATH_TOOL_VCC143)/bin
|
---|
75 | endif
|
---|
76 | ifndef PATH_TOOL_VCC143_HOST_BIN
|
---|
77 | PATH_TOOL_VCC143_HOST_BIN := $(PATH_TOOL_VCC143_BASE_BIN)/Host$(WINCMN_MAP_ARCH.$(KBUILD_HOST_ARCH))
|
---|
78 | endif
|
---|
79 | ifndef PATH_TOOL_VCC143_BIN
|
---|
80 | PATH_TOOL_VCC143_BIN := $(PATH_TOOL_VCC143_HOST_BIN)/$(WINCMN_MAP_ARCH.$(KBUILD_TARGET_ARCH))
|
---|
81 | endif
|
---|
82 | PATH_TOOL_VCC143_BIN_QSH := $(requote sh,$(PATH_TOOL_VCC143_BIN))
|
---|
83 |
|
---|
84 | # A bunch of DLLs are only in the subdir matching the host one, so we need to add it to the PATH when cross compiling.
|
---|
85 | ifndef PATH_TOOL_VCC143_HOST_DLL_BIN
|
---|
86 | PATH_TOOL_VCC143_HOST_DLL_BIN := $(PATH_TOOL_VCC143_HOST_BIN)/$(WINCMN_MAP_ARCH.$(KBUILD_HOST_ARCH))
|
---|
87 | endif
|
---|
88 | ifndef PATH_TOOL_VCC143_DLL_BIN
|
---|
89 | ifneq ($(PATH_TOOL_VCC143_HOST_DLL_BIN),$(PATH_TOOL_VCC143_BIN))
|
---|
90 | PATH_TOOL_VCC143_DLL_BIN := $(PATH_TOOL_VCC143_HOST_DLL_BIN)
|
---|
91 | endif
|
---|
92 | endif
|
---|
93 |
|
---|
94 | PATH_TOOL_VCC143_LIB.amd64 ?= $(PATH_TOOL_VCC143)/lib/x64
|
---|
95 | PATH_TOOL_VCC143_LIB.arm32 ?= $(PATH_TOOL_VCC143)/lib/arm
|
---|
96 | PATH_TOOL_VCC143_LIB.arm64 ?= $(PATH_TOOL_VCC143)/lib/arm64
|
---|
97 | PATH_TOOL_VCC143_LIB.x86 ?= $(PATH_TOOL_VCC143)/lib/x86
|
---|
98 |
|
---|
99 | PATH_TOOL_VCC143_ONECORE_LIB.amd64 ?= $(PATH_TOOL_VCC143)/lib/onecore/x64
|
---|
100 | PATH_TOOL_VCC143_ONECORE_LIB.arm32 ?= $(PATH_TOOL_VCC143)/lib/onecore/arm
|
---|
101 | PATH_TOOL_VCC143_ONECORE_LIB.arm64 ?= $(PATH_TOOL_VCC143)/lib/onecore/arm64
|
---|
102 | PATH_TOOL_VCC143_ONECORE_LIB.x86 ?= $(PATH_TOOL_VCC143)/lib/onecore/x86
|
---|
103 |
|
---|
104 | PATH_TOOL_VCC143_INC ?= $(PATH_TOOL_VCC143)/include
|
---|
105 |
|
---|
106 | PATH_TOOL_VCC143_ATLMFC ?= $(PATH_TOOL_VCC143)/atlmfc
|
---|
107 | PATH_TOOL_VCC143_ATLMFC_INC ?= $(PATH_TOOL_VCC143_ATLMFC)/include
|
---|
108 | PATH_TOOL_VCC143_ATLMFC_LIB.x86 ?= $(PATH_TOOL_VCC143_ATLMFC)/lib/x86
|
---|
109 | PATH_TOOL_VCC143_ATLMFC_LIB.amd64 ?= $(PATH_TOOL_VCC143_ATLMFC)/lib/x64
|
---|
110 |
|
---|
111 | TOOL_VCC143_CC ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC143_BIN_QSH)/cl.exe
|
---|
112 | TOOL_VCC143_CXX ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC143_BIN_QSH)/cl.exe
|
---|
113 | ifeq ($(KBUILD_TARGET_ARCH),x86)
|
---|
114 | TOOL_VCC143_AS ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC143_BIN_QSH)/ml.exe
|
---|
115 | else
|
---|
116 | TOOL_VCC143_AS ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC143_BIN_QSH)/ml64.exe
|
---|
117 | endif
|
---|
118 | #TOOL_VCC143_AR ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC143_BIN_QSH)/lib.exe - just an exec wrapper for the below
|
---|
119 | TOOL_VCC143_AR ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC143_BIN_QSH)/link.exe /LIB
|
---|
120 | TOOL_VCC143_LD ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC143_BIN_QSH)/link.exe
|
---|
121 | TOOL_VCC143_DUMPBIN ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC143_BIN_QSH)/dumpbin.exe
|
---|
122 | TOOL_VCC143_EDITBIN ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC143_BIN_QSH)/editbin.exe
|
---|
123 |
|
---|
124 | TOOL_VCC143_RC ?= $(EXEC_X86_WIN32) $(call TOOL_VCC143_FN_FIND_SDK_TOOL,rc.exe,[Rr][Cc].[Ee][Xx][Ee],TOOL_VCC143_RC_CACHED)
|
---|
125 | TOOL_VCC143_MT ?= $(TOOL_VCC143_MT_RETRY) $(EXEC_X86_WIN32) $(call TOOL_VCC143_FN_FIND_SDK_TOOL,mt.exe,[Mm][Tt].[Ee][Xx][Ee],TOOL_VCC143_MT_CACHED)
|
---|
126 | TOOL_VCC143_MT_RETRY ?= $(WINCMN_MT_RETRY)
|
---|
127 |
|
---|
128 | ifdef TOOL_VCC143_USE_KSUBMIT
|
---|
129 | ifeq ($(KBUILD_HOST),win)
|
---|
130 | ifeq ($(findstring /HostX86/,$(PATH_TOOL_VCC143AMD64_BIN)),/HostX86/)
|
---|
131 | TOOL_VCC143_KSUBMIT ?= kmk_builtin_kSubmit --32-bit
|
---|
132 | else
|
---|
133 | TOOL_VCC143_KSUBMIT ?= kmk_builtin_kSubmit --64-bit
|
---|
134 | endif
|
---|
135 | ifdef PATH_TOOL_VCC143_DLL_BIN
|
---|
136 | TOOL_VCC143_KSUBMIT := $(TOOL_VCC143_KSUBMIT) --prepend "PATH=$(requote shell-in-dq,$(PATH_TOOL_VCC143_DLL_BIN));"
|
---|
137 | endif
|
---|
138 | TOOL_VCC143_KSUBMIT_DD := $(TOOL_VCC143_KSUBMIT) --
|
---|
139 | endif
|
---|
140 | endif
|
---|
141 | ifdef PATH_TOOL_VCC143_DLL_BIN
|
---|
142 | TOOL_VCC143_SETUP_ENV := $(REDIRECT) --prepend "PATH=$(requote shell-in-dq,$(PATH_TOOL_VCC143_DLL_BIN));" --$(SP)
|
---|
143 | ifndef TOOL_VCC143_KSUBMIT_DD
|
---|
144 | TOOL_VCC143_KSUBMIT_DD := $(TOOL_VCC143_SETUP_ENV)
|
---|
145 | endif
|
---|
146 | endif
|
---|
147 |
|
---|
148 |
|
---|
149 | ## Helper for finding rc.exe and mt.exe in the SDK.
|
---|
150 | TOOL_VCC143_FN_FIND_SDK_TOOL_SUB = $(eval $3 := $(qfirstfile sh,\
|
---|
151 | $(if-expr defined(PATH_SDK_WINSDK10_BIN) , $(qwildcard ,$(PATH_SDK_WINSDK10_BIN)/$2)) \
|
---|
152 | $(if-expr defined(PATH_SDK_WINPSDK71_BIN), $(qwildcard ,$(PATH_SDK_WINPSDK71_BIN)/$2)) \
|
---|
153 | $(if-expr defined(PATH_SDK_WINPSDK_BIN) , $(qwildcard ,$(PATH_SDK_WINPSDK_BIN)/$2)) \
|
---|
154 | $(rversortfiles $(qwildcard ,$(KBUILD_DEVTOOLS)/win/sdk/*/[Bb][Ii][Nn]/*/$(WINCMN_MAP_ARCH.$(KBUILD_HOST_ARCH))/$2)) \
|
---|
155 | $(rversortfiles $(qwildcard ,$(KBUILD_DEVTOOLS_HST)/win/sdk/*/[Bb][Ii][Nn]/*/$(WINCMN_MAP_ARCH.$(KBUILD_HOST_ARCH))/$2)) \
|
---|
156 | $(rversortfiles $(qwildcard ,$(KBUILD_DEVTOOLS_HST_ALT)/win/sdk/*/[Bb][Ii][Nn]/*/$(WINCMN_MAP_ARCH.$(KBUILD_HOST_ARCH))/$2)) \
|
---|
157 | $(rversortfiles $(qwildcard ,$(KBUILD_DEVTOOLS_HST)/sdk/*/[Bb][Ii][Nn]/$2)) \
|
---|
158 | $(rversortfiles $(qwildcard ,$(KBUILD_DEVTOOLS_HST_ALT)/sdk/*/[Bb][Ii][Nn]/$2)) \
|
---|
159 | $1))
|
---|
160 | TOOL_VCC143_FN_FIND_SDK_TOOL = $(if-expr !defined($3),$(TOOL_VCC143_FN_FIND_SDK_TOOL_SUB),)$($3)
|
---|
161 |
|
---|
162 | ## Constructs the correct .pdb name (the name is lowercased).
|
---|
163 | # @param $(1) Base name, no extention.
|
---|
164 | # @param $(2) The extension.
|
---|
165 | TOOL_VCC143_PDB = $(dir $(1))$(tolower $(notdir $(1))).$(2)
|
---|
166 |
|
---|
167 | #
|
---|
168 | # Try find the redist directory. A little complicated as the build number
|
---|
169 | # doesn't necessarily match that of the compiler.
|
---|
170 | #
|
---|
171 | ifeq ($(tolower $(substr $(qdir u,$(PATH_TOOL_VCC143)), -12)),/tools/msvc/)
|
---|
172 | PATH_TOOL_VCC143_REDIST ?= $(firstfile $(qwildcard ,$(substr $(qdir ,$(PATH_TOOL_VCC143)), 1, -12)/Redist/MSVC/14.[34]*))
|
---|
173 | else
|
---|
174 | PATH_TOOL_VCC143_REDIST ?= $(qabspath ,$(firstfile $(qwildcard ,\
|
---|
175 | $(PATH_TOOL_VCC143)/Redist \
|
---|
176 | $(PATH_TOOL_VCC143)/../Redist \
|
---|
177 | $(PATH_TOOL_VCC143)/../../Redist \
|
---|
178 | $(PATH_TOOL_VCC143)/../../../Redist \
|
---|
179 | $(PATH_TOOL_VCC143)/../../../../Redist)))
|
---|
180 | endif
|
---|
181 | PATH_TOOL_VCC143_REDIST_DEBUG ?= $(PATH_TOOL_VCC143_REDIST)/debug_nonredist
|
---|
182 |
|
---|
183 | ## Updates may add more msvcp140_[0-9].dll images as the product matures.
|
---|
184 | # This helper locates them (can differ between archs).
|
---|
185 | # @param 1 Redist subdirectory.
|
---|
186 | # @param 2 The DLL basename (no suffix).
|
---|
187 | # @param 3 The VCC architecture name (for constructing the path).
|
---|
188 | FN_TOOL_VCC143_FIND_DLLS = $(2).dll \
|
---|
189 | $(versortfiles $(qnotdir ,$(qwildcard ,$(PATH_TOOL_VCC143_REDIST)/$(3)/$(1)/$(2)_?.dll)))
|
---|
190 |
|
---|
191 | ## This is for finding vcruntime140_thread.dll and other one-offs.
|
---|
192 | # @param 1 Redist subdirectory.
|
---|
193 | # @param 2 The full DLL name.
|
---|
194 | # @param 3 The VCC architecture name (for constructing the path).
|
---|
195 | FN_TOOL_VCC143_FIND_1_DLL = \
|
---|
196 | $(versortfiles $(qnotdir ,$(qwildcard ,$(PATH_TOOL_VCC143_REDIST)/$(3)/$(1)/$(2))))
|
---|
197 |
|
---|
198 | TOOL_VCC143_REDIST_CRT_SUBDIR := Microsoft.VC143.CRT
|
---|
199 | TOOL_VCC143_REDIST_DEBUG_CRT_SUBDIR := Microsoft.VC143.DebugCRT
|
---|
200 |
|
---|
201 | TOOL_VCC143_REDIST_CRT_DLLS.x86 = \
|
---|
202 | $(call FN_TOOL_VCC143_FIND_DLLS,$(TOOL_VCC143_REDIST_CRT_SUBDIR),vcruntime140,x86) \
|
---|
203 | $(call FN_TOOL_VCC143_FIND_1_DLL,$(TOOL_VCC143_REDIST_CRT_SUBDIR),vcruntime140_threads.dll,x86)
|
---|
204 | TOOL_VCC143_REDIST_CRT_DLLS.amd64 = \
|
---|
205 | $(call FN_TOOL_VCC143_FIND_DLLS,$(TOOL_VCC143_REDIST_CRT_SUBDIR),vcruntime140,x64) \
|
---|
206 | $(call FN_TOOL_VCC143_FIND_1_DLL,$(TOOL_VCC143_REDIST_CRT_SUBDIR),vcruntime140_threads.dll,x64)
|
---|
207 | TOOL_VCC143_REDIST_CRT_DLLS.arm32 = \
|
---|
208 | $(call FN_TOOL_VCC143_FIND_DLLS,$(TOOL_VCC143_REDIST_CRT_SUBDIR),vcruntime140,arm) \
|
---|
209 | $(call FN_TOOL_VCC143_FIND_1_DLL,$(TOOL_VCC143_REDIST_CRT_SUBDIR),vcruntime140_threads.dll,arm)
|
---|
210 | TOOL_VCC143_REDIST_CRT_DLLS.arm64 = \
|
---|
211 | $(call FN_TOOL_VCC143_FIND_DLLS,$(TOOL_VCC143_REDIST_CRT_SUBDIR),vcruntime140,arm64) \
|
---|
212 | $(call FN_TOOL_VCC143_FIND_1_DLL,$(TOOL_VCC143_REDIST_CRT_SUBDIR),vcruntime140_threads.dll,arm64)
|
---|
213 | TOOL_VCC143_REDIST_CRT_DLLS = $(TOOL_VCC143_REDIST_CRT_DLLS.$(KBUILD_TARGET_ARCH))
|
---|
214 |
|
---|
215 | TOOL_VCC143_REDIST_CONCRT_DLLS.x86 = $(call FN_TOOL_VCC143_FIND_DLLS,$(TOOL_VCC143_REDIST_CRT_SUBDIR),concrt140,x86)
|
---|
216 | TOOL_VCC143_REDIST_CONCRT_DLLS.amd64 = $(call FN_TOOL_VCC143_FIND_DLLS,$(TOOL_VCC143_REDIST_CRT_SUBDIR),concrt140,x64)
|
---|
217 | TOOL_VCC143_REDIST_CONCRT_DLLS.arm32 = $(call FN_TOOL_VCC143_FIND_DLLS,$(TOOL_VCC143_REDIST_CRT_SUBDIR),concrt140,arm)
|
---|
218 | TOOL_VCC143_REDIST_CONCRT_DLLS.arm64 = $(call FN_TOOL_VCC143_FIND_DLLS,$(TOOL_VCC143_REDIST_CRT_SUBDIR),concrt140,arm64)
|
---|
219 | TOOL_VCC143_REDIST_CONCRT_DLLS = $(TOOL_VCC143_REDIST_CONCRT_DLLS.$(KBUILD_TARGET_ARCH))
|
---|
220 |
|
---|
221 | TOOL_VCC143_REDIST_CPP_DLLS.x86 = $(call FN_TOOL_VCC143_FIND_DLLS,$(TOOL_VCC143_REDIST_CRT_SUBDIR),msvcp140,x86)
|
---|
222 | TOOL_VCC143_REDIST_CPP_DLLS.amd64 = $(call FN_TOOL_VCC143_FIND_DLLS,$(TOOL_VCC143_REDIST_CRT_SUBDIR),msvcp140,x64)
|
---|
223 | TOOL_VCC143_REDIST_CPP_DLLS.arm32 = $(call FN_TOOL_VCC143_FIND_DLLS,$(TOOL_VCC143_REDIST_CRT_SUBDIR),msvcp140,arm)
|
---|
224 | TOOL_VCC143_REDIST_CPP_DLLS.arm64 = $(call FN_TOOL_VCC143_FIND_DLLS,$(TOOL_VCC143_REDIST_CRT_SUBDIR),msvcp140,arm64)
|
---|
225 | TOOL_VCC143_REDIST_CPP_DLLS = $(TOOL_VCC143_REDIST_CPP_DLLS.$(KBUILD_TARGET_ARCH))
|
---|
226 |
|
---|
227 | TOOL_VCC143_REDIST_WINRT_DLLS.x86 = $(call FN_TOOL_VCC143_FIND_DLLS,$(TOOL_VCC143_REDIST_CRT_SUBDIR),vccorlib140,x86)
|
---|
228 | TOOL_VCC143_REDIST_WINRT_DLLS.amd64 = $(call FN_TOOL_VCC143_FIND_DLLS,$(TOOL_VCC143_REDIST_CRT_SUBDIR),vccorlib140,x64)
|
---|
229 | TOOL_VCC143_REDIST_WINRT_DLLS.arm32 = $(call FN_TOOL_VCC143_FIND_DLLS,$(TOOL_VCC143_REDIST_CRT_SUBDIR),vccorlib140,arm)
|
---|
230 | TOOL_VCC143_REDIST_WINRT_DLLS.arm64 = $(call FN_TOOL_VCC143_FIND_DLLS,$(TOOL_VCC143_REDIST_CRT_SUBDIR),vccorlib140,arm64)
|
---|
231 | TOOL_VCC143_REDIST_WINRT_DLLS = $(TOOL_VCC143_REDIST_WINRT_DLLS.$(KBUILD_TARGET_ARCH))
|
---|
232 |
|
---|
233 | TOOL_VCC143_REDIST_CXXAMP_SUBDIR := Microsoft.VC143.CXXAMP
|
---|
234 | TOOL_VCC143_REDIST_MFC_SUBDIR := Microsoft.VC143.MFC
|
---|
235 | TOOL_VCC143_REDIST_MFCLOC_SUBDIR := Microsoft.VC143.MFCLOC
|
---|
236 | TOOL_VCC143_REDIST_OPENMP_SUBDIR := Microsoft.VC143.OpenMP
|
---|
237 |
|
---|
238 |
|
---|
239 | #
|
---|
240 | # Properties used by kBuild
|
---|
241 | #
|
---|
242 | TOOL_VCC143_COBJSUFF ?= .obj
|
---|
243 | TOOL_VCC143_CFLAGS ?= -TC -nologo -Zi -ZH:SHA_256
|
---|
244 | TOOL_VCC143_CFLAGS.debug ?=
|
---|
245 | TOOL_VCC143_CFLAGS.dbgopt ?= -O2
|
---|
246 | TOOL_VCC143_CFLAGS.release ?= -O2
|
---|
247 | TOOL_VCC143_CFLAGS.profile ?= -O2
|
---|
248 | TOOL_VCC143_CINCS ?= $(PATH_TOOL_VCC143_INC)
|
---|
249 | TOOL_VCC143_CDEFS ?=
|
---|
250 |
|
---|
251 | TOOL_VCC143_CXXOBJSUFF ?= .obj
|
---|
252 | TOOL_VCC143_CXXFLAGS ?= -TP -nologo -Zi -ZH:SHA_256
|
---|
253 | TOOL_VCC143_CXXFLAGS.debug ?=
|
---|
254 | TOOL_VCC143_CXXFLAGS.dbgopt ?= -O2
|
---|
255 | TOOL_VCC143_CXXFLAGS.release ?= -O2
|
---|
256 | TOOL_VCC143_CXXFLAGS.profile ?= -O2
|
---|
257 | TOOL_VCC143_CXXINCS ?= $(PATH_TOOL_VCC143_INC) $(PATH_TOOL_VCC143_ATLMFC_INC)
|
---|
258 | TOOL_VCC143_CXXDEFS ?=
|
---|
259 |
|
---|
260 | TOOL_VCC143_ASOBJSUFF ?= .obj
|
---|
261 |
|
---|
262 | TOOL_VCC143_RCOBJSUFF ?= .res
|
---|
263 | TOOL_VCC143_RCINCS ?= $(PATH_TOOL_VCC143_INC) $(PATH_TOOL_VCC143_ATLMFC_INC)
|
---|
264 |
|
---|
265 | TOOL_VCC143_ARFLAGS ?= -nologo
|
---|
266 | TOOL_VCC143_ARFLAGS.x86 ?= -machine:x86
|
---|
267 | TOOL_VCC143_ARFLAGS.amd64 ?= -machine:amd64
|
---|
268 | TOOL_VCC143_ARFLAGS.arm32 ?= -machine:arm
|
---|
269 | TOOL_VCC143_ARLIBSUFF ?= .lib
|
---|
270 |
|
---|
271 | TOOL_VCC143_LDFLAGS ?= -nologo
|
---|
272 | TOOL_VCC143_LDFLAGS.x86 ?= -machine:x86
|
---|
273 | TOOL_VCC143_LDFLAGS.amd64 ?= -machine:amd64
|
---|
274 | TOOL_VCC143_LDFLAGS.arm32 ?= -machine:arm
|
---|
275 | TOOL_VCC143_LDFLAGS.debug ?= -debug
|
---|
276 | TOOL_VCC143_LDFLAGS.dbgopt ?= -debug
|
---|
277 | TOOL_VCC143_LDFLAGS.profile ?= -debug
|
---|
278 | TOOL_VCC143_LDFLAGS.release ?=
|
---|
279 |
|
---|
280 |
|
---|
281 |
|
---|
282 | ## Compile C source.
|
---|
283 | # @param $(target) Normalized main target name.
|
---|
284 | # @param $(source) Source filename (relative).
|
---|
285 | # @param $(obj) Object file name. This shall be (re)created by the compilation.
|
---|
286 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
|
---|
287 | # @param $(flags) Flags.
|
---|
288 | # @param $(defs) Definitions. No -D or something.
|
---|
289 | # @param $(incs) Includes. No -I or something.
|
---|
290 | # @param $(dirdep) Directory creation dependency.
|
---|
291 | # @param $(deps) Other dependencies.
|
---|
292 | #
|
---|
293 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
294 | # @param $(objsuff) Object suffix.
|
---|
295 | # @note The -d1scalableinclude- option disables include directory caching as the cache goes
|
---|
296 | # stale in kWorker. Besides, kWorker does it's own caching, so it is not necessary.
|
---|
297 | TOOL_VCC143_COMPILE_C_DEPEND =
|
---|
298 | TOOL_VCC143_COMPILE_C_DEPORD =
|
---|
299 | TOOL_VCC143_COMPILE_C_OUTPUT =
|
---|
300 | TOOL_VCC143_COMPILE_C_OUTPUT_MAYBE = $(call TOOL_VCC143_PDB, $(outbase)-obj,pdb) $(call TOOL_VCC143_PDB, $(outbase)-obj,idb)
|
---|
301 | ifdef TOOL_VCC143_KSUBMIT
|
---|
302 | TOOL_VCC143_COMPILE_C_DONT_PURGE_OUTPUT := 1 # speed
|
---|
303 | define TOOL_VCC143_COMPILE_C_CMDS
|
---|
304 | $(QUIET)$(TOOL_VCC143_KSUBMIT) -P $(DEP_OBJ_INT) -f -s -q -o $(dep) -t $(obj) $(obj)\
|
---|
305 | -- $(TOOL_VCC143_CC) -c -d1scalableinclude-\
|
---|
306 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
307 | -Fd$(outbase)-obj.pdb \
|
---|
308 | -Fo$(obj)\
|
---|
309 | $(subst /,\\,$(abspath $(source)))
|
---|
310 | endef
|
---|
311 | else
|
---|
312 | define TOOL_VCC143_COMPILE_C_CMDS
|
---|
313 | $(QUIET)$(TOOL_VCC143_SETUP_ENV)$(TOOL_VCC143_CC) -c\
|
---|
314 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
315 | -Fd$(outbase)-obj.pdb \
|
---|
316 | -Fo$(obj)\
|
---|
317 | $(subst /,\\,$(abspath $(source)))
|
---|
318 | $(QUIET)$(DEP_OBJ) -f -s -q -o $(dep) -t $(obj) $(obj)
|
---|
319 | endef
|
---|
320 | endif # !TOOL_VCC143_KSUBMIT
|
---|
321 |
|
---|
322 |
|
---|
323 | ## Compile C++ source.
|
---|
324 | # @param $(target) Normalized main target name.
|
---|
325 | # @param $(source) Source filename (relative).
|
---|
326 | # @param $(obj) Object file name. This shall be (re)created by the compilation.
|
---|
327 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
|
---|
328 | # @param $(flags) Flags.
|
---|
329 | # @param $(defs) Definitions. No -D or something.
|
---|
330 | # @param $(incs) Includes. No -I or something.
|
---|
331 | # @param $(dirdep) Directory creation dependency.
|
---|
332 | # @param $(deps) Other dependencies.
|
---|
333 | #
|
---|
334 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
335 | # @param $(objsuff) Object suffix.
|
---|
336 | # @note The -d1scalableinclude- option disables include directory caching as the cache goes
|
---|
337 | # stale in kWorker. Besides, kWorker does it's own caching, so it is not necessary.
|
---|
338 | # ('-d1' means it's passed to c1.dll/c1xx.dll and 'scalableinclude-' is the actual option.)
|
---|
339 | TOOL_VCC143_COMPILE_CXX_DEPEND = $($(target)_1_VCC_PCH_FILE)
|
---|
340 | TOOL_VCC143_COMPILE_CXX_DEPORD =
|
---|
341 | TOOL_VCC143_COMPILE_CXX_OUTPUT =
|
---|
342 | TOOL_VCC143_COMPILE_CXX_OUTPUT_MAYBE = $(if-expr defined($(target)_1_VCC_COMMON_OBJ_PDB)\
|
---|
343 | ,,$(call TOOL_VCC143_PDB, $(outbase)-obj,pdb) $(call TOOL_VCC143_PDB, $(outbase)-obj,idb))
|
---|
344 | ifdef TOOL_VCC143_KSUBMIT
|
---|
345 | TOOL_VCC143_COMPILE_CXX_DONT_PURGE_OUTPUT := 1 # speed
|
---|
346 | define TOOL_VCC143_COMPILE_CXX_CMDS
|
---|
347 | $(QUIET)$(TOOL_VCC143_KSUBMIT) -P $(DEP_OBJ_INT) -f -s -q -o $(dep) -t $(obj) $(obj)\
|
---|
348 | -- $(TOOL_VCC143_CXX) -c -d1scalableinclude-\
|
---|
349 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
350 | $(if-expr defined($(target)_PCH_HDR)\
|
---|
351 | ,-FI$($(target)_PCH_HDR) -Yu$($(target)_PCH_HDR) -Fp$($(target)_1_VCC_PCH_FILE) -FS,)\
|
---|
352 | -Fd$(if-expr defined($(target)_1_VCC_COMMON_OBJ_PDB),$($(target)_1_VCC_COMMON_OBJ_PDB),$(outbase)-obj.pdb) \
|
---|
353 | -Fo$(obj)\
|
---|
354 | $(subst /,\\,$(abspath $(source)))
|
---|
355 | endef
|
---|
356 | else
|
---|
357 | define TOOL_VCC143_COMPILE_CXX_CMDS
|
---|
358 | $(QUIET)$(TOOL_VCC143_SETUP_ENV)$(TOOL_VCC143_CXX) -c\
|
---|
359 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
360 | $(if-expr defined($(target)_PCH_HDR)\
|
---|
361 | ,-FI$($(target)_PCH_HDR) -Yu$($(target)_PCH_HDR) -Fp$($(target)_1_VCC_PCH_FILE) -FS,)\
|
---|
362 | -Fd$(if-expr defined($(target)_1_VCC_COMMON_OBJ_PDB),$($(target)_1_VCC_COMMON_OBJ_PDB),$(outbase)-obj.pdb) \
|
---|
363 | -Fo$(obj)\
|
---|
364 | $(subst /,\\,$(abspath $(source)))
|
---|
365 | $(QUIET)$(DEP_OBJ) -f -s -q -o $(dep) -t $(obj) $(obj)
|
---|
366 | endef
|
---|
367 | endif # !TOOL_VCC143_KSUBMIT
|
---|
368 |
|
---|
369 |
|
---|
370 | #
|
---|
371 | # Helper tool for creating the precompiled C++ header.
|
---|
372 | #
|
---|
373 | # It only have the C++ compile bits and it's purpose is to skip bits
|
---|
374 | # related _1_VCC_PCH_FILE and add -Yc.
|
---|
375 | #
|
---|
376 | TOOL_VCC143-PCH := Helper for creating precompiled header using CXX handling.
|
---|
377 | TOOL_VCC143-PCH_EXTENDS := VCC143
|
---|
378 | TOOL_VCC143-PCH_CXXOBJSUFF := .obj
|
---|
379 | TOOL_VCC143-PCH_CXXINCS = $(TOOL_VCC143_CXXINCS)
|
---|
380 | TOOL_VCC143-PCH_CXXFLAGS = $(TOOL_VCC143_CXXFLAGS) -FS
|
---|
381 | TOOL_VCC143-PCH_CXXFLAGS.debug = $(TOOL_VCC143_CXXFLAGS.debug)
|
---|
382 | TOOL_VCC143-PCH_CXXFLAGS.dbgopt = $(TOOL_VCC143_CXXFLAGS.dbgopt)
|
---|
383 | TOOL_VCC143-PCH_CXXFLAGS.release = $(TOOL_VCC143_CXXFLAGS.release)
|
---|
384 | TOOL_VCC143-PCH_CXXFLAGS.profile = $(TOOL_VCC143_CXXFLAGS.profile)
|
---|
385 | TOOL_VCC143-PCH_COMPILE_CXX_DEPEND = $(NO_SUCH_VARIABLE)
|
---|
386 | TOOL_VCC143-PCH_COMPILE_CXX_DEPORD = $(NO_SUCH_VARIABLE)
|
---|
387 | TOOL_VCC143-PCH_COMPILE_CXX_OUTPUT = $($(target)_1_VCC_PCH_FILE) $($(target)_1_VCC_COMMON_OBJ_PDB)
|
---|
388 | TOOL_VCC143-PCH_COMPILE_CXX_OUTPUT_MAYBE = $(NO_SUCH_VARIABLE)
|
---|
389 | ifdef TOOL_VCC143_KSUBMIT
|
---|
390 | define TOOL_VCC143-PCH_COMPILE_CXX_CMDS
|
---|
391 | $(QUIET)$(RM) -f -- $($(target)_1_VCC_PCH_FILE) $($(target)_1_VCC_COMMON_OBJ_PDB)
|
---|
392 | $(QUIET)$(TOOL_VCC143_KSUBMIT) --no-pch-caching -P $(DEP_OBJ_INT) -f -s -q -e .pch -o $(dep) -t $(obj) $(obj)\
|
---|
393 | -- $(TOOL_VCC143_CXX) -c -Yc -d1scalableinclude-\
|
---|
394 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
395 | -Fp$($(target)_1_VCC_PCH_FILE) \
|
---|
396 | -Fd$($(target)_1_VCC_COMMON_OBJ_PDB) \
|
---|
397 | -Fo$(obj)\
|
---|
398 | -TP \
|
---|
399 | $(subst /,\\,$(abspath $(source)))
|
---|
400 | endef
|
---|
401 | else
|
---|
402 | define TOOL_VCC143-PCH_COMPILE_CXX_CMDS
|
---|
403 | $(QUIET)$(RM) -f -- $($(target)_1_VCC_PCH_FILE) $($(target)_1_VCC_COMMON_OBJ_PDB)
|
---|
404 | $(QUIET)$(TOOL_VCC143_SETUP_ENV)$(TOOL_VCC143_CXX) -c -Yc\
|
---|
405 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
406 | -Fp$($(target)_1_VCC_PCH_FILE) \
|
---|
407 | -Fd$($(target)_1_VCC_COMMON_OBJ_PDB) \
|
---|
408 | -Fo$(obj)\
|
---|
409 | -TP \
|
---|
410 | $(subst /,\\,$(abspath $(source)))
|
---|
411 | $(QUIET)$(DEP_OBJ) -f -s -q -e .pch -o $(dep) -t $(obj) $(obj)
|
---|
412 |
|
---|
413 | endef
|
---|
414 | endif # !TOOL_VCC143_KSUBMIT
|
---|
415 |
|
---|
416 |
|
---|
417 | ## @todo configure the assembler template.
|
---|
418 |
|
---|
419 | ## Compile resource source.
|
---|
420 | # @param $(target) Normalized main target name.
|
---|
421 | # @param $(source) Source filename (relative).
|
---|
422 | # @param $(obj) Object file name. This shall be (re)created by the compilation.
|
---|
423 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
|
---|
424 | # @param $(flags) Flags.
|
---|
425 | # @param $(defs) Definitions. No -D or something.
|
---|
426 | # @param $(incs) Includes. No -I or something.
|
---|
427 | # @param $(dirdep) Directory creation dependency.
|
---|
428 | # @param $(deps) Other dependencies.
|
---|
429 | #
|
---|
430 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
431 | # @param $(objsuff) Object suffix.
|
---|
432 | TOOL_VCC143_COMPILE_RC_DEPEND =
|
---|
433 | TOOL_VCC143_COMPILE_RC_DEPORD =
|
---|
434 | TOOL_VCC143_COMPILE_RC_OUTPUT =
|
---|
435 | define TOOL_VCC143_COMPILE_RC_CMDS
|
---|
436 | $(QUIET)$(TOOL_VCC143_RC) \
|
---|
437 | $(flags) $(qaddprefix sh,/i, $(subst /,\\,$(incs))) $(qaddprefix sh,/d, $(defs))\
|
---|
438 | /fo$(obj)\
|
---|
439 | $(subst /,\\,$(abspath $(source)))
|
---|
440 | endef
|
---|
441 |
|
---|
442 |
|
---|
443 | ## Link library
|
---|
444 | # @param $(target) Normalized main target name.
|
---|
445 | # @param $(out) Library name.
|
---|
446 | # @param $(objs) Object files to put in the library.
|
---|
447 | # @param $(flags) Flags.
|
---|
448 | # @param $(dirdep) Directory creation dependency.
|
---|
449 | # @param $(deps) Other dependencies.
|
---|
450 | # @param $(othersrc) Unhandled sources.
|
---|
451 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
452 | #
|
---|
453 | TOOL_VCC143_LINK_LIBRARY_DEPEND = $(othersrc)
|
---|
454 | TOOL_VCC143_LINK_LIBRARY_DEPORD =
|
---|
455 | TOOL_VCC143_LINK_LIBRARY_OUTPUT = $(outbase).rsp
|
---|
456 | TOOL_VCC143_LINK_LIBRARY_OUTPUT_MAYBE = $(outbase).lst $(outbase).exp $(outbase).pdb
|
---|
457 | define TOOL_VCC143_LINK_LIBRARY_CMDS
|
---|
458 | $(QUIET)$(APPEND) -tn $(outbase).rsp \
|
---|
459 | $(qforeachfile u,arg, $(objs) $(filter-out %.def,$(othersrc)),$(quote-sh "$(subst /,\,$(arg))")) \
|
---|
460 | $(qforeachfile u,arg, $(filter %.def,$(othersrc)),$(quote-sh "/DEF:$(subst /,\,$(arg))"))
|
---|
461 | $(QUIET)$(TOOL_VCC143_KSUBMIT_DD) $(TOOL_VCC143_AR) $(flags) /OUT:$(out) @$(outbase).rsp
|
---|
462 | endef
|
---|
463 |
|
---|
464 |
|
---|
465 | ## Link program
|
---|
466 | # @param $(target) Normalized main target name.
|
---|
467 | # @param $(out) Program name.
|
---|
468 | # @param $(objs) Object files to link together.
|
---|
469 | # @param $(libs) Libraries to search.
|
---|
470 | # @param $(libpath) Library search paths.
|
---|
471 | # @param $(flags) Flags.
|
---|
472 | # @param $(dirdep) Directory creation dependency.
|
---|
473 | # @param $(deps) Other dependencies.
|
---|
474 | # @param $(othersrc) Unhandled sources.
|
---|
475 | # @param $(custom_pre) Custom step invoked before linking.
|
---|
476 | # @param $(custom_post) Custom step invoked after linking.
|
---|
477 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
478 | #
|
---|
479 | TOOL_VCC143_LINK_PROGRAM_DEPEND = $(foreachfile lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
|
---|
480 | TOOL_VCC143_LINK_PROGRAM_DEPORD =
|
---|
481 | TOOL_VCC143_LINK_PROGRAM_OUTPUT_MAYBE_PRECIOUS = $(outbase).map $(outbase).rsp
|
---|
482 | TOOL_VCC143_LINK_PROGRAM_OUTPUT_MAYBE = $(outbase).lib $(outbase).exp $(outbase).ilk $(out).manifest
|
---|
483 | TOOL_VCC143_LINK_PROGRAM_OUTPUT_DEBUG = $(outbase).pdb
|
---|
484 | TOOL_VCC143_LINK_PROGRAM_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
|
---|
485 | define TOOL_VCC143_LINK_PROGRAM_CMDS
|
---|
486 | $(QUIET)$(APPEND) -tn $(outbase).rsp \
|
---|
487 | $(qforeachfile u,arg, $(objs) $(libs),$(quote-sh "$(subst /,\,$(arg))"))
|
---|
488 | $(QUIET)$(TOOL_VCC143_KSUBMIT_DD) $(TOOL_VCC143_LD) $(flags) \
|
---|
489 | /OUT:$(out) \
|
---|
490 | /MAPINFO:EXPORTS /INCREMENTAL:NO \
|
---|
491 | /MAP:$(outbase).map \
|
---|
492 | $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
|
---|
493 | $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
|
---|
494 | $(qaddprefix sh,/LIBPATH:,$(libpath)) \
|
---|
495 | @$(outbase).rsp
|
---|
496 | ifndef TOOL_VCC143_NO_AUTO_MANIFEST
|
---|
497 | $(QUIET)$(TEST) -f $(out).manifest -- \
|
---|
498 | $(TOOL_VCC143_MT) -manifest $(subst /,\\,$(out)).manifest -outputresource:$(subst /,\\,$(out))
|
---|
499 | endif
|
---|
500 | endef
|
---|
501 |
|
---|
502 |
|
---|
503 | ## Link DLL.
|
---|
504 | # @param $(target) Normalized main target name.
|
---|
505 | # @param $(out) DLL name.
|
---|
506 | # @param $(objs) Object files to link together.
|
---|
507 | # @param $(libs) Libraries to search.
|
---|
508 | # @param $(libpath) Library search paths.
|
---|
509 | # @param $(flags) Flags.
|
---|
510 | # @param $(dirdep) Directory creation dependency.
|
---|
511 | # @param $(deps) Other dependencies.
|
---|
512 | # @param $(othersrc) Unhandled sources.
|
---|
513 | # @param $(custom_pre) Custom step invoked before linking.
|
---|
514 | # @param $(custom_post) Custom step invoked after linking.
|
---|
515 | #
|
---|
516 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
517 | TOOL_VCC143_LINK_DLL_DEPEND = $(foreachfile lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
|
---|
518 | TOOL_VCC143_LINK_DLL_DEPORD = $(call DIRDEP,$(PATH_STAGE_LIB))
|
---|
519 | TOOL_VCC143_LINK_DLL_OUTPUT = $(outbase).lib $(outbase).exp
|
---|
520 | TOOL_VCC143_LINK_DLL_OUTPUT_MAYBE = $(outbase).ilk $(out).manifest $(PATH_STAGE_LIB)/$(notdir $(outbase)).exp
|
---|
521 | TOOL_VCC143_LINK_DLL_OUTPUT_MAYBE_PRECIOUS = $(PATH_STAGE_LIB)/$(notdir $(outbase)).lib $(outbase).map $(outbase).rsp
|
---|
522 | TOOL_VCC143_LINK_DLL_OUTPUT_DEBUG = $(outbase).pdb
|
---|
523 | TOOL_VCC143_LINK_DLL_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
|
---|
524 | define TOOL_VCC143_LINK_DLL_CMDS
|
---|
525 | $(QUIET)$(APPEND) -tn $(outbase).rsp \
|
---|
526 | $(qforeachfile u,arg, $(objs) $(libs),$(quote-sh "$(subst /,\,$(arg))"))
|
---|
527 | $(QUIET)$(TOOL_VCC143_KSUBMIT_DD) $(TOOL_VCC143_LD) $(flags) \
|
---|
528 | /OUT:$(out) \
|
---|
529 | /IMPLIB:$(outbase).lib \
|
---|
530 | /MAPINFO:EXPORTS /INCREMENTAL:NO \
|
---|
531 | /MAP:$(outbase).map \
|
---|
532 | /DLL \
|
---|
533 | $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
|
---|
534 | $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
|
---|
535 | $(qaddprefix sh,/LIBPATH:,$(libpath)) \
|
---|
536 | @$(outbase).rsp
|
---|
537 | ifndef TOOL_VCC143_NO_AUTO_MANIFEST
|
---|
538 | $(QUIET)$(TEST) -f $(out).manifest -- \
|
---|
539 | $(TOOL_VCC143_MT) -manifest $(subst /,\\,$(out)).manifest '-outputresource:$(subst /,\\,$(out));#2'
|
---|
540 | endif
|
---|
541 | $(QUIET)$(TEST) -f $(outbase).lib -- $(KLIBTWEAKER_EXT) --clear-timestamps $(outbase).lib
|
---|
542 | $(QUIET)$(CP) --changed -v --ignore-non-existing $(outbase).exp $(outbase).lib $(PATH_STAGE_LIB)/
|
---|
543 | $(eval _DIRS += $(PATH_STAGE_LIB))
|
---|
544 | endef
|
---|
545 |
|
---|
546 |
|
---|
547 | ## Link system module (windows aka driver, linux aka kernel module)
|
---|
548 | # @param $(target) Normalized main target name.
|
---|
549 | # @param $(out) System module name.
|
---|
550 | # @param $(objs) Object files to link together.
|
---|
551 | # @param $(libs) Libraries to search.
|
---|
552 | # @param $(libpath) Library search paths.
|
---|
553 | # @param $(flags) Flags.
|
---|
554 | # @param $(dirdep) Directory creation dependency.
|
---|
555 | # @param $(deps) Other dependencies.
|
---|
556 | # @param $(othersrc) Unhandled sources.
|
---|
557 | # @param $(custom_pre) Custom step invoked before linking.
|
---|
558 | # @param $(custom_post) Custom step invoked after linking.
|
---|
559 | #
|
---|
560 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
561 | TOOL_VCC143_LINK_SYSMOD_DEPEND = $(foreachfile lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
|
---|
562 | TOOL_VCC143_LINK_SYSMOD_DEPORD =
|
---|
563 | TOOL_VCC143_LINK_SYSMOD_OUTPUT_MAYBE = $(outbase).lib $(outbase).exp $(outbase).ilk $(out).manifest
|
---|
564 | TOOL_VCC143_LINK_SYSMOD_OUTPUT_MAYBE_PRECIOUS = $(outbase).map $(outbase).rsp
|
---|
565 | TOOL_VCC143_LINK_SYSMOD_OUTPUT_DEBUG = $(outbase).pdb
|
---|
566 | TOOL_VCC143_LINK_SYSMOD_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
|
---|
567 | define TOOL_VCC143_LINK_SYSMOD_CMDS
|
---|
568 | $(QUIET)$(APPEND) -tn $(outbase).rsp \
|
---|
569 | $(qforeachfile u,arg, $(objs) $(libs),$(quote-sh "$(subst /,\,$(arg))"))
|
---|
570 | $(QUIET)$(TOOL_VCC143_KSUBMIT_DD) $(TOOL_VCC143_LD) $(flags) \
|
---|
571 | /OUT:$(out) \
|
---|
572 | /MAPINFO:EXPORTS /INCREMENTAL:NO \
|
---|
573 | /MAP:$(outbase).map \
|
---|
574 | $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
|
---|
575 | $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
|
---|
576 | $(qaddprefix sh,/LIBPATH:,$(libpath)) \
|
---|
577 | @$(outbase).rsp
|
---|
578 | ifndef TOOL_VCC143_NO_AUTO_MANIFEST
|
---|
579 | $(QUIET)$(TEST) -f $(out).manifest -- \
|
---|
580 | $(TOOL_VCC143_MT) -manifest $(subst /,\\,$(out)).manifest '-outputresource:$(subst /,\\,$(out));#2'
|
---|
581 | endif
|
---|
582 | endef
|
---|
583 |
|
---|