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