]>
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 JS |
30 | # This means 'enable Windows 95 features' (in wxWindows and in VC++ 4.0). |
31 | WINVERSION=-DWINVER=0x0400 /D__WIN95__ | |
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 | ||
227869da | 43 | # If you set wxUSE_IOSTREAMH to 0, remove -Dtry=__try -Dexcept=__except -Dleave=__leave -Dfinally=__finally |
4de85398 GT |
44 | #WINFLAGS=-c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -D_X86_=1 -DWIN32 -D__WIN32__ $(WINVERSION) -DSTRICT |
45 | WINFLAGS=-c -W3 -nologo -DWIN32 -D__WIN32__ -D_WINDOWS $(WINVERSION) -DSTRICT | |
227869da | 46 | WINLINKFLAGS=/INCREMENTAL:NO /NOLOGO -machine:$(CPU) -subsystem:windows,$(APPVER) |
0548ca8d | 47 | BASELINKFLAGS=/INCREMENTAL:NO /NOLOGO -machine:$(CPU) -subsystem:console,$(APPVER) |
227869da | 48 | WINLIBS=kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib oldnames.lib\ |
841346f0 | 49 | comctl32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib # libci.lib # libci.lib required for VC++ 4.2 |
227869da | 50 | |
b4d1ebf0 RD |
51 | # Set a WXWIN environment variable be the path to your WXWIN directory |
52 | WXDIR=$(WXWIN) | |
227869da JS |
53 | |
54 | WXSRC=$(WXDIR)\src\msw | |
55 | WXINC=$(WXDIR)\include | |
56 | WXBASESRC=$(WXDIR)\src\common | |
57 | ||
58 | ##################################################################### | |
59 | # These are the possible DLL/non-DLL usages: | |
60 | # | |
61 | # Type _DLL/_WINDLL WXUSINGDLL WXMAKINGDLL Library | |
62 | #-------------------------------------------------------------------- | |
63 | # Normal application - - - wx.lib | |
64 | # | |
cb1b6606 | 65 | # wxWin as DLL Defined - Defined wx$(WXVERSION).lib |
227869da | 66 | # |
cb1b6606 | 67 | # App using wxWin DLL - Defined - wx$(WXVERSION).lib |
227869da JS |
68 | # |
69 | # App built as one DLL Defined - - wx.lib | |
70 | # | |
71 | ###################################################################### | |
72 | # | |
73 | # Compiling your app: | |
74 | #-------------------- | |
75 | # when compiling an app to use the DLL version of wxWindows | |
76 | # (but not to be a DLL itself), set WXUSINGDLL to 1 in your | |
77 | # makefile just before including ntwxwin.mak. | |
78 | # To compile wxWin _and_ app itself as a DLL, set DLL to 1 | |
79 | # in ntwxwin.mak, and do not set WXUSINGDLL. | |
80 | # | |
81 | # Compiling wxWindows: | |
82 | #--------------------- | |
83 | # Use the dll target to compile wxWindows as DLL; then make 'pch' | |
84 | # to generate a precompiled header for your apps to use. BUG: must compile without | |
85 | # wxExpr (USE_WX_RESOURCES = 0) for this to link properly. Don't know why yet. | |
86 | # Use the dllapp target to compile wxWindows for making a DLL app (not implemented yet) | |
87 | ||
88 | #DLL=0 | |
89 | ||
227869da JS |
90 | !if "$(WXUSINGDLL)" == "1" |
91 | EXTRADLLFLAGS=/DWXUSINGDLL=1 | |
92 | !endif | |
93 | ||
94 | !if "$(WXMAKINGDLL)" == "1" | |
95 | EXTRADLLFLAGS=/DWXMAKINGDLL=1 | |
96 | !endif | |
97 | ||
98 | !if "$(WXMAKINGDLL)" == "0" && "$(DLL)" == "1" | |
99 | EXTRADLLFLAGS= | |
100 | !endif | |
101 | ||
102 | !if "$(NOMAIN)" == "1" | |
103 | EXTRADLLFLAGS=$(EXTRADLLFLAGS) /DNOMAIN | |
104 | !endif | |
105 | ||
b3bd664a MB |
106 | !ifndef UNICODE |
107 | UNICODE=0 | |
108 | !endif | |
109 | ||
2417bf69 RD |
110 | !ifndef MSLU |
111 | MSLU=0 | |
112 | !endif | |
113 | ||
227869da JS |
114 | !ifndef FINAL |
115 | FINAL=0 | |
116 | DEBUG=1 | |
117 | !endif | |
118 | ||
119 | !ifndef DLL | |
120 | DLL=0 | |
121 | !endif | |
122 | ||
123 | # Set this to 1 if you don't want to use precompiled headers | |
124 | !ifndef NOPCH | |
125 | NOPCH=0 | |
126 | !endif | |
127 | ||
ca5c8b2d | 128 | # This sets 'D' to a suitable directory name |
5fa399c9 JS |
129 | # for this kind of build, and WXLIBNAME to one of wx (static release), wxd (static debug), |
130 | # wx$(WXVERSION) (DLL release), wx$(WXVERSION)d (DLL debug) | |
ca5c8b2d JS |
131 | |
132 | !if "$(WXMAKINGDLL)" == "1" || "$(WXUSINGDLL)" == "1" | |
b3bd664a | 133 | WXLIBNAME=wxmsw$(WXVERSION) |
ca5c8b2d | 134 | !else |
b3bd664a | 135 | WXLIBNAME=wxmsw |
ca5c8b2d JS |
136 | !endif |
137 | ||
a4fe6524 RD |
138 | !if "$(NEW_WXLIBNAME)" != "" |
139 | WXLIBNAME=$(NEW_WXLIBNAME) | |
140 | !endif | |
141 | ||
b3bd664a MB |
142 | !if "$(UNICODE)" == "1" |
143 | UNIEXT=u | |
144 | WXLIBNAME=$(WXLIBNAME)$(UNIEXT) | |
145 | !endif | |
146 | ||
ca5c8b2d JS |
147 | !if "$(FINAL)" == "1" |
148 | D=Release | |
f641dada RD |
149 | !else if "$(FINAL)" == "hybrid" |
150 | D=Hybrid | |
151 | LIBEXT=h | |
152 | WXLIBNAME=$(WXLIBNAME)$(LIBEXT) | |
ca5c8b2d | 153 | !else |
f6bcfd97 | 154 | guilibsdll= oldnames.lib kernel32.lib \ |
fbdcff4a JS |
155 | ws2_32.lib mswsock.lib advapi32.lib user32.lib \ |
156 | gdi32.lib comdlg32.lib winspool.lib | |
ca5c8b2d | 157 | D=Debug |
5fa399c9 | 158 | LIBEXT=d |
cb1b6606 | 159 | WXLIBNAME=$(WXLIBNAME)$(LIBEXT) |
ca5c8b2d JS |
160 | !endif |
161 | ||
0548ca8d GT |
162 | !if "$(wxUSE_GUI)" == "0" |
163 | WXLIBNAME=wxBase | |
164 | D=Base$(D) | |
b3bd664a MB |
165 | WXLIBNAME=$(WXLIBNAME)$(UNIEXT)$(LIBEXT) |
166 | !endif | |
167 | ||
168 | !if "$(UNICODE)" == "1" | |
169 | D=$(D)Unicode | |
0548ca8d GT |
170 | !endif |
171 | ||
b3bd664a MB |
172 | INCEXT=$(UNIEXT)$(LIBEXT) |
173 | ||
ca5c8b2d JS |
174 | !if "$(WXMAKINGDLL)" == "1" || "$(WXUSINGDLL)" == "1" |
175 | D=$(D)DLL | |
b3bd664a | 176 | INCEXT=dll$(INCEXT) |
ca5c8b2d JS |
177 | !endif |
178 | ||
2417bf69 RD |
179 | #---------------------------------------------------------------------- |
180 | # MSLU == Microsoft Layer for Unicode | |
181 | # See MSDN or the Platform SDK docs for details | |
182 | !if "$(MSLU)" == "1" | |
183 | 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 | |
184 | MSLU_LIBS=$(MSLU_FLAGS) unicows.lib | |
185 | !endif | |
186 | ||
ca5c8b2d JS |
187 | WXLIB=$(WXDIR)\lib\$(WXLIBNAME).lib |
188 | ||
b311dc08 GT |
189 | !if "$(wxUSE_GUI)" == "0" |
190 | INCTEMP=$(EXTRAINC) -I$(WXDIR)/lib/base$(INCEXT) | |
191 | !else | |
192 | INCTEMP=$(EXTRAINC) -I$(WXDIR)/lib/msw$(INCEXT) | |
193 | !endif | |
194 | ||
195 | INC=$(INCTEMP) -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 | 196 | |
0548ca8d | 197 | !if "$(WXUSINGDLL)" == "1" || "$(wxUSE_GUI)" == "0" |
2417bf69 | 198 | LIBS = $(MSLU_LIBS) $(EXTRALIBS) $(WXLIB) $(WINLIBS) $(WXDIR)\lib\regex$(LIBEXT).lib $(WXDIR)\lib\zlib$(LIBEXT).lib |
4567f2b2 | 199 | !else |
2417bf69 | 200 | 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 | 201 | !endif |
ca5c8b2d | 202 | |
227869da JS |
203 | MAKEPRECOMP=/YcWX/WXPREC.H |
204 | OPTIONS= | |
205 | ||
206 | !if "$(FINAL)" == "0" | |
207 | OPT = /Od /Gy | |
208 | # ***N.B.*** to save space/time, comment out /FR to avoid browse info (.sbr files) being generated | |
209 | DEBUG_FLAGS= /Zi /D__WXDEBUG__ # /DDEBUG=1 # /FR | |
210 | LINK_DEBUG_FLAGS=-debug:full -debugtype:cv # /PDB:NONE | |
7bf54362 | 211 | _CRTFLAG=/MDd |
f641dada RD |
212 | |
213 | !else if "$(FINAL)" == "hybrid" | |
d440a0e7 RD |
214 | OPT = /Ox /Gy |
215 | DEBUG_FLAGS= /D__WXDEBUG__ /D__NO_VC_CRTDBG__ | |
216 | LINK_DEBUG_FLAGS=/RELEASE | |
f641dada RD |
217 | _CRTFLAG=/MD |
218 | ||
227869da JS |
219 | !else |
220 | # /O1 - smallest code | |
221 | # /O2 - fastest code | |
222 | OPT = /O1 # /O2 # /Od | |
223 | DEBUG_FLAGS= | |
224 | LINK_DEBUG_FLAGS=/RELEASE | |
7bf54362 RD |
225 | _CRTFLAG=/MD |
226 | !endif | |
227 | ||
f641dada | 228 | |
7bf54362 RD |
229 | !if "$(CRTFLAG)" == "" |
230 | CRTFLAG=$(_CRTFLAG) | |
227869da JS |
231 | !endif |
232 | ||
233 | !if "$(DLL)" == "0" | |
234 | ||
235 | !if "$(NOPCH)" == "1" | |
236 | PCH= | |
237 | PRECOMP= | |
238 | MAKEPRECOMP= | |
239 | !else | |
014e19de | 240 | |
0548ca8d GT |
241 | !if "$(wxUSE_GUI)" == "0" |
242 | PCH=wxBase.pch | |
243 | !else | |
3a7bfa06 | 244 | PCH=wxWindows.pch |
0548ca8d | 245 | !endif |
014e19de | 246 | |
3a7bfa06 | 247 | PRECOMP=/YuWX/WXPREC.H /Fp$(WXDIR)\$D\$(PCH) /Fd$(WXDIR)\$D\vc60.pdb |
227869da JS |
248 | MAKEPRECOMP=/YcWX/WXPREC.H |
249 | !endif | |
250 | ||
014e19de | 251 | |
0548ca8d | 252 | |
3a7bfa06 | 253 | CPPFLAGS=$(WINFLAGS) $(DEBUG_FLAGS) $(PRECOMP) $(EXTRAFLAGS) /D__WXMSW__ $(INC) $(OPT) $(EXTRADLLFLAGS) $(CRTFLAG) /D__WINDOWS__ /GX- $(OVERRIDEFLAGS) |
227869da | 254 | # If you don't include wxprec.h, use CPPFLAGS2 |
3a7bfa06 | 255 | CPPFLAGS2=$(WINFLAGS) $(DEBUG_FLAGS) /D__WXMSW__ $(INC) $(EXTRAFLAGS) $(OPT) $(EXTRADLLFLAGS) $(CRTFLAG) /D__WINDOWS__ /GX- $(OVERRIDEFLAGS) |
0548ca8d GT |
256 | !if "$(wxUSE_GUI)" == "0" |
257 | LINKFLAGS=$(LINK_DEBUG_FLAGS) $(BASELINKFLAGS) | |
258 | !else | |
227869da | 259 | LINKFLAGS=$(LINK_DEBUG_FLAGS) $(WINLINKFLAGS) -entry:WinMainCRTStartup |
0548ca8d | 260 | !endif |
227869da JS |
261 | DUMMY=dummy |
262 | ||
263 | !else | |
264 | ||
265 | !if "$(WXMAKINGDLL)" == "1" | |
3a7bfa06 | 266 | PCH=wxWindows.pch |
227869da JS |
267 | DUMMY=dummydll |
268 | !else | |
3a7bfa06 | 269 | PCH=wxWindows.pch |
227869da JS |
270 | DUMMY=dummy |
271 | !endif | |
272 | ||
3a7bfa06 | 273 | PRECOMP=/YuWX/WXPREC.H /Fp$(WXDIR)\$D\$(PCH) /Fd$(WXDIR)\lib\$(WXLIBNAME).pdb |
227869da JS |
274 | CPPFLAGS=$(WINFLAGS) $(DEBUG_FLAGS) $(PRECOMP) $(EXTRAFLAGS) /D__WXMSW__ $(INC) $(OPT) /D_DLL $(CRTFLAG) $(EXTRADLLFLAGS) /D_WINDOWS /D__WINDOWS__ /D_WINDLL |
275 | CPPFLAGS2=$(WINFLAGS) $(DEBUG_FLAGS) /D__WXMSW__ $(INC) $(EXTRAFLAGS) $(OPT) /D_DLL $(CRTFLAG) $(EXTRADLLFLAGS) /D_WINDOWS /D__WINDOWS__ /D_WINDLL | |
276 | LINKFLAGS=$(LINK_DEBUG_FLAGS) -machine:i386 -subsystem:windows,$(APPVER) -dll # -entry:_DllMainCRTStartup$(DLLENTRY) | |
277 | !endif | |
278 | ||
3a7bfa06 | 279 | DUMMYOBJ=$(WXDIR)\$D\$(DUMMY).obj |
227869da | 280 | |
e9c4b1a2 JS |
281 | .c.obj: |
282 | cl @<< | |
283 | $(CPPFLAGS2) /Fo$@ /c $< | |
284 | << | |
285 | ||
286 | .cpp.obj: | |
287 | cl @<< | |
288 | $(CPPFLAGS2) /Fo$@ /c $< | |
289 | << | |
290 | ||
0580ae4b GT |
291 | #use CPPFLAGS2 so as not to use precompiled headers |
292 | {}.c{$D}.obj: | |
293 | cl @<< | |
294 | $(CPPFLAGS2) /Fo$@ /c $< | |
295 | << | |
296 | ||
df801fc6 JS |
297 | {}.cpp{$D}.obj: |
298 | cl @<< | |
299 | $(CPPFLAGS) /Fo$@ /c /Tp $< | |
300 | << | |
301 |