]>
Commit | Line | Data |
---|---|---|
227869da | 1 | # |
af111fc3 | 2 | # File: makevc.env |
227869da JS |
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 | ||
34b6a45a VZ |
11 | # read version numbers |
12 | !include "version.mak" | |
13 | WXVERSION=$(wxMAJOR_VERSION)$(wxMINOR_VERSION)$(wxRELEASE_NUMBER_IFUNSTABLE) | |
14 | ||
0580ae4b GT |
15 | !if "$(RM)" == "" |
16 | RM= erase | |
17 | !endif | |
18 | ||
2b5f62a0 | 19 | # WIN95 means "all systems newer than Win95", i.e. Win9x and NT 4+ |
227869da JS |
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 | |
2b5f62a0 | 29 | APPVER=4.0 |
227869da | 30 | # This means 'enable Windows 95 features' (in wxWindows and in VC++ 4.0). |
fb5230de | 31 | WINVERSION=-DWINVER=0x0400 |
227869da JS |
32 | !endif |
33 | ||
34 | # On Alpha machines, change to CPU=ALPHA | |
35 | CPU=i386 | |
36 | ||
37 | # Suffixes | |
38 | OBJSUFF=obj | |
39 | SRCSUFF=cpp | |
40 | ||
e12f91dc RD |
41 | WAITFLAG=/w |
42 | ||
fb5230de MB |
43 | # If you set wxUSE_IOSTREAMH to 0, remove |
44 | # -Dtry=__try -Dexcept=__except -Dleave=__leave -Dfinally=__finally | |
4de85398 | 45 | #WINFLAGS=-c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -D_X86_=1 -DWIN32 -D__WIN32__ $(WINVERSION) -DSTRICT |
fb5230de MB |
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 | |
227869da | 53 | |
b4d1ebf0 RD |
54 | # Set a WXWIN environment variable be the path to your WXWIN directory |
55 | WXDIR=$(WXWIN) | |
227869da JS |
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 | # | |
cb1b6606 | 68 | # wxWin as DLL Defined - Defined wx$(WXVERSION).lib |
227869da | 69 | # |
cb1b6606 | 70 | # App using wxWin DLL - Defined - wx$(WXVERSION).lib |
227869da JS |
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 | ||
227869da JS |
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 | ||
b3bd664a MB |
109 | !ifndef UNICODE |
110 | UNICODE=0 | |
111 | !endif | |
112 | ||
2417bf69 RD |
113 | !ifndef MSLU |
114 | MSLU=0 | |
115 | !endif | |
116 | ||
227869da JS |
117 | !ifndef FINAL |
118 | FINAL=0 | |
fb5230de MB |
119 | !endif |
120 | ||
121 | !ifndef DEBUGINFO | |
122 | !if "$(FINAL)" == "0" | |
123 | DEBUGINFO=1 | |
124 | !else | |
125 | DEBUGINFO=0 | |
126 | !endif | |
227869da JS |
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 | ||
fb5230de MB |
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) | |
ca5c8b2d | 141 | |
fb5230de MB |
142 | !if "$(UNICODE)" == "1" |
143 | _WXLIB_SUFFIX=u | |
144 | _WXINC_SUFFIX=u | |
145 | _WXDIR_UNICODESUFFIX=Unicode | |
a4fe6524 RD |
146 | !endif |
147 | ||
fb5230de MB |
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= | |
b3bd664a MB |
156 | !endif |
157 | ||
ca5c8b2d | 158 | !if "$(FINAL)" == "1" |
fb5230de MB |
159 | _WXDIR_BUILD=Release |
160 | LIBEXT= | |
161 | # no _WXDIR_SUFFIX | |
f641dada | 162 | !else if "$(FINAL)" == "hybrid" |
fb5230de | 163 | _WXDIR_BUILD=Hybrid |
f641dada | 164 | LIBEXT=h |
ca5c8b2d | 165 | !else |
f6bcfd97 | 166 | guilibsdll= oldnames.lib kernel32.lib \ |
fbdcff4a JS |
167 | ws2_32.lib mswsock.lib advapi32.lib user32.lib \ |
168 | gdi32.lib comdlg32.lib winspool.lib | |
fb5230de | 169 | _WXDIR_BUILD=Debug |
5fa399c9 | 170 | LIBEXT=d |
ca5c8b2d JS |
171 | !endif |
172 | ||
0548ca8d | 173 | !if "$(wxUSE_GUI)" == "0" |
fb5230de MB |
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 | |
b3bd664a MB |
181 | !endif |
182 | ||
183 | !if "$(UNICODE)" == "1" | |
fb5230de | 184 | UNIFLAGS=-DUNICODE -D_UNICODE -DwxUSE_UNICODE=1 |
0548ca8d GT |
185 | !endif |
186 | ||
fb5230de MB |
187 | !if "$(wxUSE_GUI)" == "0" |
188 | UNIFLAGS=$(UNIFLAGS) -DwxUSE_GUI=0 | |
189 | !endif | |
b3bd664a | 190 | |
ca5c8b2d JS |
191 | !if "$(WXMAKINGDLL)" == "1" || "$(WXUSINGDLL)" == "1" |
192 | D=$(D)DLL | |
b3bd664a | 193 | INCEXT=dll$(INCEXT) |
ca5c8b2d JS |
194 | !endif |
195 | ||
fb5230de MB |
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 | ||
2417bf69 RD |
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 | ||
ca5c8b2d JS |
212 | WXLIB=$(WXDIR)\lib\$(WXLIBNAME).lib |
213 | ||
fb5230de | 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 |
4567f2b2 | 215 | |
0548ca8d | 216 | !if "$(WXUSINGDLL)" == "1" || "$(wxUSE_GUI)" == "0" |
2417bf69 | 217 | LIBS = $(MSLU_LIBS) $(EXTRALIBS) $(WXLIB) $(WINLIBS) $(WXDIR)\lib\regex$(LIBEXT).lib $(WXDIR)\lib\zlib$(LIBEXT).lib |
4567f2b2 | 218 | !else |
2417bf69 | 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 |
4567f2b2 | 220 | !endif |
ca5c8b2d | 221 | |
227869da JS |
222 | OPTIONS= |
223 | ||
fb5230de MB |
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 | ||
227869da | 241 | !if "$(FINAL)" == "0" |
227869da | 242 | # ***N.B.*** to save space/time, comment out /FR to avoid browse info (.sbr files) being generated |
fb5230de | 243 | DEBUG_FLAGS= /D__WXDEBUG__ # /DDEBUG=1 # /FR |
7bf54362 | 244 | _CRTFLAG=/MDd |
f641dada RD |
245 | |
246 | !else if "$(FINAL)" == "hybrid" | |
d440a0e7 | 247 | DEBUG_FLAGS= /D__WXDEBUG__ /D__NO_VC_CRTDBG__ |
f641dada RD |
248 | _CRTFLAG=/MD |
249 | ||
227869da | 250 | !else |
227869da | 251 | DEBUG_FLAGS= |
7bf54362 | 252 | _CRTFLAG=/MD |
fb5230de | 253 | |
7bf54362 RD |
254 | !endif |
255 | ||
f641dada | 256 | |
7bf54362 RD |
257 | !if "$(CRTFLAG)" == "" |
258 | CRTFLAG=$(_CRTFLAG) | |
227869da JS |
259 | !endif |
260 | ||
227869da | 261 | !if "$(NOPCH)" == "1" |
fb5230de | 262 | |
227869da JS |
263 | PCH= |
264 | PRECOMP= | |
265 | MAKEPRECOMP= | |
fb5230de | 266 | |
227869da | 267 | !else |
014e19de | 268 | |
0548ca8d GT |
269 | !if "$(wxUSE_GUI)" == "0" |
270 | PCH=wxBase.pch | |
271 | !else | |
3a7bfa06 | 272 | PCH=wxWindows.pch |
0548ca8d | 273 | !endif |
014e19de | 274 | |
fb5230de | 275 | PRECOMP=/YuWX/WXPREC.H /Fp$(WXDIR)\$D\$(PCH) /Fd$(WXDIR)\lib\$(WXLIBNAME).pdb |
227869da | 276 | MAKEPRECOMP=/YcWX/WXPREC.H |
227869da | 277 | |
fb5230de | 278 | !endif |
014e19de | 279 | |
fb5230de | 280 | !if "$(DLL)" == "0" |
0548ca8d | 281 | |
fb5230de | 282 | CPPFLAGS=$(UNIFLAGS) $(WINFLAGS) $(DEBUG_FLAGS) $(PRECOMP) $(EXTRAFLAGS) $(INC) $(OPT) $(EXTRADLLFLAGS) $(CRTFLAG) /GX- $(OVERRIDEFLAGS) |
227869da | 283 | # If you don't include wxprec.h, use CPPFLAGS2 |
fb5230de MB |
284 | CPPFLAGS2=$(UNIFLAGS) $(WINFLAGS) $(DEBUG_FLAGS) $(INC) $(EXTRAFLAGS) $(OPT) $(EXTRADLLFLAGS) $(CRTFLAG) /GX- $(OVERRIDEFLAGS) |
285 | ||
0548ca8d GT |
286 | !if "$(wxUSE_GUI)" == "0" |
287 | LINKFLAGS=$(LINK_DEBUG_FLAGS) $(BASELINKFLAGS) | |
288 | !else | |
fb5230de | 289 | LINKFLAGS=$(LINK_DEBUG_FLAGS) $(WINLINKFLAGS) |
0548ca8d | 290 | !endif |
fb5230de | 291 | |
227869da JS |
292 | DUMMY=dummy |
293 | ||
294 | !else | |
295 | ||
fb5230de MB |
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 | ||
227869da | 305 | !if "$(WXMAKINGDLL)" == "1" |
227869da JS |
306 | DUMMY=dummydll |
307 | !else | |
227869da JS |
308 | DUMMY=dummy |
309 | !endif | |
310 | ||
227869da JS |
311 | !endif |
312 | ||
3a7bfa06 | 313 | DUMMYOBJ=$(WXDIR)\$D\$(DUMMY).obj |
227869da | 314 | |
e9c4b1a2 JS |
315 | .c.obj: |
316 | cl @<< | |
317 | $(CPPFLAGS2) /Fo$@ /c $< | |
318 | << | |
319 | ||
320 | .cpp.obj: | |
321 | cl @<< | |
322 | $(CPPFLAGS2) /Fo$@ /c $< | |
323 | << | |
324 | ||
0580ae4b GT |
325 | #use CPPFLAGS2 so as not to use precompiled headers |
326 | {}.c{$D}.obj: | |
327 | cl @<< | |
328 | $(CPPFLAGS2) /Fo$@ /c $< | |
329 | << | |
330 | ||
df801fc6 JS |
331 | {}.cpp{$D}.obj: |
332 | cl @<< | |
333 | $(CPPFLAGS) /Fo$@ /c /Tp $< | |
334 | << | |
335 |