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

Last change on this file since 3044 was 2726, checked in by bird, 11 years ago

s/PATH_DEVTOOLS/KBUILD_DEVTOOLS/g, (c) & e-mail updates.

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