source: trunk/kBuild/tools/VCC100X86.kmk@ 2902

Last change on this file since 2902 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.0 KB
Line 
1# $Id: VCC100X86.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 x86.
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_VCC100X86 := Visual C++ 10.0 (aka Visual 2010 and MSC v16), targeting x86.
35
36# Tool Specific Properties
37ifndef PATH_TOOL_VCC100X86
38 PATH_TOOL_VCC100X86 := $(wildcard $(KBUILD_DEVTOOLS)/win.x86/vcc/v10*)
39 ifeq ($(PATH_TOOL_VCC100X86),)
40 PATH_TOOL_VCC100X86 := $(PATH_TOOL_VCC100)
41 endif
42 ifeq ($(PATH_TOOL_VCC100X86),)
43 PATH_TOOL_VCC100X86 := $(PATH_TOOL_VCC100AMD64)
44 endif
45 ifeq ($(PATH_TOOL_VCC100X86),)
46 PATH_TOOL_VCC100X86 := $(wildcard $(KBUILD_DEVTOOLS)/x86.win32/vcc/v10*)
47 endif
48 ifeq ($(PATH_TOOL_VCC100X86),)
49 PATH_TOOL_VCC100X86 := $(wildcard $(KBUILD_DEVTOOLS)/win.amd64/vcc/v10*)
50 endif
51 ifneq ($(PATH_TOOL_VCC100X86),)
52 PATH_TOOL_VCC100X86 := $(lastword $(sort $(PATH_TOOL_VCC100X86)))
53 else
54 $(warning kBuild: PATH_TOOL_VCC100X86 cannot be determined!)
55 PATH_TOOL_VCC100X86 := $(KBUILD_DEVTOOLS)/x86.win/vcc/v10
56 endif
57else
58 # Resolve any fancy stuff once and for all.
59 PATH_TOOL_VCC100X86 := $(PATH_TOOL_VCC100X86)
60endif
61PATH_TOOL_VCC100X86_BIN ?= $(PATH_TOOL_VCC100X86)/bin
62PATH_TOOL_VCC100X86_LIB ?= $(PATH_TOOL_VCC100X86)/lib
63PATH_TOOL_VCC100X86_INC ?= $(PATH_TOOL_VCC100X86)/include
64PATH_TOOL_VCC100X86_ATLMFC ?= $(PATH_TOOL_VCC100X86)/atlmfc
65PATH_TOOL_VCC100X86_ATLMFC_INC ?= $(PATH_TOOL_VCC100X86_ATLMFC)/include
66PATH_TOOL_VCC100X86_ATLMFC_LIB ?= $(PATH_TOOL_VCC100X86_ATLMFC)/lib
67TOOL_VCC100X86_CC ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC100X86_BIN)/cl.exe
68TOOL_VCC100X86_CXX ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC100X86_BIN)/cl.exe
69TOOL_VCC100X86_AS ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC100X86_BIN)/ml.exe
70#TOOL_VCC100X86_AR ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC100X86_BIN)/lib.exe - just an exec wrapper for the below
71TOOL_VCC100X86_AR ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC100X86_BIN)/link.exe /LIB
72TOOL_VCC100X86_LD ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC100X86_BIN)/link.exe
73TOOL_VCC100X86_DUMPBIN ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC100X86_BIN)/dumpbin.exe
74TOOL_VCC100X86_EDITBIN ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC100X86_BIN)/editbin.exe
75TOOL_VCC100X86_RC ?= $(EXEC_X86_WIN32) $(call TOOL_VCC100_FN_FIND_SDK_TOOL,rc.exe,[Rr][Cc].[Ee][Xx][Ee],TOOL_VCC100_RC_CACHED)
76TOOL_VCC100X86_MT ?= $(EXEC_X86_WIN32) $(call TOOL_VCC100_FN_FIND_SDK_TOOL,mt.exe,[Mm][Tt].[Ee][Xx][Ee],TOOL_VCC100_MT_CACHED)
77ifdef TOOL_VCC100X86_USE_KSUBMIT
78 ifeq ($(KBUILD_HOST),win)
79 TOOL_VCC100X86_KSUBMIT ?= kmk_builtin_kSubmit --32-bit
80 TOOL_VCC100X86_KSUBMIT_DD = $(TOOL_VCC100X86_KSUBMIT) --
81 endif
82endif
83
84# The following in duplicated in VCC100.kmk and VCC100X86.kmk.
85TOOL_VCC100_FN_FIND_SDK_TOOL_SUB = $(eval $3 := $(firstword \
86 $(if-expr defined(PATH_SDK_WINPSDK71_BIN), $(wildcard $(PATH_SDK_WINPSDK71_BIN)/$2)) \
87 $(if-expr defined(PATH_SDK_WINPSDK_BIN) , $(wildcard $(PATH_SDK_WINPSDK_BIN)/$2)) \
88 $(rsort $(wildcard $(KBUILD_DEVTOOLS_HST)/sdk/*/[Bb][Ii][Nn]/$2)) \
89 $(rsort $(wildcard $(KBUILD_DEVTOOLS_HST_ALT)/sdk/*/[Bb][Ii][Nn]/$2)) \
90 $1))
91TOOL_VCC100_FN_FIND_SDK_TOOL = $(if-expr !defined($3),$(TOOL_VCC100_FN_FIND_SDK_TOOL_SUB),)$($3)
92
93## Disabled fast DEP_IDB based dependencies.
94#VCC100X86_OLD_DEPS = 1
95
96## Constructs the correct .pdb name (the name is lowercased).
97# @param $(1) Base name, no extention.
98# @param $(2) The extension.
99TOOL_VCC100X86_PDB = $(dir $(1))$(tolower $(notdir $(1))).$(2)
100
101
102# General Properties used by kBuild
103TOOL_VCC100X86_COBJSUFF ?= .obj
104TOOL_VCC100X86_CFLAGS ?= -TC -nologo
105TOOL_VCC100X86_CFLAGS.debug ?= -Zi
106TOOL_VCC100X86_CFLAGS.dbgopt ?= -O2 -Zi
107TOOL_VCC100X86_CFLAGS.release ?= -O2
108TOOL_VCC100X86_CFLAGS.profile ?= -O2
109TOOL_VCC100X86_CINCS ?= $(PATH_TOOL_VCC100X86_INC)
110TOOL_VCC100X86_CDEFS ?=
111
112TOOL_VCC100X86_CXXOBJSUFF ?= .obj
113TOOL_VCC100X86_CXXFLAGS ?= -TP -nologo
114TOOL_VCC100X86_CXXFLAGS.debug ?= -Zi
115TOOL_VCC100X86_CXXFLAGS.dbgopt ?= -O2 -Zi
116TOOL_VCC100X86_CXXFLAGS.release ?= -O2
117TOOL_VCC100X86_CXXFLAGS.profile ?= -O2
118TOOL_VCC100X86_CXXINCS ?= $(PATH_TOOL_VCC100X86_INC) $(PATH_TOOL_VCC100X86_ATLMFC_INC)
119TOOL_VCC100X86_CXXDEFS ?=
120
121TOOL_VCC100X86_ASOBJSUFF ?= .obj
122
123TOOL_VCC100X86_RCOBJSUFF ?= .res
124TOOL_VCC100X86_RCINCS ?= $(PATH_TOOL_VCC100X86_INC) $(PATH_TOOL_VCC100X86_ATLMFC_INC)
125
126TOOL_VCC100X86_ARFLAGS ?= -nologo
127TOOL_VCC100X86_ARLIBSUFF ?= .lib
128
129TOOL_VCC100X86_LDFLAGS ?= -nologo -machine:x86
130TOOL_VCC100X86_LDFLAGS.debug ?= -debug
131TOOL_VCC100X86_LDFLAGS.dbgopt ?= -debug
132TOOL_VCC100X86_LDFLAGS.profile ?= -debug
133TOOL_VCC100X86_LDFLAGS.release ?=
134
135
136
137## Compile C source.
138# @param $(target) Normalized main target name.
139# @param $(source) Source filename (relative).
140# @param $(obj) Object file name. This shall be (re)created by the compilation.
141# @param $(dep) Dependcy file. This shall be (re)created by the compilation.
142# @param $(flags) Flags.
143# @param $(defs) Definitions. No -D or something.
144# @param $(incs) Includes. No -I or something.
145# @param $(dirdep) Directory creation dependency.
146# @param $(deps) Other dependencies.
147#
148# @param $(outbase) Output basename (full). Use this for list files and such.
149# @param $(objsuff) Object suffix.
150TOOL_VCC100X86_COMPILE_C_DEPEND =
151TOOL_VCC100X86_COMPILE_C_DEPORD =
152ifdef KBUILD_USE_KOBJCACHE
153TOOL_VCC100X86_COMPILE_C_USES_KOBJCACHE = 1
154TOOL_VCC100X86_COMPILE_C_OUTPUT = $(outbase).i
155TOOL_VCC100X86_COMPILE_C_OUTPUT_MAYBE =
156define TOOL_VCC100X86_COMPILE_C_CMDS
157 $(QUIET)$(KOBJCACHE) -f $(outbase).koc -d $(PATH_OBJCACHE) -t $(bld_trg).$(bld_trg_arch) -O2 -r\
158 --make-dep-fix-case --make-dep-gen-stubs --make-dep-quiet --make-dep-file $(dep)\
159 --kObjCache-cpp $(outbase).i\
160 $(TOOL_VCC100X86_CC) -E\
161 $(subst -Zi,-Z7,$(flags))\
162 $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
163 $(subst /,\\,$(abspath $(source))) \
164 --kObjCache-cc $(obj)\
165 $(TOOL_VCC100X86_CC) -c\
166 $(subst -Zi,-Z7,$(flags))\
167 -Fo$(obj)\
168 $(outbase).i
169endef
170else # !KBUILD_USE_KOBJCACHE
171TOOL_VCC100X86_COMPILE_C_OUTPUT = $(call TOOL_VCC100X86_PDB, $(outbase)-obj,idb)
172TOOL_VCC100X86_COMPILE_C_OUTPUT_MAYBE = $(call TOOL_VCC100X86_PDB, $(outbase)-obj,pdb)
173 ifdef TOOL_VCC100X86_KSUBMIT
174define TOOL_VCC100X86_COMPILE_C_CMDS
175 $(QUIET)$(TOOL_VCC100X86_KSUBMIT) -P $(DEP_OBJ_INT) -f -s -q -o $(dep) -t $(obj) $(obj)\
176 -- $(TOOL_VCC100X86_CC) -c\
177 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
178 -Fd$(outbase)-obj.pdb \
179 -FD\
180 -Fo$(obj)\
181 $(subst /,\\,$(abspath $(source)))
182endef
183 else
184define TOOL_VCC100X86_COMPILE_C_CMDS
185 $(QUIET)$(TOOL_VCC100X86_CC) -c\
186 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
187 -Fd$(outbase)-obj.pdb \
188 -FD\
189 -Fo$(obj)\
190 $(subst /,\\,$(abspath $(source)))
191 $(QUIET)$(DEP_IDB) -f -s -q -o $(dep) -t $(obj) $(call TOOL_VCC100X86_PDB,$(outbase)-obj,idb)
192endef
193 endif # !TOOL_VCC100X86_KSUBMIT
194endif # !KBUILD_USE_KOBJCACHE
195
196
197## Compile C++ source.
198# @param $(target) Normalized main target name.
199# @param $(source) Source filename (relative).
200# @param $(obj) Object file name. This shall be (re)created by the compilation.
201# @param $(dep) Dependcy file. This shall be (re)created by the compilation.
202# @param $(flags) Flags.
203# @param $(defs) Definitions. No -D or something.
204# @param $(incs) Includes. No -I or something.
205# @param $(dirdep) Directory creation dependency.
206# @param $(deps) Other dependencies.
207#
208# @param $(outbase) Output basename (full). Use this for list files and such.
209# @param $(objsuff) Object suffix.
210TOOL_VCC100X86_COMPILE_CXX_DEPEND =
211TOOL_VCC100X86_COMPILE_CXX_DEPORD =
212ifdef KBUILD_USE_KOBJCACHE
213TOOL_VCC100X86_COMPILE_CXX_USES_KOBJCACHE = 1
214TOOL_VCC100X86_COMPILE_CXX_OUTPUT = $(outbase).ii
215TOOL_VCC100X86_COMPILE_CXX_OUTPUT_MAYBE =
216define TOOL_VCC100X86_COMPILE_CXX_CMDS
217 $(QUIET)$(KOBJCACHE) -f $(outbase).koc -d $(PATH_OBJCACHE) -t $(bld_trg).$(bld_trg_arch) -O2 -r\
218 --make-dep-fix-case --make-dep-gen-stubs --make-dep-quiet --make-dep-file $(dep)\
219 --kObjCache-cpp $(outbase).ii\
220 $(TOOL_VCC100X86_CXX) -E\
221 $(subst -Zi,-Z7,$(flags))\
222 $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
223 $(subst /,\\,$(abspath $(source))) \
224 --kObjCache-cc $(obj)\
225 $(TOOL_VCC100X86_CXX) -c\
226 $(subst -Zi,-Z7,$(flags))\
227 -Fo$(obj)\
228 $(outbase).ii
229endef
230else # !KBUILD_USE_KOBJCACHE
231TOOL_VCC100X86_COMPILE_CXX_OUTPUT = $(call TOOL_VCC100X86_PDB, $(outbase)-obj,idb)
232TOOL_VCC100X86_COMPILE_CXX_OUTPUT_MAYBE = $(call TOOL_VCC100X86_PDB, $(outbase)-obj,pdb)
233 ifdef TOOL_VCC100X86_KSUBMIT
234define TOOL_VCC100X86_COMPILE_CXX_CMDS
235 $(QUIET)$(TOOL_VCC100X86_KSUBMIT) -P $(DEP_OBJ_INT) -f -s -q -o $(dep) -t $(obj) $(obj)\
236 -- $(TOOL_VCC100X86_CXX) -c\
237 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
238 -Fd$(outbase)-obj.pdb \
239 -FD\
240 -Fo$(obj)\
241 $(subst /,\\,$(abspath $(source)))
242endef
243 else
244define TOOL_VCC100X86_COMPILE_CXX_CMDS
245 $(QUIET)$(TOOL_VCC100X86_CXX) -c\
246 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
247 -Fd$(outbase)-obj.pdb \
248 -FD\
249 -Fo$(obj)\
250 $(subst /,\\,$(abspath $(source)))
251 $(QUIET)$(DEP_IDB) -f -s -q -o $(dep) -t $(obj) $(call TOOL_VCC100X86_PDB,$(outbase)-obj,idb)
252endef
253 endif # !TOOL_VCC100X86_KSUBMIT
254endif # !KBUILD_USE_KOBJCACHE
255
256## @todo configure the assembler template.
257
258## Compile resource source.
259# @param $(target) Normalized main target name.
260# @param $(source) Source filename (relative).
261# @param $(obj) Object file name. This shall be (re)created by the compilation.
262# @param $(dep) Dependcy file. This shall be (re)created by the compilation.
263# @param $(flags) Flags.
264# @param $(defs) Definitions. No -D or something.
265# @param $(incs) Includes. No -I or something.
266# @param $(dirdep) Directory creation dependency.
267# @param $(deps) Other dependencies.
268#
269# @param $(outbase) Output basename (full). Use this for list files and such.
270# @param $(objsuff) Object suffix.
271TOOL_VCC100X86_COMPILE_RC_DEPEND =
272TOOL_VCC100X86_COMPILE_RC_DEPORD =
273TOOL_VCC100X86_COMPILE_RC_OUTPUT =
274define TOOL_VCC100X86_COMPILE_RC_CMDS
275 $(QUIET)$(TOOL_VCC100X86_RC) \
276 $(flags) $(addprefix /i, $(subst /,\\,$(incs))) $(addprefix /d, $(defs))\
277 /fo$(obj)\
278 $(subst /,\\,$(abspath $(source)))
279endef
280
281
282## Link library
283# @param $(target) Normalized main target name.
284# @param $(out) Library name.
285# @param $(objs) Object files to put in the library.
286# @param $(flags) Flags.
287# @param $(dirdep) Directory creation dependency.
288# @param $(deps) Other dependencies.
289# @param $(othersrc) Unhandled sources.
290# @param $(outbase) Output basename (full). Use this for list files and such.
291#
292TOOL_VCC100X86_LINK_LIBRARY_DEPEND = $(othersrc)
293TOOL_VCC100X86_LINK_LIBRARY_DEPORD =
294TOOL_VCC100X86_LINK_LIBRARY_OUTPUT = $(outbase).rsp
295TOOL_VCC100X86_LINK_LIBRARY_OUTPUT_MAYBE = $(outbase).lst $(outbase).exp $(outbase).pdb
296define TOOL_VCC100X86_LINK_LIBRARY_CMDS
297 $(QUIET)$(APPEND) -tn $(outbase).rsp \
298 $(foreach arg,\
299 $(subst /,\\,$(objs) \
300 $(filter-out %.def,$(othersrc))) \
301 $(addprefix /DEF:,$(filter %.def,$(othersrc))) \
302 ,\"$(arg)\")
303 $(QUIET)$(TOOL_VCC100X86_KSUBMIT_DD) $(TOOL_VCC100X86_AR) $(flags) /OUT:$(out) @$(outbase).rsp
304endef
305
306
307## Link program
308# @param $(target) Normalized main target name.
309# @param $(out) Program name.
310# @param $(objs) Object files to link together.
311# @param $(libs) Libraries to search.
312# @param $(libpath) Library search paths.
313# @param $(flags) Flags.
314# @param $(dirdep) Directory creation dependency.
315# @param $(deps) Other dependencies.
316# @param $(othersrc) Unhandled sources.
317# @param $(custom_pre) Custom step invoked before linking.
318# @param $(custom_post) Custom step invoked after linking.
319# @param $(outbase) Output basename (full). Use this for list files and such.
320#
321TOOL_VCC100X86_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
322TOOL_VCC100X86_LINK_PROGRAM_DEPORD =
323TOOL_VCC100X86_LINK_PROGRAM_OUTPUT = $(outbase).map $(outbase).rsp
324TOOL_VCC100X86_LINK_PROGRAM_OUTPUT_MAYBE = $(outbase).lib $(outbase).exp $(outbase).ilk $(out).manifest
325TOOL_VCC100X86_LINK_PROGRAM_OUTPUT_DEBUG = $(outbase).pdb
326TOOL_VCC100X86_LINK_PROGRAM_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
327define TOOL_VCC100X86_LINK_PROGRAM_CMDS
328 $(QUIET)$(APPEND) -tn $(outbase).rsp \
329 $(foreach arg,\
330 $(subst /,\\,$(objs)) \
331 $(subst /,\\,$(libs)) \
332 ,\"$(arg)\")
333 $(QUIET)$(TOOL_VCC100X86_KSUBMIT_DD) $(TOOL_VCC100X86_LD) $(flags) \
334 /OUT:$(out) \
335 /MAPINFO:EXPORTS /INCREMENTAL:NO \
336 /MAP:$(outbase).map \
337 $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
338 $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
339 $(foreach p,$(libpath), /LIBPATH:$(p)) \
340 @$(outbase).rsp
341ifndef TOOL_VCC100X86_NO_AUTO_MANIFEST
342 $(QUIET)$(TEST) -f $(out).manifest -- \
343 $(TOOL_VCC100X86_MT) -manifest $(subst /,\\,$(out)).manifest -outputresource:$(subst /,\\,$(out))
344endif
345endef
346
347
348## Link DLL.
349# @param $(target) Normalized main target name.
350# @param $(out) DLL name.
351# @param $(objs) Object files to link together.
352# @param $(libs) Libraries to search.
353# @param $(libpath) Library search paths.
354# @param $(flags) Flags.
355# @param $(dirdep) Directory creation dependency.
356# @param $(deps) Other dependencies.
357# @param $(othersrc) Unhandled sources.
358# @param $(custom_pre) Custom step invoked before linking.
359# @param $(custom_post) Custom step invoked after linking.
360#
361# @param $(outbase) Output basename (full). Use this for list files and such.
362TOOL_VCC100X86_LINK_DLL_DEPEND = $(objs) $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
363TOOL_VCC100X86_LINK_DLL_DEPORD = $(call DIRDEP,$(PATH_STAGE_LIB))
364TOOL_VCC100X86_LINK_DLL_OUTPUT = $(outbase).map $(outbase).lib $(outbase).exp $(outbase).rsp
365TOOL_VCC100X86_LINK_DLL_OUTPUT_MAYBE = $(outbase).ilk $(out).manifest $(PATH_STAGE_LIB)/$(notdir $(outbase)).exp
366TOOL_VCC100X86_LINK_DLL_OUTPUT_MAYBE_PRECIOUS = $(PATH_STAGE_LIB)/$(notdir $(outbase)).lib
367TOOL_VCC100X86_LINK_DLL_OUTPUT_DEBUG = $(outbase).pdb
368TOOL_VCC100X86_LINK_DLL_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
369define TOOL_VCC100X86_LINK_DLL_CMDS
370 $(QUIET)$(APPEND) -tn $(outbase).rsp \
371 $(foreach arg,\
372 $(subst /,\\,$(objs)) \
373 $(subst /,\\,$(libs)) \
374 ,\"$(arg)\")
375 $(QUIET)$(TOOL_VCC100X86_KSUBMIT_DD) $(TOOL_VCC100X86_LD) $(flags) \
376 /OUT:$(out) \
377 /IMPLIB:$(outbase).lib \
378 /MAPINFO:EXPORTS /INCREMENTAL:NO \
379 /MAP:$(outbase).map \
380 /DLL \
381 $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
382 $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
383 $(foreach p,$(libpath), /LIBPATH:$(p)) \
384 @$(outbase).rsp
385ifndef TOOL_VCC100X86_NO_AUTO_MANIFEST
386 $(QUIET)$(TEST) -f $(out).manifest -- \
387 $(TOOL_VCC100X86_MT) -manifest $(subst /,\\,$(out)).manifest '-outputresource:$(subst /,\\,$(out));#2'
388endif
389 $(QUIET)$(TEST) -f $(outbase).lib -- $(KLIBTWEAKER_EXT) --clear-timestamps $(outbase).lib
390 $(QUIET)$(CP) --changed --ignore-non-existing $(outbase).exp $(outbase).lib $(PATH_STAGE_LIB)/
391$(eval _DIRS += $(PATH_STAGE_LIB))
392endef
393
394
395## Link system module (windows aka driver, linux aka kernel module)
396# @param $(target) Normalized main target name.
397# @param $(out) System module name.
398# @param $(objs) Object files to link together.
399# @param $(libs) Libraries to search.
400# @param $(libpath) Library search paths.
401# @param $(flags) Flags.
402# @param $(dirdep) Directory creation dependency.
403# @param $(deps) Other dependencies.
404# @param $(othersrc) Unhandled sources.
405# @param $(custom_pre) Custom step invoked before linking.
406# @param $(custom_post) Custom step invoked after linking.
407#
408# @param $(outbase) Output basename (full). Use this for list files and such.
409TOOL_VCC100X86_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
410TOOL_VCC100X86_LINK_SYSMOD_DEPORD =
411TOOL_VCC100X86_LINK_SYSMOD_OUTPUT = $(outbase).map $(outbase).rsp
412TOOL_VCC100X86_LINK_SYSMOD_OUTPUT_MAYBE = $(outbase).lib $(outbase).exp $(outbase).ilk $(out).manifest
413TOOL_VCC100X86_LINK_SYSMOD_OUTPUT_DEBUG = $(outbase).pdb
414TOOL_VCC100X86_LINK_SYSMOD_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
415define TOOL_VCC100X86_LINK_SYSMOD_CMDS
416 $(QUIET)$(APPEND) -tn $(outbase).rsp \
417 $(foreach arg,\
418 $(subst /,\\,$(objs)) \
419 $(subst /,\\,$(libs)) \
420 ,\"$(arg)\")
421 $(QUIET)$(TOOL_VCC100X86_KSUBMIT_DD) $(TOOL_VCC100X86_LD) $(flags) \
422 /OUT:$(out) \
423 /MAPINFO:EXPORTS /INCREMENTAL:NO \
424 /MAP:$(outbase).map \
425 $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
426 $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
427 $(foreach p,$(libpath), /LIBPATH:$(p)) \
428 @$(outbase).rsp
429ifndef TOOL_VCC100X86_NO_AUTO_MANIFEST
430 $(QUIET)$(TEST) -f $(out).manifest -- \
431 $(TOOL_VCC100X86_MT) -manifest $(subst /,\\,$(out)).manifest '-outputresource:$(subst /,\\,$(out));#2'
432endif
433endef
434
Note: See TracBrowser for help on using the repository browser.