source: trunk/kBuild/tools/VCC70.kmk@ 183

Last change on this file since 183 was 181, checked in by bird, 21 years ago

configured the profile build type.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 10.5 KB
Line 
1# $Id: VCC70.kmk 181 2004-10-15 09:09:36Z bird $
2## @file
3#
4# kBuild Tool Config - Visual C++ 7.0 (aka Visual .NET)
5#
6# Copyright (c) 2004 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_VCC70 := Visual C++ 7.0
29PATH_TOOL_VCC70 ?= $(PATH_DEV)/x86.win32/vcc70
30PATH_TOOL_VCC70_LIB ?= $(PATH_DEV)/x86.win32/vcc70/lib
31
32TOOL_VCC70_CC := $(EXEC_X86_WIN32) $(PATH_TOOL_VCC70)/bin/cl.exe
33TOOL_VCC70_COBJSUFF := .obj
34TOOL_VCC70_CFLAGS := -TC -c -nologo
35TOOL_VCC70_CFLAGS.debug := -Od -Zi
36TOOL_VCC70_CFLAGS.release := -O2
37TOOL_VCC70_CFLAGS.profile := -O2
38TOOL_VCC70_CINCS := $(PATH_TOOL_VCC70)/include
39TOOL_VCC70_CDEFS :=
40
41TOOL_VCC70_CXX := $(EXEC_X86_WIN32) $(PATH_TOOL_VCC70)/bin/cl.exe
42TOOL_VCC70_CXXOBJSUFF := .obj
43TOOL_VCC70_CXXFLAGS := -TP -c -nologo
44TOOL_VCC70_CXXFLAGS.debug := -Od -Zi
45TOOL_VCC70_CXXFLAGS.release := -O2
46TOOL_VCC70_CXXFLAGS.profile := -O2
47TOOL_VCC70_CXXINCS := $(PATH_TOOL_VCC70)/include
48TOOL_VCC70_CXXDEFS :=
49
50TOOL_VCC70_AS := $(EXEC_X86_WIN32) $(PATH_TOOL_VCC70)/bin/ml.exe
51TOOL_VCC70_ASOBJSUFF := .obj
52
53TOOL_VCC70_AR := $(EXEC_X86_WIN32) $(PATH_TOOL_VCC70)/bin/lib.exe
54TOOL_VCC70_ARFLAGS := -nologo
55TOOL_VCC70_ARLIBSUFF := .lib
56
57TOOL_VCC70_LD := $(EXEC_X86_WIN32) $(PATH_TOOL_VCC70)/bin/link.exe
58TOOL_VCC70_LDFLAGS := -nologo
59TOOL_VCC70_LDFLAGS.debug := -debug
60TOOL_VCC70_LDFLAGS.release :=
61
62
63## Compile C source.
64# @param $(target) Normalized main target name.
65# @param $(source) Source filename (relative).
66# @param $(obj) Object file name. This shall be (re)created by the compilation.
67# @param $(dep) Dependcy file. This shall be (re)created by the compilation.
68# @param $(flags) Flags.
69# @param $(defs) Definitions. No -D or something.
70# @param $(incs) Includes. No -I or something.
71# @param $(dirdep) Directory creation dependency.
72#
73# @param $(outbase) Output basename (full). Use this for list files and such.
74# @param $(objsuff) Object suffix.
75define TOOL_VCC70_COMPILE_C
76#$ (warning dbg: TOOL_VCC70_COMPILE_C: target=$(target) source=$(source) obj=$(obj) dep=$(dep) flags=$(flags) defs=$(defs) incs=$(incs) dirdep=$(dirdep) outbase=$(outbase) objsuff=$(objsuff))
77$(obj): $(dirdep) $(source)
78 $(call MSG_L2,Compiling $$@ using VCC70)
79 $(TOOL_VCC70_CC) -c\
80 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
81 -Fd$(outbase).pdb \
82 -Fo$(obj)\
83 $(subst /,\\,$(call ABSPATH,$(source)))
84 $(DEP_CCXX) -q -f $(dep) -o $(obj) \
85 -D_M_IX86=500 -D_WIN32 -D_MSC_VER=1300 -D_MSC_EXTENSIONS=1 -D__COUNTER__=42 \
86 -D__DATE__=\"0000.00.00\" -D__FILE__=\"filename.c\" -D__LINE__=42 -D__TIME__=\"00.00.00\" -D__TIMESTAMP__=\"lotsofnumbers\" \
87 $(addprefix -D, $(defs)) $(addprefix -I, $(incs)) \
88 $(call ABSPATH,$(source))
89_OUT_FILES += $(outbase).pdb
90
91endef
92
93
94## Compile C++ source.
95# @param $(target) Normalized main target name.
96# @param $(source) Source filename (relative).
97# @param $(obj) Object file name. This shall be (re)created by the compilation.
98# @param $(dep) Dependcy file. This shall be (re)created by the compilation.
99# @param $(flags) Flags.
100# @param $(defs) Definitions. No -D or something.
101# @param $(incs) Includes. No -I or something.
102# @param $(dirdep) Directory creation dependency.
103#
104# @param $(outbase) Output basename (full). Use this for list files and such.
105# @param $(objsuff) Object suffix.
106define TOOL_VCC70_COMPILE_CXX
107#$ (warning dbg: TOOL_VCC70_COMPILE_CXX: target=$(target) source=$(source) obj=$(obj) dep=$(dep) flags=$(flags) defs=$(defs) incs=$(incs) dirdep=$(dirdep) outbase=$(outbase) objsuff=$(objsuff))
108$(obj): $(dirdep) $(source)
109 $(call MSG_L2,Compiling $$@ using VCC70)
110 $(TOOL_VCC70_CXX) -c\
111 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
112 -Fd$(outbase).pdb \
113 -Fo$(obj)\
114 $(subst /,\\,$(call ABSPATH,$(source)))
115 $(DEP_CCXX) -q -f $(dep) -o $(obj) \
116 -D__cplusplus \
117 -D_M_IX86=500 -D_WIN32 -D_MSC_VER=1300 -D_MSC_EXTENSIONS=1 -D__COUNTER__=42 \
118 -D__DATE__=\"0000.00.00\" -D__FILE__=\"filename.c\" -D__LINE__=42 -D__TIME__=\"00.00.00\" -D__TIMESTAMP__=\"lotsofnumbers\" \
119 $(addprefix -D, $(defs)) $(addprefix -I, $(incs)) \
120 $(call ABSPATH,$(source))
121_OUT_FILES += $(outbase).pdb
122
123endef
124
125
126## Link library
127# @param $(target) Normalized main target name.
128# @param $(lib) Library name.
129# @param $(objs) Object files to put in the library.
130# @param $(flags) Flags.
131# @param $(dirdep) Directory creation dependency.
132# @param $(deps) Other dependencies.
133# @param $(othersrc) Unhandled sources.
134#
135# @param $(outbase) Output basename (full). Use this for list files and such.
136define TOOL_VCC70_LINK_LIBRARY
137#$ (warning dbg: TOOL_VCC70_LINK_LIBRARY: target=$(target) lib=$(lib) objs=$(objs) deps=$(deps) flags=$(flags) dirdep=$(dirdep) outbase=$(outbase))
138$(lib): $(dirdep) $(objs) $(deps) $(othersrc)
139 $(call MSG_L1,Creating Library $$@)
140 $(RM) -f $$@
141 $(TOOL_VCC70_AR) $(flags) /OUT:$(lib) $(subst /,\\,$(objs)) \
142 $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def))
143
144endef
145
146
147## Link program
148# @param $(target) Normalized main target name.
149# @param $(exe) Program name.
150# @param $(objs) Object files to link together.
151# @param $(libs) Libraries to search.
152# @param $(libpath) Library search paths.
153# @param $(flags) Flags.
154# @param $(dirdep) Directory creation dependency.
155# @param $(deps) Other dependencies.
156# @param $(othersrc) Unhandled sources.
157# @param $(custom_pre) Custom step invoked before linking.
158# @param $(custom_post) Custom step invoked after linking.
159#
160# @param $(outbase) Output basename (full). Use this for list files and such.
161define TOOL_VCC70_LINK_PROGRAM
162#$ (warning dbg: TOOL_VCC70_LINK_PROGRAM: target=$(target) exe=$(exe) objs=$(objs) libs=$(libs) deps=$(deps) flags=$(flags) dirdep=$(dirdep) othersrc=$(othersrc) outbase=$(outbase))
163$(exe): $(dirdep) $(objs) $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(deps)
164 $(call MSG_L1,Creating Program $$@)
165ifneq ($(custom_pre),)
166 $(eval $(custom_pre))
167endif
168 $(TOOL_VCC70_LD) $(flags) \
169 /OUT:$(exe) \
170 /MAPINFO:EXPORTS /MAPINFO:LINES \
171 /MAP:$(outbase).map \
172 $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
173 $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
174 $(foreach p,$(libpath), /LIBPATH:$(p)) \
175 $(subst /,\\,$(objs)) \
176 $(subst /,\\,$(libs))
177ifneq ($(custom_post),)
178 $(eval $(custom_post))
179endif
180_OUT_FILES += $(outbase).map $(outbase).pdb $(outbase).ilk
181
182endef
183
184
185## Link system module (windows aka driver, linux aka kernel module)
186# @param $(target) Normalized main target name.
187# @param $(sys) System module name.
188# @param $(objs) Object files to link together.
189# @param $(libs) Libraries to search.
190# @param $(libpath) Library search paths.
191# @param $(flags) Flags.
192# @param $(dirdep) Directory creation dependency.
193# @param $(deps) Other dependencies.
194# @param $(othersrc) Unhandled sources.
195# @param $(custom_pre) Custom step invoked before linking.
196# @param $(custom_post) Custom step invoked after linking.
197#
198# @param $(outbase) Output basename (full). Use this for list files and such.
199define TOOL_VCC70_LINK_SYSMOD
200#$ (warning dbg: TOOL_VCC70_LINK_SYSMOD: target=$(target) sys=$(sys) objs=$(objs) libs=$(libs) deps=$(deps) flags=$(flags) dirdep=$(dirdep) othersrc=$(othersrc) outbase=$(outbase))
201$(sys): $(dirdep) $(objs) $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(deps)
202 $(call MSG_L1,Creating Program $$@)
203ifneq ($(custom_pre),)
204 $(eval $(custom_pre))
205endif
206 $(TOOL_VCC70_LD) $(flags) \
207 /OUT:$(sys) \
208 /MAPINFO:EXPORTS /MAPINFO:LINES \
209 /MAP:$(outbase).map \
210 $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
211 $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
212 $(foreach p,$(libpath), /LIBPATH:$(p)) \
213 $(subst /,\\,$(objs)) \
214 $(subst /,\\,$(libs))
215ifneq ($(custom_post),)
216 $(eval $(custom_post))
217endif
218_OUT_FILES += $(outbase).map $(outbase).pdb $(outbase).ilk
219
220endef
221
222
223## Link system module (windows aka driver, linux aka kernel module)
224# @param $(target) Normalized main target name.
225# @param $(dll) System module name.
226# @param $(objs) Object files to link together.
227# @param $(libs) Libraries to search.
228# @param $(libpath) Library search paths.
229# @param $(flags) Flags.
230# @param $(dirdep) Directory creation dependency.
231# @param $(deps) Other dependencies.
232# @param $(othersrc) Unhandled sources.
233# @param $(custom_pre) Custom step invoked before linking.
234# @param $(custom_post) Custom step invoked after linking.
235#
236# @param $(outbase) Output basename (full). Use this for list files and such.
237define TOOL_VCC70_LINK_DLL
238#$ (warning dbg: TOOL_VCC70_LINK_DLL: target=$(target) dll=$(dll) objs=$(objs) libs=$(libs) deps=$(deps) flags=$(flags) dirdep=$(dirdep) othersrc=$(othersrc) outbase=$(outbase))
239$(dll): $(dirdep) $(call DIRDEP,$(PATH_LIB)) $(objs) $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(deps)
240 $(call MSG_L1,Creating Program $$@)
241ifneq ($(custom_pre),)
242 $(eval $(custom_pre))
243endif
244 $(TOOL_VCC70_LD) $(flags) \
245 /OUT:$(dll) \
246 /IMPLIB:$(outbase).lib \
247 /MAPINFO:EXPORTS /MAPINFO:LINES \
248 /MAP:$(outbase).map \
249 /DLL \
250 $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
251 $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
252 $(foreach p,$(libpath), /LIBPATH:$(p)) \
253 $(subst /,\\,$(objs)) \
254 $(subst /,\\,$(libs))
255ifeq ($(filter %.exp .def,$(othersrc)),)
256 if test -f $(outbase).exp; then $(CP) $(outbase).exp $(PATH_LIB)/; fi
257 if test -f $(outbase).lib; then $(CP) $(outbase).lib $(PATH_LIB)/; fi
258endif
259ifneq ($(custom_post),)
260 $(eval $(custom_post))
261endif
262_OUT_FILES += $(outbase).map $(outbase).lib $(outbase).exp $(outbase).pdb $(outbase).ilk
263
264endef
265
Note: See TracBrowser for help on using the repository browser.