source: trunk/kBuild/tools/VCC140X86.kmk@ 3403

Last change on this file since 3403 was 3343, checked in by bird, 5 years ago

VCC140*: Adding support for VC++ 14.0 (2015) too.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 20.0 KB
Line 
1# $Id: VCC140X86.kmk 3343 2020-05-20 14:34:15Z bird $
2## @file
3# kBuild Tool Config - Visual C++ 14.0 (aka Visual 2015 and MSC v19.0x), targeting x86.
4#
5
6#
7# Copyright (c) 2004-2020 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
34ifndef TOOL_VCC140
35 include $(KBUILD_PATH)/tools/VCC140.kmk
36endif
37
38TOOL_VCC140X86 := Visual C++ 14.0 (aka Visual 2015 and MSC v19.0x), targeting x86
39
40#
41# Tool Specific Properties
42#
43ifndef PATH_TOOL_VCC140X86_BIN
44 ifeq ($(KBUILD_HOST_ARCH),amd64)
45PATH_TOOL_VCC140X86_BIN := $(PATH_TOOL_VCC140_BASE_BIN)/amd64_x86
46 else
47PATH_TOOL_VCC140X86_BIN := $(PATH_TOOL_VCC140_BASE_BIN)
48 endif
49else
50PATH_TOOL_VCC140X86_BIN := $(PATH_TOOL_VCC140X86_BIN)
51endif
52PATH_TOOL_VCC140X86_BIN_QSH := $(requote sh,$(PATH_TOOL_VCC140X86_BIN))
53
54# 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.
55ifndef PATH_TOOL_VCC140X86_DLL_BIN
56 ifneq ($(PATH_TOOL_VCC140_HOST_DLL_BIN),$(PATH_TOOL_VCC140X86_BIN))
57PATH_TOOL_VCC140X86_DLL_BIN := $(PATH_TOOL_VCC140_HOST_DLL_BIN)
58 endif
59endif
60
61ifndef PATH_TOOL_VCC140X86_LIB
62PATH_TOOL_VCC140X86_LIB := $(PATH_TOOL_VCC140_LIB.x86)
63endif
64ifndef PATH_TOOL_VCC140_ONECORE_LIB
65PATH_TOOL_VCC140_ONECORE_LIB := $(PATH_TOOL_VCC140_ONECORE_LIB.x86)
66endif
67
68ifndef PATH_TOOL_VCC140X86_INC
69PATH_TOOL_VCC140X86_INC := $(PATH_TOOL_VCC140_INC)
70endif
71
72ifndef PATH_TOOL_VCC140X86_ATLMFC_INC
73PATH_TOOL_VCC140X86_ATLMFC_INC := $(PATH_TOOL_VCC140_ATLMFC_INC.x86)
74endif
75ifndef PATH_TOOL_VCC140X86_ATLMFC_LIB
76PATH_TOOL_VCC140X86_ATLMFC_LIB := $(PATH_TOOL_VCC140_ATLMFC_LIB.x86)
77endif
78
79TOOL_VCC140X86_CC ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC140X86_BIN_QSH)/cl.exe
80TOOL_VCC140X86_CXX ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC140X86_BIN_QSH)/cl.exe
81TOOL_VCC140X86_AS ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC140X86_BIN_QSH)/ml.exe
82#TOOL_VCC140X86_AR ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC140X86_BIN_QSH)/lib.exe - just an exec wrapper for the below
83TOOL_VCC140X86_AR ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC140X86_BIN_QSH)/link.exe /LIB
84TOOL_VCC140X86_LD ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC140X86_BIN_QSH)/link.exe
85TOOL_VCC140X86_DUMPBIN ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC140X86_BIN_QSH)/dumpbin.exe
86TOOL_VCC140X86_EDITBIN ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC140X86_BIN_QSH)/editbin.exe
87
88TOOL_VCC140X86_RC ?= $(EXEC_X86_WIN32) $(call TOOL_VCC140_FN_FIND_SDK_TOOL,rc.exe,[Rr][Cc].[Ee][Xx][Ee],TOOL_VCC140_RC_CACHED)
89TOOL_VCC140X86_MT ?= $(EXEC_X86_WIN32) $(call TOOL_VCC140_FN_FIND_SDK_TOOL,mt.exe,[Mm][Tt].[Ee][Xx][Ee],TOOL_VCC140_MT_CACHED)
90
91undefine TOOL_VCC140X86_USE_KSUBMIT # for now
92ifdef TOOL_VCC140X86_USE_KSUBMIT
93 ifeq ($(KBUILD_HOST),win)
94 ifneq ($(substr $(qdir un,$(PATH_TOOL_VCC140X86_BIN)),-3),64/)
95 TOOL_VCC140X86_KSUBMIT ?= kmk_builtin_kSubmit --64-bit
96 else
97 TOOL_VCC140X86_KSUBMIT ?= kmk_builtin_kSubmit --32-bit
98 endif
99 ifdef PATH_TOOL_VCC140X86_DLL_BIN
100 TOOL_VCC140X86_KSUBMIT := $(TOOL_VCC140X86_KSUBMIT) --prepend "PATH=$(requote shell-in-dq,$(PATH_TOOL_VCC140X86_DLL_BIN));"
101 endif
102 TOOL_VCC140X86_KSUBMIT_DD := $(TOOL_VCC140X86_KSUBMIT) --
103 endif
104endif
105ifdef PATH_TOOL_VCC140X86_DLL_BIN
106 TOOL_VCC140X86_SETUP_ENV := $(REDIRECT) --prepend "PATH=$(requote shell-in-dq,$(PATH_TOOL_VCC140X86_DLL_BIN));" --$(SP)
107 ifndef TOOL_VCC140X86_KSUBMIT_DD
108 TOOL_VCC140X86_KSUBMIT_DD := $(TOOL_VCC140X86_SETUP_ENV)
109 endif
110endif
111
112# Redist (more stuff in VCC140.kmk).
113PATH_TOOL_VCC140X86_REDIST ?= $(PATH_TOOL_VCC140_REDIST)/x86
114PATH_TOOL_VCC140X86_REDIST_CRT = $(PATH_TOOL_VCC140X86_REDIST)/$(TOOL_VCC140_REDIST_CRT_SUBDIR)
115PATH_TOOL_VCC140X86_REDIST_DEBUG ?= $(PATH_TOOL_VCC140_REDIST_DEBUG)/x86
116PATH_TOOL_VCC140X86_REDIST_DEBUG_CRT = $(PATH_TOOL_VCC140X86_REDIST_DEBUG)/$(TOOL_VCC140_REDIST_CRT_SUBDIR)
117TOOL_VCC140X64_REDIST_CRT_DLLS = $(TOOL_VCC140_REDIST_CRT_DLLS.x86)
118TOOL_VCC140X64_REDIST_CONCRT_DLLS = $(TOOL_VCC140_REDIST_CONCRT_DLLS.x86)
119TOOL_VCC140X64_REDIST_CPP_DLLS = $(TOOL_VCC140_REDIST_CPP_DLLS.x86)
120TOOL_VCC140X64_REDIST_WINRT_DLLS = $(TOOL_VCC140_REDIST_WINRT_DLLS.x86)
121
122
123#
124# Properties used by kBuild
125#
126TOOL_VCC140X86_COBJSUFF ?= .obj
127TOOL_VCC140X86_CFLAGS ?= -TC -nologo -Zi -ZH:SHA_256
128TOOL_VCC140X86_CFLAGS.debug ?=
129TOOL_VCC140X86_CFLAGS.dbgopt ?= -O2
130TOOL_VCC140X86_CFLAGS.release ?= -O2
131TOOL_VCC140X86_CFLAGS.profile ?= -O2
132TOOL_VCC140X86_CINCS ?= $(PATH_TOOL_VCC140X86_INC)
133TOOL_VCC140X86_CDEFS ?=
134
135TOOL_VCC140X86_CXXOBJSUFF ?= .obj
136TOOL_VCC140X86_CXXFLAGS ?= -TP -nologo -Zi -ZH:SHA_256
137TOOL_VCC140X86_CXXFLAGS.debug ?=
138TOOL_VCC140X86_CXXFLAGS.dbgopt ?= -O2
139TOOL_VCC140X86_CXXFLAGS.release ?= -O2
140TOOL_VCC140X86_CXXFLAGS.profile ?= -O2
141TOOL_VCC140X86_CXXINCS ?= $(PATH_TOOL_VCC140X86_INC) $(PATH_TOOL_VCC140X86_ATLMFC_INC)
142TOOL_VCC140X86_CXXDEFS ?=
143
144TOOL_VCC140X86_ASOBJSUFF ?= .obj
145
146TOOL_VCC140X86_RCOBJSUFF ?= .res
147TOOL_VCC140X86_RCINCS ?= $(PATH_TOOL_VCC140X86_INC) $(PATH_TOOL_VCC140X86_ATLMFC_INC)
148
149TOOL_VCC140X86_ARFLAGS ?= -nologo -machine:x86
150TOOL_VCC140X86_ARLIBSUFF ?= .lib
151
152TOOL_VCC140X86_LDFLAGS ?= -nologo -machine:x86
153TOOL_VCC140X86_LDFLAGS.debug ?= -debug
154TOOL_VCC140X86_LDFLAGS.dbgopt ?= -debug
155TOOL_VCC140X86_LDFLAGS.profile ?= -debug
156TOOL_VCC140X86_LDFLAGS.release ?=
157
158
159
160## Compile C source.
161# @param $(target) Normalized main target name.
162# @param $(source) Source filename (relative).
163# @param $(obj) Object file name. This shall be (re)created by the compilation.
164# @param $(dep) Dependcy file. This shall be (re)created by the compilation.
165# @param $(flags) Flags.
166# @param $(defs) Definitions. No -D or something.
167# @param $(incs) Includes. No -I or something.
168# @param $(dirdep) Directory creation dependency.
169# @param $(deps) Other dependencies.
170#
171# @param $(outbase) Output basename (full). Use this for list files and such.
172# @param $(objsuff) Object suffix.
173TOOL_VCC140X86_COMPILE_C_DEPEND =
174TOOL_VCC140X86_COMPILE_C_DEPORD =
175TOOL_VCC140X86_COMPILE_C_OUTPUT =
176TOOL_VCC140X86_COMPILE_C_OUTPUT_MAYBE = $(call TOOL_VCC140_PDB, $(outbase)-obj,pdb) $(call TOOL_VCC140_PDB, $(outbase)-obj,idb)
177ifdef TOOL_VCC140X86_KSUBMIT
178 TOOL_VCC140X86_COMPILE_C_DONT_PURGE_OUTPUT := 1 # speed
179 define TOOL_VCC140X86_COMPILE_C_CMDS
180 $(QUIET)$(TOOL_VCC140X86_KSUBMIT) -P $(DEP_OBJ_INT) -f -s -q -o $(dep) -t $(obj) $(obj)\
181 -- $(TOOL_VCC140X86_CC) -c\
182 $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
183 -Fd$(outbase)-obj.pdb \
184 -Fo$(obj)\
185 $(subst /,\\,$(abspath $(source)))
186 endef
187else
188 define TOOL_VCC140X86_COMPILE_C_CMDS
189 $(QUIET)$(TOOL_VCC140X86_SETUP_ENV)$(TOOL_VCC140X86_CC) -c\
190 $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
191 -Fd$(outbase)-obj.pdb \
192 -Fo$(obj)\
193 $(subst /,\\,$(abspath $(source)))
194 $(QUIET)$(DEP_OBJ) -f -s -q -o $(dep) -t $(obj) $(obj)
195 endef
196endif # !TOOL_VCC140X86_KSUBMIT
197
198
199## Compile C++ source.
200# @param $(target) Normalized main target name.
201# @param $(source) Source filename (relative).
202# @param $(obj) Object file name. This shall be (re)created by the compilation.
203# @param $(dep) Dependcy file. This shall be (re)created by the compilation.
204# @param $(flags) Flags.
205# @param $(defs) Definitions. No -D or something.
206# @param $(incs) Includes. No -I or something.
207# @param $(dirdep) Directory creation dependency.
208# @param $(deps) Other dependencies.
209#
210# @param $(outbase) Output basename (full). Use this for list files and such.
211# @param $(objsuff) Object suffix.
212TOOL_VCC140X86_COMPILE_CXX_DEPEND = $($(target)_1_VCC_PCH_FILE)
213TOOL_VCC140X86_COMPILE_CXX_DEPORD =
214TOOL_VCC140X86_COMPILE_CXX_OUTPUT =
215TOOL_VCC140X86_COMPILE_CXX_OUTPUT_MAYBE = $(if-expr defined($(target)_1_VCC_COMMON_OBJ_PDB)\
216 ,,$(call TOOL_VCC140_PDB, $(outbase)-obj,pdb) $(call TOOL_VCC140_PDB, $(outbase)-obj,idb))
217ifdef TOOL_VCC140X86_KSUBMIT
218 TOOL_VCC140X86_COMPILE_CXX_DONT_PURGE_OUTPUT := 1 # speed
219 define TOOL_VCC140X86_COMPILE_CXX_CMDS
220 $(QUIET)$(TOOL_VCC140X86_KSUBMIT) -P $(DEP_OBJ_INT) -f -s -q -o $(dep) -t $(obj) $(obj)\
221 -- $(TOOL_VCC140X86_CXX) -c\
222 $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
223 $(if-expr defined($(target)_PCH_HDR)\
224 ,-FI$($(target)_PCH_HDR) -Yu$($(target)_PCH_HDR) -Fp$($(target)_1_VCC_PCH_FILE) -FS,)\
225 -Fd$(if-expr defined($(target)_1_VCC_COMMON_OBJ_PDB),$($(target)_1_VCC_COMMON_OBJ_PDB),$(outbase)-obj.pdb) \
226 -Fo$(obj)\
227 $(subst /,\\,$(abspath $(source)))
228 endef
229else
230 define TOOL_VCC140X86_COMPILE_CXX_CMDS
231 $(QUIET)$(TOOL_VCC140X86_SETUP_ENV)$(TOOL_VCC140X86_CXX) -c\
232 $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
233 $(if-expr defined($(target)_PCH_HDR)\
234 ,-FI$($(target)_PCH_HDR) -Yu$($(target)_PCH_HDR) -Fp$($(target)_1_VCC_PCH_FILE) -FS,)\
235 -Fd$(if-expr defined($(target)_1_VCC_COMMON_OBJ_PDB),$($(target)_1_VCC_COMMON_OBJ_PDB),$(outbase)-obj.pdb) \
236 -Fo$(obj)\
237 $(subst /,\\,$(abspath $(source)))
238 $(QUIET)$(DEP_OBJ) -f -s -q -o $(dep) -t $(obj) $(obj)
239 endef
240endif # !TOOL_VCC140X86_KSUBMIT
241
242
243#
244# Helper tool for creating the precompiled C++ header.
245#
246# It only have the C++ compile bits and it's purpose is to skip bits
247# related _1_VCC_PCH_FILE and add -Yc.
248#
249TOOL_VCC140X86-PCH := Helper for creating precompiled header using CXX handling.
250TOOL_VCC140X86-PCH_EXTENDS := VCC140X86
251TOOL_VCC140X86-PCH_CXXOBJSUFF := .obj
252TOOL_VCC140X86-PCH_CXXINCS = $(TOOL_VCC140X86_CXXINCS)
253TOOL_VCC140X86-PCH_CXXFLAGS = $(TOOL_VCC140X86_CXXFLAGS) -FS
254TOOL_VCC140X86-PCH_CXXFLAGS.debug = $(TOOL_VCC140X86_CXXFLAGS.debug)
255TOOL_VCC140X86-PCH_CXXFLAGS.dbgopt = $(TOOL_VCC140X86_CXXFLAGS.dbgopt)
256TOOL_VCC140X86-PCH_CXXFLAGS.release = $(TOOL_VCC140X86_CXXFLAGS.release)
257TOOL_VCC140X86-PCH_CXXFLAGS.profile = $(TOOL_VCC140X86_CXXFLAGS.profile)
258TOOL_VCC140X86-PCH_COMPILE_CXX_DEPEND = $(NO_SUCH_VARIABLE)
259TOOL_VCC140X86-PCH_COMPILE_CXX_DEPORD = $(NO_SUCH_VARIABLE)
260TOOL_VCC140X86-PCH_COMPILE_CXX_OUTPUT = $($(target)_1_VCC_PCH_FILE) $($(target)_1_VCC_COMMON_OBJ_PDB)
261TOOL_VCC140X86-PCH_COMPILE_CXX_OUTPUT_MAYBE = $(NO_SUCH_VARIABLE)
262ifdef TOOL_VCC140X86_KSUBMIT
263 define TOOL_VCC140X86-PCH_COMPILE_CXX_CMDS
264 $(QUIET)$(RM) -f -- $($(target)_1_VCC_PCH_FILE) $($(target)_1_VCC_COMMON_OBJ_PDB)
265 $(QUIET)$(TOOL_VCC140X86_KSUBMIT) --no-pch-caching -P $(DEP_OBJ_INT) -f -s -q -e .pch -o $(dep) -t $(obj) $(obj)\
266 -- $(TOOL_VCC140X86_CXX) -c -Yc\
267 $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
268 $(if-expr defined($(target)_PCH_HDR),-FI$($(target)_PCH_HDR),)\
269 -Fp$($(target)_1_VCC_PCH_FILE) \
270 -Fd$($(target)_1_VCC_COMMON_OBJ_PDB) \
271 -Fo$(obj)\
272 -TP \
273 $(subst /,\\,$(abspath $(source)))
274 endef
275else
276 define TOOL_VCC140X86-PCH_COMPILE_CXX_CMDS
277 $(QUIET)$(RM) -f -- $($(target)_1_VCC_PCH_FILE) $($(target)_1_VCC_COMMON_OBJ_PDB)
278 $(QUIET)$(TOOL_VCC140X86_SETUP_ENV)$(TOOL_VCC140X86_CXX) -c -Yc\
279 $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
280 $(if-expr defined($(target)_PCH_HDR),-FI$($(target)_PCH_HDR),)\
281 -Fp$($(target)_1_VCC_PCH_FILE) \
282 -Fd$($(target)_1_VCC_COMMON_OBJ_PDB) \
283 -Fo$(obj)\
284 -TP \
285 $(subst /,\\,$(abspath $(source)))
286 $(QUIET)$(DEP_OBJ) -f -s -q -e .pch -o $(dep) -t $(obj) $(obj)
287
288 endef
289endif # !TOOL_VCC140X86_KSUBMIT
290
291
292## @todo configure the assembler template.
293
294## Compile resource source.
295# @param $(target) Normalized main target name.
296# @param $(source) Source filename (relative).
297# @param $(obj) Object file name. This shall be (re)created by the compilation.
298# @param $(dep) Dependcy file. This shall be (re)created by the compilation.
299# @param $(flags) Flags.
300# @param $(defs) Definitions. No -D or something.
301# @param $(incs) Includes. No -I or something.
302# @param $(dirdep) Directory creation dependency.
303# @param $(deps) Other dependencies.
304#
305# @param $(outbase) Output basename (full). Use this for list files and such.
306# @param $(objsuff) Object suffix.
307TOOL_VCC140X86_COMPILE_RC_DEPEND =
308TOOL_VCC140X86_COMPILE_RC_DEPORD =
309TOOL_VCC140X86_COMPILE_RC_OUTPUT =
310define TOOL_VCC140X86_COMPILE_RC_CMDS
311 $(QUIET)$(TOOL_VCC140X86_RC) \
312 $(flags) $(qaddprefix sh,/i, $(subst /,\\,$(incs))) $(qaddprefix sh,/d, $(defs))\
313 /fo$(obj)\
314 $(subst /,\\,$(abspath $(source)))
315endef
316
317
318## Link library
319# @param $(target) Normalized main target name.
320# @param $(out) Library name.
321# @param $(objs) Object files to put in the library.
322# @param $(flags) Flags.
323# @param $(dirdep) Directory creation dependency.
324# @param $(deps) Other dependencies.
325# @param $(othersrc) Unhandled sources.
326# @param $(outbase) Output basename (full). Use this for list files and such.
327#
328TOOL_VCC140X86_LINK_LIBRARY_DEPEND = $(othersrc)
329TOOL_VCC140X86_LINK_LIBRARY_DEPORD =
330TOOL_VCC140X86_LINK_LIBRARY_OUTPUT = $(outbase).rsp
331TOOL_VCC140X86_LINK_LIBRARY_OUTPUT_MAYBE = $(outbase).lst $(outbase).exp $(outbase).pdb
332define TOOL_VCC140X86_LINK_LIBRARY_CMDS
333 $(QUIET)$(APPEND) -tn $(outbase).rsp \
334 $(qforeachfile u,arg, $(objs) $(filter-out %.def,$(othersrc)),$(quote-sh "$(subst /,\,$(arg))")) \
335 $(qforeachfile u,arg, $(filter %.def,$(othersrc)),$(quote-sh "/DEF:$(subst /,\,$(arg))"))
336 $(QUIET)$(TOOL_VCC140X86_KSUBMIT_DD) $(TOOL_VCC140X86_AR) $(flags) /OUT:$(out) @$(outbase).rsp
337endef
338
339
340## Link program
341# @param $(target) Normalized main target name.
342# @param $(out) Program name.
343# @param $(objs) Object files to link together.
344# @param $(libs) Libraries to search.
345# @param $(libpath) Library search paths.
346# @param $(flags) Flags.
347# @param $(dirdep) Directory creation dependency.
348# @param $(deps) Other dependencies.
349# @param $(othersrc) Unhandled sources.
350# @param $(custom_pre) Custom step invoked before linking.
351# @param $(custom_post) Custom step invoked after linking.
352# @param $(outbase) Output basename (full). Use this for list files and such.
353#
354TOOL_VCC140X86_LINK_PROGRAM_DEPEND = $(foreachfile lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
355TOOL_VCC140X86_LINK_PROGRAM_DEPORD =
356TOOL_VCC140X86_LINK_PROGRAM_OUTPUT_MAYBE_PRECIOUS = $(outbase).map $(outbase).rsp
357TOOL_VCC140X86_LINK_PROGRAM_OUTPUT_MAYBE = $(outbase).lib $(outbase).exp $(outbase).ilk $(out).manifest
358TOOL_VCC140X86_LINK_PROGRAM_OUTPUT_DEBUG = $(outbase).pdb
359TOOL_VCC140X86_LINK_PROGRAM_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
360define TOOL_VCC140X86_LINK_PROGRAM_CMDS
361 $(QUIET)$(APPEND) -tn $(outbase).rsp \
362 $(qforeachfile u,arg, $(objs) $(libs),$(quote-sh "$(subst /,\,$(arg))"))
363 $(QUIET)$(TOOL_VCC140X86_KSUBMIT_DD) $(TOOL_VCC140X86_LD) $(flags) \
364 /OUT:$(out) \
365 /MAPINFO:EXPORTS /INCREMENTAL:NO \
366 /MAP:$(outbase).map \
367 $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
368 $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
369 $(qaddprefix sh,/LIBPATH:,$(libpath)) \
370 @$(outbase).rsp
371ifndef TOOL_VCC140X86_NO_AUTO_MANIFEST
372 $(QUIET)$(TEST) -f $(out).manifest -- \
373 $(TOOL_VCC140X86_MT) -manifest $(subst /,\\,$(out)).manifest -outputresource:$(subst /,\\,$(out))
374endif
375endef
376
377
378## Link DLL.
379# @param $(target) Normalized main target name.
380# @param $(out) DLL name.
381# @param $(objs) Object files to link together.
382# @param $(libs) Libraries to search.
383# @param $(libpath) Library search paths.
384# @param $(flags) Flags.
385# @param $(dirdep) Directory creation dependency.
386# @param $(deps) Other dependencies.
387# @param $(othersrc) Unhandled sources.
388# @param $(custom_pre) Custom step invoked before linking.
389# @param $(custom_post) Custom step invoked after linking.
390#
391# @param $(outbase) Output basename (full). Use this for list files and such.
392TOOL_VCC140X86_LINK_DLL_DEPEND = $(foreachfile lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
393TOOL_VCC140X86_LINK_DLL_DEPORD = $(call DIRDEP,$(PATH_STAGE_LIB))
394TOOL_VCC140X86_LINK_DLL_OUTPUT = $(outbase).lib $(outbase).exp
395TOOL_VCC140X86_LINK_DLL_OUTPUT_MAYBE = $(outbase).ilk $(out).manifest $(PATH_STAGE_LIB)/$(notdir $(outbase)).exp
396TOOL_VCC140X86_LINK_DLL_OUTPUT_MAYBE_PRECIOUS = $(PATH_STAGE_LIB)/$(notdir $(outbase)).lib $(outbase).map $(outbase).rsp
397TOOL_VCC140X86_LINK_DLL_OUTPUT_DEBUG = $(outbase).pdb
398TOOL_VCC140X86_LINK_DLL_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
399define TOOL_VCC140X86_LINK_DLL_CMDS
400 $(QUIET)$(APPEND) -tn $(outbase).rsp \
401 $(qforeachfile u,arg, $(objs) $(libs),$(quote-sh "$(subst /,\,$(arg))"))
402 $(QUIET)$(TOOL_VCC140X86_KSUBMIT_DD) $(TOOL_VCC140X86_LD) $(flags) \
403 /OUT:$(out) \
404 /IMPLIB:$(outbase).lib \
405 /MAPINFO:EXPORTS /INCREMENTAL:NO \
406 /MAP:$(outbase).map \
407 /DLL \
408 $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
409 $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
410 $(qaddprefix sh,/LIBPATH:,$(libpath)) \
411 @$(outbase).rsp
412ifndef TOOL_VCC140X86_NO_AUTO_MANIFEST
413 $(QUIET)$(TEST) -f $(out).manifest -- \
414 $(TOOL_VCC140X86_MT) -manifest $(subst /,\\,$(out)).manifest '-outputresource:$(subst /,\\,$(out));#2'
415endif
416 $(QUIET)$(TEST) -f $(outbase).lib -- $(KLIBTWEAKER_EXT) --clear-timestamps $(outbase).lib
417 $(QUIET)$(CP) --changed -v --ignore-non-existing $(outbase).exp $(outbase).lib $(PATH_STAGE_LIB)/
418$(eval _DIRS += $(PATH_STAGE_LIB))
419endef
420
421
422## Link system module (windows aka driver, linux aka kernel module)
423# @param $(target) Normalized main target name.
424# @param $(out) System module name.
425# @param $(objs) Object files to link together.
426# @param $(libs) Libraries to search.
427# @param $(libpath) Library search paths.
428# @param $(flags) Flags.
429# @param $(dirdep) Directory creation dependency.
430# @param $(deps) Other dependencies.
431# @param $(othersrc) Unhandled sources.
432# @param $(custom_pre) Custom step invoked before linking.
433# @param $(custom_post) Custom step invoked after linking.
434#
435# @param $(outbase) Output basename (full). Use this for list files and such.
436TOOL_VCC140X86_LINK_SYSMOD_DEPEND = $(foreachfile lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
437TOOL_VCC140X86_LINK_SYSMOD_DEPORD =
438TOOL_VCC140X86_LINK_SYSMOD_OUTPUT_MAYBE = $(outbase).lib $(outbase).exp $(outbase).ilk $(out).manifest
439TOOL_VCC140X86_LINK_SYSMOD_OUTPUT_MAYBE_PRECIOUS = $(outbase).map $(outbase).rsp
440TOOL_VCC140X86_LINK_SYSMOD_OUTPUT_DEBUG = $(outbase).pdb
441TOOL_VCC140X86_LINK_SYSMOD_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
442define TOOL_VCC140X86_LINK_SYSMOD_CMDS
443 $(QUIET)$(APPEND) -tn $(outbase).rsp \
444 $(qforeachfile u,arg, $(objs) $(libs),$(quote-sh "$(subst /,\,$(arg))"))
445 $(QUIET)$(TOOL_VCC140X86_KSUBMIT_DD) $(TOOL_VCC140X86_LD) $(flags) \
446 /OUT:$(out) \
447 /MAPINFO:EXPORTS /INCREMENTAL:NO \
448 /MAP:$(outbase).map \
449 $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
450 $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
451 $(qaddprefix sh,/LIBPATH:,$(libpath)) \
452 @$(outbase).rsp
453ifndef TOOL_VCC140X86_NO_AUTO_MANIFEST
454 $(QUIET)$(TEST) -f $(out).manifest -- \
455 $(TOOL_VCC140X86_MT) -manifest $(subst /,\\,$(out)).manifest '-outputresource:$(subst /,\\,$(out));#2'
456endif
457endef
458
Note: See TracBrowser for help on using the repository browser.