source: trunk/kBuild/tools/VCC80AMD64.kmk@ 706

Last change on this file since 706 was 706, checked in by bird, 19 years ago

Fixed some x86.win* & amd64.win* leftovers.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 13.8 KB
Line 
1# $Id: VCC80AMD64.kmk 706 2006-12-10 21:57:53Z bird $
2## @file
3#
4# kBuild Tool Config - Visual C++ 8.0 (aka Visual .NET 2005, or MSC v14), targeting AMD64.
5#
6# Copyright (c) 2004-2006 knut st. osmundsen <bird-srcspam@anduin.net>
7#
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
27TOOL_VCC80AMD64 := Visual C++ 8.0 (aka Visual .NET 2005, or MSC v14), targeting AMD64.
28
29# Tool Specific Properties
30ifndef PATH_TOOL_VCC80AMD64
31 PATH_TOOL_VCC80AMD64 := $(wildcard $(PATH_DEVTOOLS)/win.x86/vcc/v8)
32 ifeq ($(PATH_TOOL_VCC80AMD64),)
33 PATH_TOOL_VCC80AMD64 := $(PATH_TOOL_VCC80)
34 endif
35 ifeq ($(PATH_TOOL_VCC80AMD64),)
36 PATH_TOOL_VCC80AMD64 := $(wildcard $(PATH_DEVTOOLS)/win.x86/vcc/v8)
37 endif
38 ifeq ($(PATH_TOOL_VCC80AMD64),)
39 PATH_TOOL_VCC80AMD64 := $(wildcard $(PATH_DEVTOOLS)/x86.win32/vcc/v8)
40 endif
41 ifneq ($(PATH_TOOL_VCC80AMD64),)
42 # done for now
43 else
44 $(warning kBuild: PATH_TOOL_VCC80AMD64 cannot be determined!)
45 PATH_TOOL_VCC80AMD64 := $(PATH_DEVTOOLS)/win.x86/vcc/v8
46 endif
47else
48 # Resolve any fancy stuff once and for all.
49 PATH_TOOL_VCC80AMD64 := $(PATH_TOOL_VCC80AMD64)
50endif
51ifeq ($(BUILD_PLATFORM).$(BUILD_PLATFORM_ARCH),win.amd64)
52PATH_TOOL_VCC80AMD64_BIN ?= $(PATH_TOOL_VCC80AMD64)/bin/amd64
53else
54PATH_TOOL_VCC80AMD64_BIN ?= $(PATH_TOOL_VCC80AMD64)/bin/x86_amd64
55endif
56PATH_TOOL_VCC80AMD64_LIB ?= $(PATH_TOOL_VCC80AMD64)/lib/amd64
57PATH_TOOL_VCC80AMD64_INC ?= $(PATH_TOOL_VCC80AMD64)/include
58PATH_TOOL_VCC80AMD64_ATLMFC ?= $(PATH_TOOL_VCC80X86)/atlmfc
59PATH_TOOL_VCC80AMD64_ATLMFC_INC ?= $(PATH_TOOL_VCC80AMD64_ATLMFC)/include
60PATH_TOOL_VCC80AMD64_ATLMFC_LIB ?= $(PATH_TOOL_VCC80AMD64_ATLMFC)/lib/amd64
61TOOL_VCC80AMD64_CC ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC80AMD64_BIN)/cl.exe
62TOOL_VCC80AMD64_CXX ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC80AMD64_BIN)/cl.exe
63TOOL_VCC80AMD64_AS ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC80AMD64_BIN)/ml64.exe
64TOOL_VCC80AMD64_RC ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC80AMD64_BIN)/../rc.exe
65TOOL_VCC80AMD64_AR ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC80AMD64_BIN)/lib.exe
66TOOL_VCC80AMD64_LD ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC80AMD64_BIN)/link.exe
67TOOL_VCC80AMD64_MT ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC80AMD64_BIN)/../mt.exe
68VCC80AMD64_NEW_DEPS = 1 ##< Enables fast DEP_IDB based dependencies.
69
70## Constructs the correct .pdb name (the name is lowercased).
71# @param $(1) Base name, no extention.
72# @param $(2) The extension.
73ifeq ($(filter tolower,$(KMK_FEATURES)),tolower)
74TOOL_VCC80AMD64_PDB = $(dir $(1))$(tolower $(notdir $(1))).$(2)
75else # this fallback is incorrect and won't work on a case sensitive FS.
76TOOL_VCC80AMD64_PDB = $(1).$(2)
77endif
78
79TOOL_VCC80AMD64_COBJSUFF ?= .obj
80TOOL_VCC80AMD64_CFLAGS ?= -TC -c -nologo
81TOOL_VCC80AMD64_CFLAGS.debug ?= -Od -Zi
82TOOL_VCC80AMD64_CFLAGS.release ?= -O2
83TOOL_VCC80AMD64_CFLAGS.profile ?= -O2
84TOOL_VCC80AMD64_CINCS ?= $(PATH_TOOL_VCC80AMD64_INC)
85TOOL_VCC80AMD64_CDEFS ?=
86
87TOOL_VCC80AMD64_CXXOBJSUFF ?= .obj
88TOOL_VCC80AMD64_CXXFLAGS ?= -TP -c -nologo
89TOOL_VCC80AMD64_CXXFLAGS.debug ?= -Od -Zi
90TOOL_VCC80AMD64_CXXFLAGS.release ?= -O2
91TOOL_VCC80AMD64_CXXFLAGS.profile ?= -O2
92TOOL_VCC80AMD64_CXXINCS ?= $(PATH_TOOL_VCC80AMD64_INC) $(PATH_TOOL_VCC80AMD64_ATLMFC_INC)
93TOOL_VCC80AMD64_CXXDEFS ?=
94
95TOOL_VCC80AMD64_ASOBJSUFF ?= .obj
96
97TOOL_VCC80AMD64_RCOBJSUFF ?= .res
98TOOL_VCC80AMD64_RCINCS ?= $(PATH_TOOL_VCC80AMD64_INC) $(PATH_TOOL_VCC80AMD64_ATLMFC_INC)
99
100TOOL_VCC80AMD64_ARFLAGS ?= -nologo -machine:amd64
101TOOL_VCC80AMD64_ARLIBSUFF ?= .lib
102
103TOOL_VCC80AMD64_LDFLAGS ?= -nologo -machine:amd64
104TOOL_VCC80AMD64_LDFLAGS.debug ?= -debug
105TOOL_VCC80AMD64_LDFLAGS.release ?=
106
107
108
109## Compile C source.
110# @param $(target) Normalized main target name.
111# @param $(source) Source filename (relative).
112# @param $(obj) Object file name. This shall be (re)created by the compilation.
113# @param $(dep) Dependcy file. This shall be (re)created by the compilation.
114# @param $(flags) Flags.
115# @param $(defs) Definitions. No -D or something.
116# @param $(incs) Includes. No -I or something.
117# @param $(dirdep) Directory creation dependency.
118# @param $(deps) Other dependencies.
119#
120# @param $(outbase) Output basename (full). Use this for list files and such.
121# @param $(objsuff) Object suffix.
122TOOL_VCC80AMD64_COMPILE_C_OUTPUT = $(call TOOL_VCC80AMD64_PDB, $(outbase)-obj,pdb) $(call TOOL_VCC80AMD64_PDB, $(outbase)-obj,idb)
123TOOL_VCC80AMD64_COMPILE_C_DEPEND =
124TOOL_VCC80AMD64_COMPILE_C_DEPORD =
125ifdef VCC80AMD64_NEW_DEPS
126define TOOL_VCC80AMD64_COMPILE_C_CMDS
127 $(QUIET)$(TOOL_VCC80AMD64_CC) -c\
128 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
129 -Fd$(outbase)-obj.pdb \
130 -FD\
131 -Fo$(obj)\
132 $(subst /,\\,$(abspath $(source)))
133 $(QUIET)$(DEP_IDB) -f -s -o $(dep) -t $(obj) $(call TOOL_VCC80AMD64_PDB,$(outbase)-obj,idb)
134endef
135else
136define TOOL_VCC80AMD64_COMPILE_C_CMDS
137 $(QUIET)$(TOOL_VCC80AMD64_CC) -c\
138 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
139 -Fd$(outbase)-obj.pdb \
140 -Fo$(obj)\
141 $(subst /,\\,$(abspath $(source)))
142 $(QUIET)$(TOOL_VCC80AMD64_CC) -E\
143 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
144 $(subst /,\\,$(abspath $(source)))\
145 | $(DEP_PRE) -f -s -o $(dep) -t $(obj) -
146endef
147endif
148
149
150## Compile C++ source.
151# @param $(target) Normalized main target name.
152# @param $(source) Source filename (relative).
153# @param $(obj) Object file name. This shall be (re)created by the compilation.
154# @param $(dep) Dependcy file. This shall be (re)created by the compilation.
155# @param $(flags) Flags.
156# @param $(defs) Definitions. No -D or something.
157# @param $(incs) Includes. No -I or something.
158# @param $(dirdep) Directory creation dependency.
159# @param $(deps) Other dependencies.
160#
161# @param $(outbase) Output basename (full). Use this for list files and such.
162# @param $(objsuff) Object suffix.
163TOOL_VCC80AMD64_COMPILE_CXX_OUTPUT = $(call TOOL_VCC80AMD64_PDB, $(outbase)-obj,pdb) $(call TOOL_VCC80AMD64_PDB, $(outbase)-obj,idb)
164TOOL_VCC80AMD64_COMPILE_CXX_DEPEND =
165TOOL_VCC80AMD64_COMPILE_CXX_DEPORD =
166ifdef VCC80AMD64_NEW_DEPS
167define TOOL_VCC80AMD64_COMPILE_CXX_CMDS
168 $(QUIET)$(TOOL_VCC80AMD64_CXX) -c\
169 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
170 -Fd$(outbase)-obj.pdb \
171 -FD\
172 -Fo$(obj)\
173 $(subst /,\\,$(abspath $(source)))
174 $(QUIET)$(DEP_IDB) -f -s -o $(dep) -t $(obj) $(call TOOL_VCC80AMD64_PDB,$(outbase)-obj,idb)
175endef
176else
177define TOOL_VCC80AMD64_COMPILE_CXX_CMDS
178 $(QUIET)$(TOOL_VCC80AMD64_CXX) -c\
179 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
180 -Fd$(outbase)-obj.pdb \
181 -Fo$(obj)\
182 $(subst /,\\,$(abspath $(source)))
183 $(QUIET)$(TOOL_VCC80AMD64_CXX) -E\
184 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
185 $(subst /,\\,$(abspath $(source)))\
186 | $(DEP_PRE) -f -s -o $(dep) -t $(obj) -
187endef
188endif
189
190
191## Compile resource source.
192# @param $(target) Normalized main target name.
193# @param $(source) Source filename (relative).
194# @param $(obj) Object file name. This shall be (re)created by the compilation.
195# @param $(dep) Dependcy file. This shall be (re)created by the compilation.
196# @param $(flags) Flags.
197# @param $(defs) Definitions. No -D or something.
198# @param $(incs) Includes. No -I or something.
199# @param $(dirdep) Directory creation dependency.
200# @param $(deps) Other dependencies.
201#
202# @param $(outbase) Output basename (full). Use this for list files and such.
203# @param $(objsuff) Object suffix.
204TOOL_VCC80AMD64_COMPILE_RC_OUTPUT =
205TOOL_VCC80AMD64_COMPILE_RC_DEPEND =
206TOOL_VCC80AMD64_COMPILE_RC_DEPORD =
207define TOOL_VCC80AMD64_COMPILE_RC_CMDS
208 $(QUIET)$(TOOL_VCC80AMD64_RC) \
209 $(flags) $(addprefix /i, $(subst /,\\,$(incs))) $(addprefix /d, $(defs))\
210 /fo$(obj)\
211 $(subst /,\\,$(abspath $(source)))
212endef
213
214
215## Link library
216# @param $(target) Normalized main target name.
217# @param $(out) Library name.
218# @param $(objs) Object files to put in the library.
219# @param $(flags) Flags.
220# @param $(dirdep) Directory creation dependency.
221# @param $(deps) Other dependencies.
222# @param $(othersrc) Unhandled sources.
223# @param $(outbase) Output basename (full). Use this for list files and such.
224#
225TOOL_VCC80AMD64_LINK_LIBRARY_OUTPUT = $(outbase).lst $(outbase).exp $(outbase).pdb
226TOOL_VCC80AMD64_LINK_LIBRARY_DEPEND = $(othersrc)
227TOOL_VCC80AMD64_LINK_LIBRARY_DEPORD =
228define TOOL_VCC80AMD64_LINK_LIBRARY_CMDS
229 $(QUIET)$(TOOL_VCC80AMD64_AR) $(flags) /OUT:$(out) $(subst /,\\,$(objs) $(filter %.a %.lib,$(othersrc))) \
230 $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def))
231endef
232
233
234## Link program
235# @param $(target) Normalized main target name.
236# @param $(out) Program name.
237# @param $(objs) Object files to link together.
238# @param $(libs) Libraries to search.
239# @param $(libpath) Library search paths.
240# @param $(flags) Flags.
241# @param $(dirdep) Directory creation dependency.
242# @param $(deps) Other dependencies.
243# @param $(othersrc) Unhandled sources.
244# @param $(custom_pre) Custom step invoked before linking.
245# @param $(custom_post) Custom step invoked after linking.
246# @param $(outbase) Output basename (full). Use this for list files and such.
247#
248TOOL_VCC80AMD64_LINK_PROGRAM_OUTPUT = $(outbase).map $(outbase).lib $(outbase).exp $(outbase).pdb $(outbase).ilk $(out).manifest
249TOOL_VCC80AMD64_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
250TOOL_VCC80AMD64_LINK_PROGRAM_DEPORD =
251define TOOL_VCC80AMD64_LINK_PROGRAM_CMDS
252 $(QUIET)$(TOOL_VCC80AMD64_LD) $(flags) \
253 /OUT:$(out) \
254 /MAPINFO:EXPORTS /INCREMENTAL:NO \
255 /MAP:$(outbase).map \
256 $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
257 $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
258 $(foreach p,$(libpath), /LIBPATH:$(p)) \
259 $(subst /,\\,$(objs)) \
260 $(subst /,\\,$(libs))
261 $(QUIET)if test -f $(out).manifest; then \
262 $(TOOL_VCC80AMD64_MT) -manifest $(subst /,\\,$(out)).manifest -outputresource:$(subst /,\\,$(out)); \
263 fi
264endef
265
266
267## Link DLL.
268# @param $(target) Normalized main target name.
269# @param $(out) DLL name.
270# @param $(objs) Object files to link together.
271# @param $(libs) Libraries to search.
272# @param $(libpath) Library search paths.
273# @param $(flags) Flags.
274# @param $(dirdep) Directory creation dependency.
275# @param $(deps) Other dependencies.
276# @param $(othersrc) Unhandled sources.
277# @param $(custom_pre) Custom step invoked before linking.
278# @param $(custom_post) Custom step invoked after linking.
279#
280# @param $(outbase) Output basename (full). Use this for list files and such.
281TOOL_VCC80AMD64_LINK_DLL_OUTPUT = $(outbase).map $(outbase).lib $(outbase).exp $(outbase).pdb $(outbase).ilk $(out).manifest
282TOOL_VCC80AMD64_LINK_DLL_DEPEND = $(objs) $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
283TOOL_VCC80AMD64_LINK_DLL_DEPORD = $(call DIRDEP,$(PATH_LIB))
284define TOOL_VCC80AMD64_LINK_DLL_CMDS
285 $(QUIET)$(TOOL_VCC80AMD64_LD) $(flags) \
286 /OUT:$(out) \
287 /IMPLIB:$(outbase).lib \
288 /MAPINFO:EXPORTS /INCREMENTAL:NO \
289 /MAP:$(outbase).map \
290 /DLL \
291 $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
292 $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
293 $(foreach p,$(libpath), /LIBPATH:$(p)) \
294 $(subst /,\\,$(objs)) \
295 $(subst /,\\,$(libs))
296 $(QUIET)if test -f $(out).manifest; then \
297 $(TOOL_VCC80AMD64_MT) -manifest $(subst /,\\,$(out)).manifest "-outputresource:$(subst /,\\,$(out));#2"; \
298 fi
299ifeq ($(filter %.exp .def,$(othersrc)),)
300 $(QUIET)if test -f $(outbase).exp; then $(CP_EXT) $(outbase).exp $(PATH_LIB)/; fi
301 $(QUIET)if test -f $(outbase).lib; then $(CP_EXT) $(outbase).lib $(PATH_LIB)/; fi
302endif
303$(eval _DIRS += $(PATH_LIB))
304endef
305
306
307## Link system module (windows aka driver, linux aka kernel module)
308# @param $(target) Normalized main target name.
309# @param $(out) System module 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#
320# @param $(outbase) Output basename (full). Use this for list files and such.
321TOOL_VCC80AMD64_LINK_SYSMOD_OUTPUT = $(outbase).map $(outbase).lib $(outbase).exp $(outbase).pdb $(outbase).ilk $(out).manifest
322TOOL_VCC80AMD64_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
323TOOL_VCC80AMD64_LINK_SYSMOD_DEPORD =
324define TOOL_VCC80AMD64_LINK_SYSMOD_CMDS
325 $(QUIET)$(TOOL_VCC80AMD64_LD) $(flags) \
326 /OUT:$(out) \
327 /MAPINFO:EXPORTS /INCREMENTAL:NO \
328 /MAP:$(outbase).map \
329 $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
330 $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
331 $(foreach p,$(libpath), /LIBPATH:$(p)) \
332 $(subst /,\\,$(objs)) \
333 $(subst /,\\,$(libs))
334 $(QUIET)if test -f $(out).manifest; then \
335 $(TOOL_VCC80AMD64_MT) -manifest $(subst /,\\,$(out)).manifest "-outputresource:$(subst /,\\,$(out));#2"; \
336 fi
337endef
338
Note: See TracBrowser for help on using the repository browser.