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

Last change on this file since 1099 was 1031, checked in by bird, 18 years ago

MAYBE output. removed some obsolete stuff.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 13.3 KB
Line 
1# $Id: VCC80AMD64.kmk 1031 2007-06-04 01:56:58Z 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-2007 knut st. osmundsen <bird-kBuild-spam@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 := $(PATH_TOOL_VCC80X86)
37 endif
38 ifeq ($(PATH_TOOL_VCC80AMD64),)
39 PATH_TOOL_VCC80AMD64 := $(wildcard $(PATH_DEVTOOLS)/win.x86/vcc/v8*)
40 endif
41 ifneq ($(PATH_TOOL_VCC80AMD64),)
42 PATH_TOOL_VCC80AMD64 := $(lastword $(sort $(PATH_TOOL_VCC80AMD64)))
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_VCC80AMD64)/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
68## Disabled fast DEP_IDB based dependencies.
69#VCC80AMD64_OLD_DEPS = 1
70
71## Constructs the correct .pdb name (the name is lowercased).
72# @param $(1) Base name, no extention.
73# @param $(2) The extension.
74ifeq ($(filter tolower,$(KMK_FEATURES)),tolower)
75TOOL_VCC80AMD64_PDB = $(dir $(1))$(tolower $(notdir $(1))).$(2)
76else # this fallback is incorrect and won't work on a case sensitive FS.
77TOOL_VCC80AMD64_PDB = $(1).$(2)
78endif
79
80TOOL_VCC80AMD64_COBJSUFF ?= .obj
81TOOL_VCC80AMD64_CFLAGS ?= -TC -c -nologo
82TOOL_VCC80AMD64_CFLAGS.debug ?= -Od -Zi
83TOOL_VCC80AMD64_CFLAGS.release ?= -O2
84TOOL_VCC80AMD64_CFLAGS.profile ?= -O2
85TOOL_VCC80AMD64_CINCS ?= $(PATH_TOOL_VCC80AMD64_INC)
86TOOL_VCC80AMD64_CDEFS ?=
87
88TOOL_VCC80AMD64_CXXOBJSUFF ?= .obj
89TOOL_VCC80AMD64_CXXFLAGS ?= -TP -c -nologo
90TOOL_VCC80AMD64_CXXFLAGS.debug ?= -Od -Zi
91TOOL_VCC80AMD64_CXXFLAGS.release ?= -O2
92TOOL_VCC80AMD64_CXXFLAGS.profile ?= -O2
93TOOL_VCC80AMD64_CXXINCS ?= $(PATH_TOOL_VCC80AMD64_INC) $(PATH_TOOL_VCC80AMD64_ATLMFC_INC)
94TOOL_VCC80AMD64_CXXDEFS ?=
95
96TOOL_VCC80AMD64_ASOBJSUFF ?= .obj
97
98TOOL_VCC80AMD64_RCOBJSUFF ?= .res
99TOOL_VCC80AMD64_RCINCS ?= $(PATH_TOOL_VCC80AMD64_INC) $(PATH_TOOL_VCC80AMD64_ATLMFC_INC)
100
101TOOL_VCC80AMD64_ARFLAGS ?= -nologo -machine:amd64
102TOOL_VCC80AMD64_ARLIBSUFF ?= .lib
103
104TOOL_VCC80AMD64_LDFLAGS ?= -nologo -machine:amd64
105TOOL_VCC80AMD64_LDFLAGS.debug ?= -debug
106TOOL_VCC80AMD64_LDFLAGS.release ?=
107
108
109
110## Compile C source.
111# @param $(target) Normalized main target name.
112# @param $(source) Source filename (relative).
113# @param $(obj) Object file name. This shall be (re)created by the compilation.
114# @param $(dep) Dependcy file. This shall be (re)created by the compilation.
115# @param $(flags) Flags.
116# @param $(defs) Definitions. No -D or something.
117# @param $(incs) Includes. No -I or something.
118# @param $(dirdep) Directory creation dependency.
119# @param $(deps) Other dependencies.
120#
121# @param $(outbase) Output basename (full). Use this for list files and such.
122# @param $(objsuff) Object suffix.
123TOOL_VCC80AMD64_COMPILE_C_DEPEND =
124TOOL_VCC80AMD64_COMPILE_C_DEPORD =
125TOOL_VCC80AMD64_COMPILE_C_OUTPUT = $(call TOOL_VCC80AMD64_PDB, $(outbase)-obj,pdb) $(call TOOL_VCC80AMD64_PDB, $(outbase)-obj,idb)
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
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_VCC80AMD64_COMPILE_CXX_DEPEND =
151TOOL_VCC80AMD64_COMPILE_CXX_DEPORD =
152TOOL_VCC80AMD64_COMPILE_CXX_OUTPUT = $(call TOOL_VCC80AMD64_PDB, $(outbase)-obj,pdb) $(call TOOL_VCC80AMD64_PDB, $(outbase)-obj,idb)
153define TOOL_VCC80AMD64_COMPILE_CXX_CMDS
154 $(QUIET)$(TOOL_VCC80AMD64_CXX) -c\
155 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
156 -Fd$(outbase)-obj.pdb \
157 -FD\
158 -Fo$(obj)\
159 $(subst /,\\,$(abspath $(source)))
160 $(QUIET)$(DEP_IDB) -f -s -o $(dep) -t $(obj) $(call TOOL_VCC80AMD64_PDB,$(outbase)-obj,idb)
161endef
162
163
164## Compile resource source.
165# @param $(target) Normalized main target name.
166# @param $(source) Source filename (relative).
167# @param $(obj) Object file name. This shall be (re)created by the compilation.
168# @param $(dep) Dependcy file. This shall be (re)created by the compilation.
169# @param $(flags) Flags.
170# @param $(defs) Definitions. No -D or something.
171# @param $(incs) Includes. No -I or something.
172# @param $(dirdep) Directory creation dependency.
173# @param $(deps) Other dependencies.
174#
175# @param $(outbase) Output basename (full). Use this for list files and such.
176# @param $(objsuff) Object suffix.
177TOOL_VCC80AMD64_COMPILE_RC_DEPEND =
178TOOL_VCC80AMD64_COMPILE_RC_DEPORD =
179TOOL_VCC80AMD64_COMPILE_RC_OUTPUT =
180define TOOL_VCC80AMD64_COMPILE_RC_CMDS
181 $(QUIET)$(TOOL_VCC80AMD64_RC) \
182 $(flags) $(addprefix /i, $(subst /,\\,$(incs))) $(addprefix /d, $(defs))\
183 /fo$(obj)\
184 $(subst /,\\,$(abspath $(source)))
185endef
186
187
188## Link library
189# @param $(target) Normalized main target name.
190# @param $(out) Library name.
191# @param $(objs) Object files to put in the library.
192# @param $(flags) Flags.
193# @param $(dirdep) Directory creation dependency.
194# @param $(deps) Other dependencies.
195# @param $(othersrc) Unhandled sources.
196# @param $(outbase) Output basename (full). Use this for list files and such.
197#
198TOOL_VCC80AMD64_LINK_LIBRARY_DEPEND = $(othersrc)
199TOOL_VCC80AMD64_LINK_LIBRARY_DEPORD =
200TOOL_VCC80AMD64_LINK_LIBRARY_OUTPUT = $(outbase).rsp
201TOOL_VCC80AMD64_LINK_LIBRARY_OUTPUT_MAYBE = $(outbase).lst $(outbase).exp $(outbase).pdb
202define TOOL_VCC80AMD64_LINK_LIBRARY_CMDS
203 $(QUIET)$(APPEND) -n $(outbase).rsp \
204 $(foreach arg,\
205 $(subst /,\\,$(objs) \
206 $(filter-out %.def,$(othersrc))) \
207 $(addprefix /DEF:,$(filter %.def,$(othersrc))) \
208 ,\"$(arg)\")
209 $(QUIET)$(TOOL_VCC80AMD64_AR) $(flags) /OUT:$(out) @$(outbase).rsp
210endef
211
212
213## Link program
214# @param $(target) Normalized main target name.
215# @param $(out) Program name.
216# @param $(objs) Object files to link together.
217# @param $(libs) Libraries to search.
218# @param $(libpath) Library search paths.
219# @param $(flags) Flags.
220# @param $(dirdep) Directory creation dependency.
221# @param $(deps) Other dependencies.
222# @param $(othersrc) Unhandled sources.
223# @param $(custom_pre) Custom step invoked before linking.
224# @param $(custom_post) Custom step invoked after linking.
225# @param $(outbase) Output basename (full). Use this for list files and such.
226#
227TOOL_VCC80AMD64_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
228TOOL_VCC80AMD64_LINK_PROGRAM_DEPORD =
229TOOL_VCC80AMD64_LINK_PROGRAM_OUTPUT = $(outbase).map
230TOOL_VCC80AMD64_LINK_PROGRAM_OUTPUT_MAYBE = $(outbase).lib $(outbase).exp $(outbase).pdb $(outbase).ilk $(out).manifest
231define TOOL_VCC80AMD64_LINK_PROGRAM_CMDS
232 $(QUIET)$(TOOL_VCC80AMD64_LD) $(flags) \
233 /OUT:$(out) \
234 /MAPINFO:EXPORTS /INCREMENTAL:NO \
235 /MAP:$(outbase).map \
236 $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
237 $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
238 $(foreach p,$(libpath), /LIBPATH:$(p)) \
239 $(subst /,\\,$(objs)) \
240 $(subst /,\\,$(libs))
241 $(QUIET)if test -f $(out).manifest; then \
242 $(TOOL_VCC80AMD64_MT) -manifest $(subst /,\\,$(out)).manifest -outputresource:$(subst /,\\,$(out)); \
243 fi
244endef
245
246
247## Link DLL.
248# @param $(target) Normalized main target name.
249# @param $(out) DLL name.
250# @param $(objs) Object files to link together.
251# @param $(libs) Libraries to search.
252# @param $(libpath) Library search paths.
253# @param $(flags) Flags.
254# @param $(dirdep) Directory creation dependency.
255# @param $(deps) Other dependencies.
256# @param $(othersrc) Unhandled sources.
257# @param $(custom_pre) Custom step invoked before linking.
258# @param $(custom_post) Custom step invoked after linking.
259#
260# @param $(outbase) Output basename (full). Use this for list files and such.
261TOOL_VCC80AMD64_LINK_DLL_DEPEND = $(objs) $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
262TOOL_VCC80AMD64_LINK_DLL_DEPORD = $(call DIRDEP,$(PATH_LIB))
263TOOL_VCC80AMD64_LINK_DLL_OUTPUT = $(outbase).map $(outbase).lib $(outbase).exp
264TOOL_VCC80AMD64_LINK_DLL_OUTPUT_MAYBE = $(outbase).pdb $(outbase).ilk $(out).manifest
265define TOOL_VCC80AMD64_LINK_DLL_CMDS
266 $(QUIET)$(TOOL_VCC80AMD64_LD) $(flags) \
267 /OUT:$(out) \
268 /IMPLIB:$(outbase).lib \
269 /MAPINFO:EXPORTS /INCREMENTAL:NO \
270 /MAP:$(outbase).map \
271 /DLL \
272 $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
273 $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
274 $(foreach p,$(libpath), /LIBPATH:$(p)) \
275 $(subst /,\\,$(objs)) \
276 $(subst /,\\,$(libs))
277 $(QUIET)if test -f $(out).manifest; then \
278 $(TOOL_VCC80AMD64_MT) -manifest $(subst /,\\,$(out)).manifest "-outputresource:$(subst /,\\,$(out));#2"; \
279 fi
280ifeq ($(filter %.exp .def,$(othersrc)),)
281 $(QUIET)if test -f $(outbase).exp; then $(CP_EXT) $(outbase).exp $(PATH_LIB)/; fi
282 $(QUIET)if test -f $(outbase).lib; then $(CP_EXT) $(outbase).lib $(PATH_LIB)/; fi
283endif
284$(eval _DIRS += $(PATH_LIB))
285endef
286
287
288## Link system module (windows aka driver, linux aka kernel module)
289# @param $(target) Normalized main target name.
290# @param $(out) System module name.
291# @param $(objs) Object files to link together.
292# @param $(libs) Libraries to search.
293# @param $(libpath) Library search paths.
294# @param $(flags) Flags.
295# @param $(dirdep) Directory creation dependency.
296# @param $(deps) Other dependencies.
297# @param $(othersrc) Unhandled sources.
298# @param $(custom_pre) Custom step invoked before linking.
299# @param $(custom_post) Custom step invoked after linking.
300#
301# @param $(outbase) Output basename (full). Use this for list files and such.
302TOOL_VCC80AMD64_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
303TOOL_VCC80AMD64_LINK_SYSMOD_DEPORD =
304TOOL_VCC80AMD64_LINK_SYSMOD_OUTPUT = $(outbase).map
305TOOL_VCC80AMD64_LINK_SYSMOD_OUTPUT_MAYBE = $(outbase).lib $(outbase).exp $(outbase).pdb $(outbase).ilk $(out).manifest
306define TOOL_VCC80AMD64_LINK_SYSMOD_CMDS
307 $(QUIET)$(TOOL_VCC80AMD64_LD) $(flags) \
308 /OUT:$(out) \
309 /MAPINFO:EXPORTS /INCREMENTAL:NO \
310 /MAP:$(outbase).map \
311 $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
312 $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
313 $(foreach p,$(libpath), /LIBPATH:$(p)) \
314 $(subst /,\\,$(objs)) \
315 $(subst /,\\,$(libs))
316 $(QUIET)if test -f $(out).manifest; then \
317 $(TOOL_VCC80AMD64_MT) -manifest $(subst /,\\,$(out)).manifest "-outputresource:$(subst /,\\,$(out));#2"; \
318 fi
319endef
320
Note: See TracBrowser for help on using the repository browser.