source: trunk/kBuild/tools/VCC100AMD64.kmk@ 2912

Last change on this file since 2912 was 2902, checked in by bird, 9 years ago

Made link work inside kWorker too.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 18.4 KB
Line 
1# $Id: VCC100AMD64.kmk 2902 2016-09-09 17:15:22Z bird $
2## @file
3# kBuild Tool Config - Visual C++ 10.0 (aka Visual 2010 and MSC v16), targeting AMD64.
4#
5
6#
7# Copyright (c) 2004-2016 knut st. osmundsen <bird-kBuild-spam-xiv@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
34TOOL_VCC100AMD64 := Visual C++ 10.0 (aka Visual 2010 and MSC v16), targeting AMD64
35
36# Tool Specific Properties
37ifndef PATH_TOOL_VCC100AMD64
38 PATH_TOOL_VCC100AMD64 := $(wildcard $(KBUILD_DEVTOOLS)/win.x86/vcc/v10*)
39 ifeq ($(PATH_TOOL_VCC100AMD64),)
40 PATH_TOOL_VCC100AMD64 := $(PATH_TOOL_VCC100)
41 endif
42 ifeq ($(PATH_TOOL_VCC100AMD64),)
43 PATH_TOOL_VCC100AMD64 := $(PATH_TOOL_VCC100X86)
44 endif
45 ifeq ($(PATH_TOOL_VCC100AMD64),)
46 PATH_TOOL_VCC100AMD64 := $(wildcard $(KBUILD_DEVTOOLS)/win.x86/vcc/v10*)
47 endif
48 ifneq ($(PATH_TOOL_VCC100AMD64),)
49 PATH_TOOL_VCC100AMD64 := $(lastword $(sort $(PATH_TOOL_VCC100AMD64)))
50 else
51 $(warning kBuild: PATH_TOOL_VCC100AMD64 cannot be determined!)
52 PATH_TOOL_VCC100AMD64 := $(KBUILD_DEVTOOLS)/win.x86/vcc/v10
53 endif
54else
55 # Resolve any fancy stuff once and for all.
56 PATH_TOOL_VCC100AMD64 := $(PATH_TOOL_VCC100AMD64)
57endif
58ifeq ($(KBUILD_HOST).$(KBUILD_HOST_ARCH),win.amd64)
59PATH_TOOL_VCC100AMD64_BIN ?= $(PATH_TOOL_VCC100AMD64)/bin/amd64
60else
61PATH_TOOL_VCC100AMD64_BIN ?= $(PATH_TOOL_VCC100AMD64)/bin/x86_amd64
62endif
63PATH_TOOL_VCC100AMD64_LIB ?= $(PATH_TOOL_VCC100AMD64)/lib/amd64
64PATH_TOOL_VCC100AMD64_INC ?= $(PATH_TOOL_VCC100AMD64)/include
65PATH_TOOL_VCC100AMD64_ATLMFC ?= $(PATH_TOOL_VCC100AMD64)/atlmfc
66PATH_TOOL_VCC100AMD64_ATLMFC_INC ?= $(PATH_TOOL_VCC100AMD64_ATLMFC)/include
67PATH_TOOL_VCC100AMD64_ATLMFC_LIB ?= $(PATH_TOOL_VCC100AMD64_ATLMFC)/lib/amd64
68TOOL_VCC100AMD64_CC ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC100AMD64_BIN)/cl.exe
69TOOL_VCC100AMD64_CXX ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC100AMD64_BIN)/cl.exe
70TOOL_VCC100AMD64_AS ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC100AMD64_BIN)/ml64.exe
71#TOOL_VCC100AMD64_AR ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC100AMD64_BIN)/lib.exe - just an exec wrapper for the below
72TOOL_VCC100AMD64_AR ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC100AMD64_BIN)/link.exe /LIB
73TOOL_VCC100AMD64_LD ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC100AMD64_BIN)/link.exe
74TOOL_VCC100AMD64_DUMPBIN ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC100AMD64_BIN)/dumpbin.exe
75TOOL_VCC100AMD64_EDITBIN ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC100AMD64_BIN)/editbin.exe
76TOOL_VCC100AMD64_RC ?= $(EXEC_X86_WIN32) $(call TOOL_VCC100_FN_FIND_SDK_TOOL,rc.exe,[Rr][Cc].[Ee][Xx][Ee],TOOL_VCC100_RC_CACHED)
77TOOL_VCC100AMD64_MT ?= $(EXEC_X86_WIN32) $(call TOOL_VCC100_FN_FIND_SDK_TOOL,mt.exe,[Mm][Tt].[Ee][Xx][Ee],TOOL_VCC100_MT_CACHED)
78ifdef TOOL_VCC100AMD64_USE_KSUBMIT
79 ifeq ($(KBUILD_HOST),win)
80 ifneq ($(substr $(PATH_TOOL_VCC100AMD64_BIN),-9),x86_amd64)
81 TOOL_VCC100AMD64_KSUBMIT ?= kmk_builtin_kSubmit --64-bit
82 else
83 TOOL_VCC100AMD64_KSUBMIT ?= kmk_builtin_kSubmit --32-bit
84 endif
85 TOOL_VCC100AMD64_KSUBMIT_DD = $(TOOL_VCC100AMD64_KSUBMIT) --
86 endif
87endif
88
89# The following in duplicated in VCC100.kmk and VCC100X86.kmk.
90TOOL_VCC100_FN_FIND_SDK_TOOL_SUB = $(eval $3 := $(firstword \
91 $(if-expr defined(PATH_SDK_WINPSDK71_BIN), $(wildcard $(PATH_SDK_WINPSDK71_BIN)/$2)) \
92 $(if-expr defined(PATH_SDK_WINPSDK_BIN) , $(wildcard $(PATH_SDK_WINPSDK_BIN)/$2)) \
93 $(rsort $(wildcard $(KBUILD_DEVTOOLS_HST)/sdk/*/[Bb][Ii][Nn]/$2)) \
94 $(rsort $(wildcard $(KBUILD_DEVTOOLS_HST_ALT)/sdk/*/[Bb][Ii][Nn]/$2)) \
95 $1))
96TOOL_VCC100_FN_FIND_SDK_TOOL = $(if-expr !defined($3),$(TOOL_VCC100_FN_FIND_SDK_TOOL_SUB),)$($3)
97
98## Disabled fast DEP_IDB based dependencies.
99#VCC100AMD64_OLD_DEPS = 1
100
101## Constructs the correct .pdb name (the name is lowercased).
102# @param $(1) Base name, no extention.
103# @param $(2) The extension.
104TOOL_VCC100AMD64_PDB = $(dir $(1))$(tolower $(notdir $(1))).$(2)
105
106TOOL_VCC100AMD64_COBJSUFF ?= .obj
107TOOL_VCC100AMD64_CFLAGS ?= -TC -nologo
108TOOL_VCC100AMD64_CFLAGS.debug ?= -Zi
109TOOL_VCC100AMD64_CFLAGS.dbgopt ?= -O2 -Zi
110TOOL_VCC100AMD64_CFLAGS.release ?= -O2
111TOOL_VCC100AMD64_CFLAGS.profile ?= -O2
112TOOL_VCC100AMD64_CINCS ?= $(PATH_TOOL_VCC100AMD64_INC)
113TOOL_VCC100AMD64_CDEFS ?=
114
115TOOL_VCC100AMD64_CXXOBJSUFF ?= .obj
116TOOL_VCC100AMD64_CXXFLAGS ?= -TP -nologo
117TOOL_VCC100AMD64_CXXFLAGS.debug ?= -Zi
118TOOL_VCC100AMD64_CXXFLAGS.dbgopt ?= -O2 -Zi
119TOOL_VCC100AMD64_CXXFLAGS.release ?= -O2
120TOOL_VCC100AMD64_CXXFLAGS.profile ?= -O2
121TOOL_VCC100AMD64_CXXINCS ?= $(PATH_TOOL_VCC100AMD64_INC) $(PATH_TOOL_VCC100AMD64_ATLMFC_INC)
122TOOL_VCC100AMD64_CXXDEFS ?=
123
124TOOL_VCC100AMD64_ASOBJSUFF ?= .obj
125
126TOOL_VCC100AMD64_RCOBJSUFF ?= .res
127TOOL_VCC100AMD64_RCINCS ?= $(PATH_TOOL_VCC100AMD64_INC) $(PATH_TOOL_VCC100AMD64_ATLMFC_INC)
128
129TOOL_VCC100AMD64_ARFLAGS ?= -nologo -machine:amd64
130TOOL_VCC100AMD64_ARLIBSUFF ?= .lib
131
132TOOL_VCC100AMD64_LDFLAGS ?= -nologo -machine:amd64
133TOOL_VCC100AMD64_LDFLAGS.debug ?= -debug
134TOOL_VCC100AMD64_LDFLAGS.dbgopt ?= -debug
135TOOL_VCC100AMD64_LDFLAGS.profile ?= -debug
136TOOL_VCC100AMD64_LDFLAGS.release ?=
137
138
139
140## Compile C source.
141# @param $(target) Normalized main target name.
142# @param $(source) Source filename (relative).
143# @param $(obj) Object file name. This shall be (re)created by the compilation.
144# @param $(dep) Dependcy file. This shall be (re)created by the compilation.
145# @param $(flags) Flags.
146# @param $(defs) Definitions. No -D or something.
147# @param $(incs) Includes. No -I or something.
148# @param $(dirdep) Directory creation dependency.
149# @param $(deps) Other dependencies.
150#
151# @param $(outbase) Output basename (full). Use this for list files and such.
152# @param $(objsuff) Object suffix.
153TOOL_VCC100AMD64_COMPILE_C_DEPEND =
154TOOL_VCC100AMD64_COMPILE_C_DEPORD =
155ifdef KBUILD_USE_KOBJCACHE
156TOOL_VCC100AMD64_COMPILE_C_USES_KOBJCACHE = 1
157TOOL_VCC100AMD64_COMPILE_C_OUTPUT = $(outbase).i
158TOOL_VCC100AMD64_COMPILE_C_OUTPUT_MAYBE =
159define TOOL_VCC100AMD64_COMPILE_C_CMDS
160 $(QUIET)$(KOBJCACHE) -f $(outbase).koc -d $(PATH_OBJCACHE) -t $(bld_trg).$(bld_trg_arch) -O2 -r\
161 --make-dep-fix-case --make-dep-gen-stubs --make-dep-quiet --make-dep-file $(dep)\
162 --kObjCache-cpp $(outbase).i\
163 $(TOOL_VCC100AMD64_CC) -E\
164 $(subst -Zi,-Z7,$(flags))\
165 $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
166 $(subst /,\\,$(abspath $(source))) \
167 --kObjCache-cc $(obj)\
168 $(TOOL_VCC100AMD64_CC) -c\
169 $(subst -Zi,-Z7,$(flags))\
170 -Fo$(obj)\
171 $(outbase).i
172endef
173else # !KBUILD_USE_KOBJCACHE
174TOOL_VCC100AMD64_COMPILE_C_OUTPUT = $(call TOOL_VCC100AMD64_PDB, $(outbase)-obj,idb)
175TOOL_VCC100AMD64_COMPILE_C_OUTPUT_MAYBE = $(call TOOL_VCC100AMD64_PDB, $(outbase)-obj,pdb)
176 ifdef TOOL_VCC100AMD64_KSUBMIT
177define TOOL_VCC100AMD64_COMPILE_C_CMDS
178 $(QUIET)$(TOOL_VCC100AMD64_KSUBMIT) -P $(DEP_OBJ_INT) -f -s -q -o $(dep) -t $(obj) $(obj)\
179 -- $(TOOL_VCC100AMD64_CC) -c\
180 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
181 -Fd$(outbase)-obj.pdb \
182 -FD\
183 -Fo$(obj)\
184 $(subst /,\\,$(abspath $(source)))
185endef
186 else
187define TOOL_VCC100AMD64_COMPILE_C_CMDS
188 $(QUIET)$(TOOL_VCC100AMD64_CC) -c\
189 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
190 -Fd$(outbase)-obj.pdb \
191 -FD\
192 -Fo$(obj)\
193 $(subst /,\\,$(abspath $(source)))
194 $(QUIET)$(DEP_IDB) -f -s -q -o $(dep) -t $(obj) $(call TOOL_VCC100AMD64_PDB,$(outbase)-obj,idb)
195endef
196 endif # !TOOL_VCC100AMD64_KSUBMIT
197endif # !KBUILD_USE_KOBJCACHE
198
199
200## Compile C++ source.
201# @param $(target) Normalized main target name.
202# @param $(source) Source filename (relative).
203# @param $(obj) Object file name. This shall be (re)created by the compilation.
204# @param $(dep) Dependcy file. This shall be (re)created by the compilation.
205# @param $(flags) Flags.
206# @param $(defs) Definitions. No -D or something.
207# @param $(incs) Includes. No -I or something.
208# @param $(dirdep) Directory creation dependency.
209# @param $(deps) Other dependencies.
210#
211# @param $(outbase) Output basename (full). Use this for list files and such.
212# @param $(objsuff) Object suffix.
213TOOL_VCC100AMD64_COMPILE_CXX_DEPEND =
214TOOL_VCC100AMD64_COMPILE_CXX_DEPORD =
215ifdef KBUILD_USE_KOBJCACHE
216TOOL_VCC100AMD64_COMPILE_CXX_USES_KOBJCACHE = 1
217TOOL_VCC100AMD64_COMPILE_CXX_OUTPUT = $(outbase).ii
218TOOL_VCC100AMD64_COMPILE_CXX_OUTPUT_MAYBE =
219define TOOL_VCC100AMD64_COMPILE_CXX_CMDS
220 $(QUIET)$(KOBJCACHE) -f $(outbase).koc -d $(PATH_OBJCACHE) -t $(bld_trg).$(bld_trg_arch) -O2 -r\
221 --make-dep-fix-case --make-dep-gen-stubs --make-dep-quiet --make-dep-file $(dep)\
222 --kObjCache-cpp $(outbase).ii\
223 $(TOOL_VCC100AMD64_CXX) -E\
224 $(subst -Zi,-Z7,$(flags))\
225 $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
226 $(subst /,\\,$(abspath $(source))) \
227 --kObjCache-cc $(obj)\
228 $(TOOL_VCC100AMD64_CXX) -c\
229 $(subst -Zi,-Z7,$(flags))\
230 -Fo$(obj)\
231 $(outbase).ii
232endef
233else # !KBUILD_USE_KOBJCACHE
234TOOL_VCC100AMD64_COMPILE_CXX_OUTPUT = $(call TOOL_VCC100AMD64_PDB, $(outbase)-obj,idb)
235TOOL_VCC100AMD64_COMPILE_CXX_OUTPUT_MAYBE = $(call TOOL_VCC100AMD64_PDB, $(outbase)-obj,pdb)
236 ifdef TOOL_VCC100AMD64_KSUBMIT
237define TOOL_VCC100AMD64_COMPILE_CXX_CMDS
238 $(QUIET)$(TOOL_VCC100AMD64_KSUBMIT) -P $(DEP_OBJ_INT) -f -s -q -o $(dep) -t $(obj) $(obj)\
239 -- $(TOOL_VCC100AMD64_CXX) -c\
240 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
241 -Fd$(outbase)-obj.pdb \
242 -FD\
243 -Fo$(obj)\
244 $(subst /,\\,$(abspath $(source)))
245endef
246 else
247define TOOL_VCC100AMD64_COMPILE_CXX_CMDS
248 $(QUIET)$(TOOL_VCC100AMD64_CXX) -c\
249 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
250 -Fd$(outbase)-obj.pdb \
251 -FD\
252 -Fo$(obj)\
253 $(subst /,\\,$(abspath $(source)))
254 $(QUIET)$(DEP_IDB) -f -s -q -o $(dep) -t $(obj) $(call TOOL_VCC100AMD64_PDB,$(outbase)-obj,idb)
255endef
256 endif # !TOOL_VCC100AMD64_KSUBMIT
257endif # !KBUILD_USE_KOBJCACHE
258
259## @todo configure the assembler template.
260
261## Compile resource source.
262# @param $(target) Normalized main target name.
263# @param $(source) Source filename (relative).
264# @param $(obj) Object file name. This shall be (re)created by the compilation.
265# @param $(dep) Dependcy file. This shall be (re)created by the compilation.
266# @param $(flags) Flags.
267# @param $(defs) Definitions. No -D or something.
268# @param $(incs) Includes. No -I or something.
269# @param $(dirdep) Directory creation dependency.
270# @param $(deps) Other dependencies.
271#
272# @param $(outbase) Output basename (full). Use this for list files and such.
273# @param $(objsuff) Object suffix.
274TOOL_VCC100AMD64_COMPILE_RC_DEPEND =
275TOOL_VCC100AMD64_COMPILE_RC_DEPORD =
276TOOL_VCC100AMD64_COMPILE_RC_OUTPUT =
277define TOOL_VCC100AMD64_COMPILE_RC_CMDS
278 $(QUIET)$(TOOL_VCC100AMD64_RC) \
279 $(flags) $(addprefix /i, $(subst /,\\,$(incs))) $(addprefix /d, $(defs))\
280 /fo$(obj)\
281 $(subst /,\\,$(abspath $(source)))
282endef
283
284
285## Link library
286# @param $(target) Normalized main target name.
287# @param $(out) Library name.
288# @param $(objs) Object files to put in the library.
289# @param $(flags) Flags.
290# @param $(dirdep) Directory creation dependency.
291# @param $(deps) Other dependencies.
292# @param $(othersrc) Unhandled sources.
293# @param $(outbase) Output basename (full). Use this for list files and such.
294#
295TOOL_VCC100AMD64_LINK_LIBRARY_DEPEND = $(othersrc)
296TOOL_VCC100AMD64_LINK_LIBRARY_DEPORD =
297TOOL_VCC100AMD64_LINK_LIBRARY_OUTPUT = $(outbase).rsp
298TOOL_VCC100AMD64_LINK_LIBRARY_OUTPUT_MAYBE = $(outbase).lst $(outbase).exp $(outbase).pdb
299define TOOL_VCC100AMD64_LINK_LIBRARY_CMDS
300 $(QUIET)$(APPEND) -tn $(outbase).rsp \
301 $(foreach arg,\
302 $(subst /,\\,$(objs) \
303 $(filter-out %.def,$(othersrc))) \
304 $(addprefix /DEF:,$(filter %.def,$(othersrc))) \
305 ,\"$(arg)\")
306 $(QUIET)$(TOOL_VCC100AMD64_KSUBMIT_DD) $(TOOL_VCC100AMD64_AR) $(flags) /OUT:$(out) @$(outbase).rsp
307endef
308
309
310## Link program
311# @param $(target) Normalized main target name.
312# @param $(out) Program name.
313# @param $(objs) Object files to link together.
314# @param $(libs) Libraries to search.
315# @param $(libpath) Library search paths.
316# @param $(flags) Flags.
317# @param $(dirdep) Directory creation dependency.
318# @param $(deps) Other dependencies.
319# @param $(othersrc) Unhandled sources.
320# @param $(custom_pre) Custom step invoked before linking.
321# @param $(custom_post) Custom step invoked after linking.
322# @param $(outbase) Output basename (full). Use this for list files and such.
323#
324TOOL_VCC100AMD64_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
325TOOL_VCC100AMD64_LINK_PROGRAM_DEPORD =
326TOOL_VCC100AMD64_LINK_PROGRAM_OUTPUT = $(outbase).map $(outbase).rsp
327TOOL_VCC100AMD64_LINK_PROGRAM_OUTPUT_MAYBE = $(outbase).lib $(outbase).exp $(outbase).ilk $(out).manifest
328TOOL_VCC100AMD64_LINK_PROGRAM_OUTPUT_DEBUG = $(outbase).pdb
329TOOL_VCC100AMD64_LINK_PROGRAM_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
330define TOOL_VCC100AMD64_LINK_PROGRAM_CMDS
331 $(QUIET)$(APPEND) -tn $(outbase).rsp \
332 $(foreach arg,\
333 $(subst /,\\,$(objs)) \
334 $(subst /,\\,$(libs)) \
335 ,\"$(arg)\")
336 $(QUIET)$(TOOL_VCC100AMD64_KSUBMIT_DD) $(TOOL_VCC100AMD64_LD) $(flags) \
337 /OUT:$(out) \
338 /MAPINFO:EXPORTS /INCREMENTAL:NO \
339 /MAP:$(outbase).map \
340 $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
341 $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
342 $(foreach p,$(libpath), /LIBPATH:$(p)) \
343 @$(outbase).rsp
344ifndef TOOL_VCC100AMD64_NO_AUTO_MANIFEST
345 $(QUIET)$(TEST) -f $(out).manifest -- \
346 $(TOOL_VCC100AMD64_MT) -manifest $(subst /,\\,$(out)).manifest -outputresource:$(subst /,\\,$(out))
347endif
348endef
349
350
351## Link DLL.
352# @param $(target) Normalized main target name.
353# @param $(out) DLL name.
354# @param $(objs) Object files to link together.
355# @param $(libs) Libraries to search.
356# @param $(libpath) Library search paths.
357# @param $(flags) Flags.
358# @param $(dirdep) Directory creation dependency.
359# @param $(deps) Other dependencies.
360# @param $(othersrc) Unhandled sources.
361# @param $(custom_pre) Custom step invoked before linking.
362# @param $(custom_post) Custom step invoked after linking.
363#
364# @param $(outbase) Output basename (full). Use this for list files and such.
365TOOL_VCC100AMD64_LINK_DLL_DEPEND = $(objs) $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
366TOOL_VCC100AMD64_LINK_DLL_DEPORD = $(call DIRDEP,$(PATH_STAGE_LIB))
367TOOL_VCC100AMD64_LINK_DLL_OUTPUT = $(outbase).map $(outbase).lib $(outbase).exp $(outbase).rsp
368TOOL_VCC100AMD64_LINK_DLL_OUTPUT_MAYBE = $(outbase).ilk $(out).manifest $(PATH_STAGE_LIB)/$(notdir $(outbase)).exp
369TOOL_VCC100AMD64_LINK_DLL_OUTPUT_MAYBE_PRECIOUS = $(PATH_STAGE_LIB)/$(notdir $(outbase)).lib
370TOOL_VCC100AMD64_LINK_DLL_OUTPUT_DEBUG = $(outbase).pdb
371TOOL_VCC100AMD64_LINK_DLL_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
372define TOOL_VCC100AMD64_LINK_DLL_CMDS
373 $(QUIET)$(APPEND) -tn $(outbase).rsp \
374 $(foreach arg,\
375 $(subst /,\\,$(objs)) \
376 $(subst /,\\,$(libs)) \
377 ,\"$(arg)\")
378 $(QUIET)$(TOOL_VCC100AMD64_KSUBMIT_DD) $(TOOL_VCC100AMD64_LD) $(flags) \
379 /OUT:$(out) \
380 /IMPLIB:$(outbase).lib \
381 /MAPINFO:EXPORTS /INCREMENTAL:NO \
382 /MAP:$(outbase).map \
383 /DLL \
384 $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
385 $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
386 $(foreach p,$(libpath), /LIBPATH:$(p)) \
387 @$(outbase).rsp
388ifndef TOOL_VCC100AMD64_NO_AUTO_MANIFEST
389 $(QUIET)$(TEST) -f $(out).manifest -- \
390 $(TOOL_VCC100AMD64_MT) -manifest $(subst /,\\,$(out)).manifest '-outputresource:$(subst /,\\,$(out));#2'
391endif
392 $(QUIET)$(TEST) -f $(outbase).lib -- $(KLIBTWEAKER_EXT) --clear-timestamps $(outbase).lib
393 $(QUIET)$(CP) --changed -v --ignore-non-existing $(outbase).exp $(outbase).lib $(PATH_STAGE_LIB)/
394$(eval _DIRS += $(PATH_STAGE_LIB))
395endef
396
397
398## Link system module (windows aka driver, linux aka kernel module)
399# @param $(target) Normalized main target name.
400# @param $(out) System module name.
401# @param $(objs) Object files to link together.
402# @param $(libs) Libraries to search.
403# @param $(libpath) Library search paths.
404# @param $(flags) Flags.
405# @param $(dirdep) Directory creation dependency.
406# @param $(deps) Other dependencies.
407# @param $(othersrc) Unhandled sources.
408# @param $(custom_pre) Custom step invoked before linking.
409# @param $(custom_post) Custom step invoked after linking.
410#
411# @param $(outbase) Output basename (full). Use this for list files and such.
412TOOL_VCC100AMD64_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
413TOOL_VCC100AMD64_LINK_SYSMOD_DEPORD =
414TOOL_VCC100AMD64_LINK_SYSMOD_OUTPUT = $(outbase).map $(outbase).rsp
415TOOL_VCC100AMD64_LINK_SYSMOD_OUTPUT_MAYBE = $(outbase).lib $(outbase).exp $(outbase).ilk $(out).manifest
416TOOL_VCC100AMD64_LINK_SYSMOD_OUTPUT_DEBUG = $(outbase).pdb
417TOOL_VCC100AMD64_LINK_SYSMOD_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
418define TOOL_VCC100AMD64_LINK_SYSMOD_CMDS
419 $(QUIET)$(APPEND) -tn $(outbase).rsp \
420 $(foreach arg,\
421 $(subst /,\\,$(objs)) \
422 $(subst /,\\,$(libs)) \
423 ,\"$(arg)\")
424 $(QUIET)$(TOOL_VCC100AMD64_KSUBMIT_DD) $(TOOL_VCC100AMD64_LD) $(flags) \
425 /OUT:$(out) \
426 /MAPINFO:EXPORTS /INCREMENTAL:NO \
427 /MAP:$(outbase).map \
428 $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
429 $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
430 $(foreach p,$(libpath), /LIBPATH:$(p)) \
431 @$(outbase).rsp
432ifndef TOOL_VCC100AMD64_NO_AUTO_MANIFEST
433 $(QUIET)$(TEST) -f $(out).manifest -- \
434 $(TOOL_VCC100AMD64_MT) -manifest $(subst /,\\,$(out)).manifest '-outputresource:$(subst /,\\,$(out));#2'
435endif
436endef
437
Note: See TracBrowser for help on using the repository browser.