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