VirtualBox

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

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

link emits correctly cased .pdbs.

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

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette