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

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

Use kObjDep more.

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