]>
Commit | Line | Data |
---|---|---|
1 | # | |
2 | # File: makevc.env | |
3 | # Author: Ulrich Leodolter | |
4 | # Created: Wed May 17 08:36:42 1995 | |
5 | # Updated: | |
6 | # | |
7 | # MSVC++ 32-bit makefile include file | |
8 | # | |
9 | !include <ntwin32.mak> | |
10 | ||
11 | # read version numbers | |
12 | !include "version.mak" | |
13 | WXVERSION=$(wxMAJOR_VERSION)$(wxMINOR_VERSION)$(wxRELEASE_NUMBER_IFUNSTABLE) | |
14 | ||
15 | !if "$(RM)" == "" | |
16 | RM= erase | |
17 | !endif | |
18 | ||
19 | # WIN95 means "all systems newer than Win95", i.e. Win9x and NT 4+ | |
20 | WIN95=1 | |
21 | ||
22 | !if "$(WIN95)" == "0" | |
23 | # With 3.50, Win95 will use your existing icons to show smaller ones. | |
24 | # With 4.0, you'll have to follow Win95 procedures for icons or you'll get the | |
25 | # default Windows icon. | |
26 | APPVER=3.50 | |
27 | WINVERSION=-DWINVER=0x0350 # Generic WIN32 | |
28 | !else | |
29 | APPVER=4.0 | |
30 | # This means 'enable Windows 95 features' (in wxWindows and in VC++ 4.0). | |
31 | WINVERSION=-DWINVER=0x0400 | |
32 | !endif | |
33 | ||
34 | # On Alpha machines, change to CPU=ALPHA | |
35 | CPU=i386 | |
36 | ||
37 | # Suffixes | |
38 | OBJSUFF=obj | |
39 | SRCSUFF=cpp | |
40 | ||
41 | WAITFLAG=/w | |
42 | ||
43 | # If you set wxUSE_IOSTREAMH to 0, remove | |
44 | # -Dtry=__try -Dexcept=__except -Dleave=__leave -Dfinally=__finally | |
45 | #WINFLAGS=-c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -D_X86_=1 -DWIN32 -D__WIN32__ $(WINVERSION) -DSTRICT | |
46 | WINFLAGS=-c -W3 -nologo -DWIN32 -D_WINDOWS $(WINVERSION) -DSTRICT | |
47 | WINLINKFLAGS=-nologo -machine:$(CPU) -subsystem:windows,$(APPVER) | |
48 | BASELINKFLAGS=-nologo -machine:$(CPU) -subsystem:console,$(APPVER) | |
49 | WINLIBS=kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib \ | |
50 | shell32.lib oldnames.lib comctl32.lib odbc32.lib ole32.lib oleaut32.lib \ | |
51 | uuid.lib rpcrt4.lib advapi32.lib wsock32.lib \ | |
52 | # libci.lib # libci.lib required for VC++ 4.2 | |
53 | ||
54 | # Set a WXWIN environment variable be the path to your WXWIN directory | |
55 | WXDIR=$(WXWIN) | |
56 | ||
57 | WXSRC=$(WXDIR)\src\msw | |
58 | WXINC=$(WXDIR)\include | |
59 | WXBASESRC=$(WXDIR)\src\common | |
60 | ||
61 | ##################################################################### | |
62 | # These are the possible DLL/non-DLL usages: | |
63 | # | |
64 | # Type _DLL/_WINDLL WXUSINGDLL WXMAKINGDLL Library | |
65 | #-------------------------------------------------------------------- | |
66 | # Normal application - - - wx.lib | |
67 | # | |
68 | # wxWin as DLL Defined - Defined wx$(WXVERSION).lib | |
69 | # | |
70 | # App using wxWin DLL - Defined - wx$(WXVERSION).lib | |
71 | # | |
72 | # App built as one DLL Defined - - wx.lib | |
73 | # | |
74 | ###################################################################### | |
75 | # | |
76 | # Compiling your app: | |
77 | #-------------------- | |
78 | # when compiling an app to use the DLL version of wxWindows | |
79 | # (but not to be a DLL itself), set WXUSINGDLL to 1 in your | |
80 | # makefile just before including ntwxwin.mak. | |
81 | # To compile wxWin _and_ app itself as a DLL, set DLL to 1 | |
82 | # in ntwxwin.mak, and do not set WXUSINGDLL. | |
83 | # | |
84 | # Compiling wxWindows: | |
85 | #--------------------- | |
86 | # Use the dll target to compile wxWindows as DLL; then make 'pch' | |
87 | # to generate a precompiled header for your apps to use. BUG: must compile without | |
88 | # wxExpr (USE_WX_RESOURCES = 0) for this to link properly. Don't know why yet. | |
89 | # Use the dllapp target to compile wxWindows for making a DLL app (not implemented yet) | |
90 | ||
91 | #DLL=0 | |
92 | ||
93 | !if "$(WXUSINGDLL)" == "1" | |
94 | EXTRADLLFLAGS=/DWXUSINGDLL=1 | |
95 | !endif | |
96 | ||
97 | !if "$(WXMAKINGDLL)" == "1" | |
98 | EXTRADLLFLAGS=/DWXMAKINGDLL=1 | |
99 | !endif | |
100 | ||
101 | !if "$(WXMAKINGDLL)" == "0" && "$(DLL)" == "1" | |
102 | EXTRADLLFLAGS= | |
103 | !endif | |
104 | ||
105 | !if "$(NOMAIN)" == "1" | |
106 | EXTRADLLFLAGS=$(EXTRADLLFLAGS) /DNOMAIN | |
107 | !endif | |
108 | ||
109 | !ifndef UNICODE | |
110 | UNICODE=0 | |
111 | !endif | |
112 | ||
113 | !ifndef MSLU | |
114 | MSLU=0 | |
115 | !endif | |
116 | ||
117 | !ifndef FINAL | |
118 | FINAL=0 | |
119 | !endif | |
120 | ||
121 | !ifndef DEBUGINFO | |
122 | !if "$(FINAL)" == "0" | |
123 | DEBUGINFO=1 | |
124 | !else | |
125 | DEBUGINFO=0 | |
126 | !endif | |
127 | !endif | |
128 | ||
129 | !ifndef DLL | |
130 | DLL=0 | |
131 | !endif | |
132 | ||
133 | # Set this to 1 if you don't want to use precompiled headers | |
134 | !ifndef NOPCH | |
135 | NOPCH=0 | |
136 | !endif | |
137 | ||
138 | # This sets 'D' to a suitable directory name: [Base](Debug|Release|Hybrid)[Dll] | |
139 | # for this kind of build, and WXLIBNAME to one of wx(msw|base)[u][d] (static), | |
140 | # wx(msw|base)$(WXVERSION)[u][d] (DLL) | |
141 | ||
142 | !if "$(UNICODE)" == "1" | |
143 | _WXLIB_SUFFIX=u | |
144 | _WXINC_SUFFIX=u | |
145 | _WXDIR_UNICODESUFFIX=Unicode | |
146 | !endif | |
147 | ||
148 | !if "$(WXMAKINGDLL)" == "1" || "$(WXUSINGDLL)" == "1" | |
149 | _WXLIB_VERSION=$(WXVERSION) | |
150 | _WXDIR_DLLSUFFIX=Dll | |
151 | _WXINC_DLLSUFFIX=dll | |
152 | !else | |
153 | _WXLIB_VERSION= | |
154 | _WXDIR_DLLSUFFIX= | |
155 | _WXINC_DLLSUFFIX= | |
156 | !endif | |
157 | ||
158 | !if "$(FINAL)" == "1" | |
159 | _WXDIR_BUILD=Release | |
160 | LIBEXT= | |
161 | # no _WXDIR_SUFFIX | |
162 | !else if "$(FINAL)" == "hybrid" | |
163 | _WXDIR_BUILD=Hybrid | |
164 | LIBEXT=h | |
165 | !else | |
166 | guilibsdll= oldnames.lib kernel32.lib \ | |
167 | ws2_32.lib mswsock.lib advapi32.lib user32.lib \ | |
168 | gdi32.lib comdlg32.lib winspool.lib | |
169 | _WXDIR_BUILD=Debug | |
170 | LIBEXT=d | |
171 | !endif | |
172 | ||
173 | !if "$(wxUSE_GUI)" == "0" | |
174 | _WXDIR_PREFIX=Base | |
175 | _WXLIB_NAME=wxbase | |
176 | _WXINC_BUILD=base | |
177 | !else | |
178 | _WXDIR_PREFIX= | |
179 | _WXLIB_NAME=wxmsw | |
180 | _WXINC_BUILD=msw | |
181 | !endif | |
182 | ||
183 | !if "$(UNICODE)" == "1" | |
184 | UNIFLAGS=-DUNICODE -D_UNICODE -DwxUSE_UNICODE=1 | |
185 | !endif | |
186 | ||
187 | !if "$(wxUSE_GUI)" == "0" | |
188 | UNIFLAGS=$(UNIFLAGS) -DwxUSE_GUI=0 | |
189 | !endif | |
190 | ||
191 | !if "$(WXMAKINGDLL)" == "1" || "$(WXUSINGDLL)" == "1" | |
192 | D=$(D)DLL | |
193 | INCEXT=dll$(INCEXT) | |
194 | !endif | |
195 | ||
196 | D=$(_WXDIR_PREFIX)$(_WXDIR_BUILD)$(_WXDIR_UNICODESUFFIX)$(_WXDIR_DLLSUFFIX) | |
197 | WXLIBNAME=$(_WXLIB_NAME)$(_WXLIB_VERSION)$(_WXLIB_SUFFIX)$(LIBEXT) | |
198 | INCEXT=$(_WXINC_SUFFIX)$(LIBEXT) | |
199 | ||
200 | !if "$(NEW_WXLIBNAME)" != "" | |
201 | WXLIBNAME=$(NEW_WXLIBNAME) | |
202 | !endif | |
203 | ||
204 | #---------------------------------------------------------------------- | |
205 | # MSLU == Microsoft Layer for Unicode | |
206 | # See MSDN or the Platform SDK docs for details | |
207 | !if "$(MSLU)" == "1" | |
208 | MSLU_FLAGS=/nod:kernel32.lib /nod:advapi32.lib /nod:user32.lib /nod:gdi32.lib /nod:shell32.lib /nod:comdlg32.lib /nod:version.lib /nod:mpr.lib /nod:rasapi32.lib /nod:winmm.lib /nod:winspool.lib /nod:vfw32.lib /nod:secur32.lib /nod:oleacc.lib /nod:oledlg.lib /nod:sensapi.lib | |
209 | MSLU_LIBS=$(MSLU_FLAGS) unicows.lib | |
210 | !endif | |
211 | ||
212 | WXLIB=$(WXDIR)\lib\$(WXLIBNAME).lib | |
213 | ||
214 | INC=$(EXTRAINC) -I$(WXDIR)/lib/$(_WXINC_BUILD)$(_WXINC_DLLSUFFIX)$(_WXINC_SUFFIX)$(LIBEXT) -I$(WXINC) -I$(WXDIR)/contrib/include -I$(WXDIR)/src/regex -I$(WXDIR)/src/png -I$(WXDIR)/src/zlib -I$(WXDIR)/src/jpeg -I$(WXDIR)/src/tiff | |
215 | ||
216 | !if "$(WXUSINGDLL)" == "1" || "$(wxUSE_GUI)" == "0" | |
217 | LIBS = $(MSLU_LIBS) $(EXTRALIBS) $(WXLIB) $(WINLIBS) $(WXDIR)\lib\regex$(LIBEXT).lib $(WXDIR)\lib\zlib$(LIBEXT).lib | |
218 | !else | |
219 | LIBS = $(MSLU_LIBS) $(EXTRALIBS) $(WXLIB) $(WINLIBS) $(WXDIR)\lib\regex$(LIBEXT).lib $(WXDIR)\lib\png$(LIBEXT).lib $(WXDIR)\lib\zlib$(LIBEXT).lib $(WXDIR)\lib\jpeg$(LIBEXT).lib $(WXDIR)\lib\tiff$(LIBEXT).lib | |
220 | !endif | |
221 | ||
222 | OPTIONS= | |
223 | ||
224 | !if "$(DEBUGINFO)" == "0" | |
225 | ||
226 | !if "$(FINAL)" == "hybrid" | |
227 | OPT = /Ox /Gy | |
228 | !else | |
229 | # /O1 - smallest code | |
230 | # /O2 - fastest code | |
231 | OPT = /O1 # /O2 # /Od | |
232 | !endif | |
233 | ||
234 | LINK_DEBUG_FLAGS=/RELEASE | |
235 | ||
236 | !else | |
237 | OPT = /Od /Gy /Zi | |
238 | LINK_DEBUG_FLAGS=-debug:full -debugtype:cv | |
239 | !endif | |
240 | ||
241 | !if "$(FINAL)" == "0" | |
242 | # ***N.B.*** to save space/time, comment out /FR to avoid browse info (.sbr files) being generated | |
243 | DEBUG_FLAGS= /D__WXDEBUG__ # /DDEBUG=1 # /FR | |
244 | _CRTFLAG=/MDd | |
245 | ||
246 | !else if "$(FINAL)" == "hybrid" | |
247 | DEBUG_FLAGS= /D__WXDEBUG__ /D__NO_VC_CRTDBG__ | |
248 | _CRTFLAG=/MD | |
249 | ||
250 | !else | |
251 | DEBUG_FLAGS= | |
252 | _CRTFLAG=/MD | |
253 | ||
254 | !endif | |
255 | ||
256 | ||
257 | !if "$(CRTFLAG)" == "" | |
258 | CRTFLAG=$(_CRTFLAG) | |
259 | !endif | |
260 | ||
261 | !if "$(NOPCH)" == "1" | |
262 | ||
263 | PCH= | |
264 | PRECOMP= | |
265 | MAKEPRECOMP= | |
266 | ||
267 | !else | |
268 | ||
269 | !if "$(wxUSE_GUI)" == "0" | |
270 | PCH=wxBase.pch | |
271 | !else | |
272 | PCH=wxWindows.pch | |
273 | !endif | |
274 | ||
275 | PRECOMP=/YuWX/WXPREC.H /Fp$(WXDIR)\$D\$(PCH) /Fd$(WXDIR)\lib\$(WXLIBNAME).pdb | |
276 | MAKEPRECOMP=/YcWX/WXPREC.H | |
277 | ||
278 | !endif | |
279 | ||
280 | !if "$(DLL)" == "0" | |
281 | ||
282 | CPPFLAGS=$(UNIFLAGS) $(WINFLAGS) $(DEBUG_FLAGS) $(PRECOMP) $(EXTRAFLAGS) $(INC) $(OPT) $(EXTRADLLFLAGS) $(CRTFLAG) $(OVERRIDEFLAGS) | |
283 | # If you don't include wxprec.h, use CPPFLAGS2 | |
284 | CPPFLAGS2=$(UNIFLAGS) $(WINFLAGS) $(DEBUG_FLAGS) $(INC) $(EXTRAFLAGS) $(OPT) $(EXTRADLLFLAGS) $(CRTFLAG) $(OVERRIDEFLAGS) | |
285 | ||
286 | !if "$(wxUSE_GUI)" == "0" | |
287 | LINKFLAGS=$(LINK_DEBUG_FLAGS) $(BASELINKFLAGS) | |
288 | !else | |
289 | LINKFLAGS=$(LINK_DEBUG_FLAGS) $(WINLINKFLAGS) | |
290 | !endif | |
291 | ||
292 | DUMMY=dummy | |
293 | ||
294 | !else | |
295 | ||
296 | CPPFLAGS= $(UNIFLAGS) $(WINFLAGS) $(DEBUG_FLAGS) $(PRECOMP) $(EXTRAFLAGS) $(INC) $(OPT) /D_DLL $(CRTFLAG) $(EXTRADLLFLAGS) /D_WINDLL | |
297 | CPPFLAGS2=$(UNIFLAGS) $(WINFLAGS) $(DEBUG_FLAGS) $(EXTRAFLAGS) $(INC) $(OPT) /D_DLL $(CRTFLAG) $(EXTRADLLFLAGS) /D_WINDLL | |
298 | ||
299 | !if "$(wxUSE_GUI)" == "0" | |
300 | LINKFLAGS=$(LINK_DEBUG_FLAGS) $(BASELINKFLAGS) -dll | |
301 | !else | |
302 | LINKFLAGS=$(LINK_DEBUG_FLAGS) $(WINLINKFLAGS) -dll | |
303 | !endif | |
304 | ||
305 | !if "$(WXMAKINGDLL)" == "1" | |
306 | DUMMY=dummydll | |
307 | !else | |
308 | DUMMY=dummy | |
309 | !endif | |
310 | ||
311 | !endif | |
312 | ||
313 | DUMMYOBJ=$(WXDIR)\$D\$(DUMMY).obj | |
314 | ||
315 | .c.obj: | |
316 | cl @<< | |
317 | $(CPPFLAGS2) /Fo$@ /c $< | |
318 | << | |
319 | ||
320 | .cpp.obj: | |
321 | cl @<< | |
322 | $(CPPFLAGS2) /Fo$@ /c $< | |
323 | << | |
324 | ||
325 | #use CPPFLAGS2 so as not to use precompiled headers | |
326 | {}.c{$D}.obj: | |
327 | cl @<< | |
328 | $(CPPFLAGS2) /Fo$@ /c $< | |
329 | << | |
330 | ||
331 | {}.cpp{$D}.obj: | |
332 | cl @<< | |
333 | $(CPPFLAGS) /Fo$@ /c /Tp $< | |
334 | << | |
335 |