]>
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 /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 | ||
41 | WAITFLAG=/w | |
42 | ||
43 | # If you set wxUSE_IOSTREAMH to 0, remove -Dtry=__try -Dexcept=__except -Dleave=__leave -Dfinally=__finally | |
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 | |
46 | WINLINKFLAGS=/INCREMENTAL:NO /NOLOGO -machine:$(CPU) -subsystem:windows,$(APPVER) | |
47 | BASELINKFLAGS=/INCREMENTAL:NO /NOLOGO -machine:$(CPU) -subsystem:console,$(APPVER) | |
48 | WINLIBS=kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib oldnames.lib\ | |
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 | |
50 | ||
51 | # Set a WXWIN environment variable be the path to your WXWIN directory | |
52 | WXDIR=$(WXWIN) | |
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 | # | |
65 | # wxWin as DLL Defined - Defined wx$(WXVERSION).lib | |
66 | # | |
67 | # App using wxWin DLL - Defined - wx$(WXVERSION).lib | |
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 | ||
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 | ||
106 | !ifndef UNICODE | |
107 | UNICODE=0 | |
108 | !endif | |
109 | ||
110 | !ifndef MSLU | |
111 | MSLU=0 | |
112 | !endif | |
113 | ||
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 | ||
128 | # This sets 'D' to a suitable directory name | |
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) | |
131 | ||
132 | !if "$(WXMAKINGDLL)" == "1" || "$(WXUSINGDLL)" == "1" | |
133 | WXLIBNAME=wxmsw$(WXVERSION) | |
134 | !else | |
135 | WXLIBNAME=wxmsw | |
136 | !endif | |
137 | ||
138 | !if "$(NEW_WXLIBNAME)" != "" | |
139 | WXLIBNAME=$(NEW_WXLIBNAME) | |
140 | !endif | |
141 | ||
142 | !if "$(UNICODE)" == "1" | |
143 | UNIEXT=u | |
144 | WXLIBNAME=$(WXLIBNAME)$(UNIEXT) | |
145 | !endif | |
146 | ||
147 | !if "$(FINAL)" == "1" | |
148 | D=Release | |
149 | !else if "$(FINAL)" == "hybrid" | |
150 | D=Hybrid | |
151 | LIBEXT=h | |
152 | WXLIBNAME=$(WXLIBNAME)$(LIBEXT) | |
153 | !else | |
154 | guilibsdll= oldnames.lib kernel32.lib \ | |
155 | ws2_32.lib mswsock.lib advapi32.lib user32.lib \ | |
156 | gdi32.lib comdlg32.lib winspool.lib | |
157 | D=Debug | |
158 | LIBEXT=d | |
159 | WXLIBNAME=$(WXLIBNAME)$(LIBEXT) | |
160 | !endif | |
161 | ||
162 | !if "$(wxUSE_GUI)" == "0" | |
163 | WXLIBNAME=wxBase | |
164 | D=Base$(D) | |
165 | WXLIBNAME=$(WXLIBNAME)$(UNIEXT)$(LIBEXT) | |
166 | !endif | |
167 | ||
168 | !if "$(UNICODE)" == "1" | |
169 | D=$(D)Unicode | |
170 | !endif | |
171 | ||
172 | INCEXT=$(UNIEXT)$(LIBEXT) | |
173 | ||
174 | !if "$(WXMAKINGDLL)" == "1" || "$(WXUSINGDLL)" == "1" | |
175 | D=$(D)DLL | |
176 | INCEXT=dll$(INCEXT) | |
177 | !endif | |
178 | ||
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 | ||
187 | WXLIB=$(WXDIR)\lib\$(WXLIBNAME).lib | |
188 | ||
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 | |
196 | ||
197 | !if "$(WXUSINGDLL)" == "1" || "$(wxUSE_GUI)" == "0" | |
198 | LIBS = $(MSLU_LIBS) $(EXTRALIBS) $(WXLIB) $(WINLIBS) $(WXDIR)\lib\regex$(LIBEXT).lib $(WXDIR)\lib\zlib$(LIBEXT).lib | |
199 | !else | |
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 | |
201 | !endif | |
202 | ||
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 | |
211 | _CRTFLAG=/MDd | |
212 | ||
213 | !else if "$(FINAL)" == "hybrid" | |
214 | OPT = /Ox /Gy | |
215 | DEBUG_FLAGS= /D__WXDEBUG__ /D__NO_VC_CRTDBG__ | |
216 | LINK_DEBUG_FLAGS=/RELEASE | |
217 | _CRTFLAG=/MD | |
218 | ||
219 | !else | |
220 | # /O1 - smallest code | |
221 | # /O2 - fastest code | |
222 | OPT = /O1 # /O2 # /Od | |
223 | DEBUG_FLAGS= | |
224 | LINK_DEBUG_FLAGS=/RELEASE | |
225 | _CRTFLAG=/MD | |
226 | !endif | |
227 | ||
228 | ||
229 | !if "$(CRTFLAG)" == "" | |
230 | CRTFLAG=$(_CRTFLAG) | |
231 | !endif | |
232 | ||
233 | !if "$(DLL)" == "0" | |
234 | ||
235 | !if "$(NOPCH)" == "1" | |
236 | PCH= | |
237 | PRECOMP= | |
238 | MAKEPRECOMP= | |
239 | !else | |
240 | ||
241 | !if "$(wxUSE_GUI)" == "0" | |
242 | PCH=wxBase.pch | |
243 | !else | |
244 | PCH=wxWindows.pch | |
245 | !endif | |
246 | ||
247 | PRECOMP=/YuWX/WXPREC.H /Fp$(WXDIR)\$D\$(PCH) /Fd$(WXDIR)\$D\vc60.pdb | |
248 | MAKEPRECOMP=/YcWX/WXPREC.H | |
249 | !endif | |
250 | ||
251 | ||
252 | ||
253 | CPPFLAGS=$(WINFLAGS) $(DEBUG_FLAGS) $(PRECOMP) $(EXTRAFLAGS) /D__WXMSW__ $(INC) $(OPT) $(EXTRADLLFLAGS) $(CRTFLAG) /D__WINDOWS__ /GX- $(OVERRIDEFLAGS) | |
254 | # If you don't include wxprec.h, use CPPFLAGS2 | |
255 | CPPFLAGS2=$(WINFLAGS) $(DEBUG_FLAGS) /D__WXMSW__ $(INC) $(EXTRAFLAGS) $(OPT) $(EXTRADLLFLAGS) $(CRTFLAG) /D__WINDOWS__ /GX- $(OVERRIDEFLAGS) | |
256 | !if "$(wxUSE_GUI)" == "0" | |
257 | LINKFLAGS=$(LINK_DEBUG_FLAGS) $(BASELINKFLAGS) | |
258 | !else | |
259 | LINKFLAGS=$(LINK_DEBUG_FLAGS) $(WINLINKFLAGS) -entry:WinMainCRTStartup | |
260 | !endif | |
261 | DUMMY=dummy | |
262 | ||
263 | !else | |
264 | ||
265 | !if "$(WXMAKINGDLL)" == "1" | |
266 | PCH=wxWindows.pch | |
267 | DUMMY=dummydll | |
268 | !else | |
269 | PCH=wxWindows.pch | |
270 | DUMMY=dummy | |
271 | !endif | |
272 | ||
273 | PRECOMP=/YuWX/WXPREC.H /Fp$(WXDIR)\$D\$(PCH) /Fd$(WXDIR)\lib\$(WXLIBNAME).pdb | |
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 | ||
279 | DUMMYOBJ=$(WXDIR)\$D\$(DUMMY).obj | |
280 | ||
281 | .c.obj: | |
282 | cl @<< | |
283 | $(CPPFLAGS2) /Fo$@ /c $< | |
284 | << | |
285 | ||
286 | .cpp.obj: | |
287 | cl @<< | |
288 | $(CPPFLAGS2) /Fo$@ /c $< | |
289 | << | |
290 | ||
291 | #use CPPFLAGS2 so as not to use precompiled headers | |
292 | {}.c{$D}.obj: | |
293 | cl @<< | |
294 | $(CPPFLAGS2) /Fo$@ /c $< | |
295 | << | |
296 | ||
297 | {}.cpp{$D}.obj: | |
298 | cl @<< | |
299 | $(CPPFLAGS) /Fo$@ /c /Tp $< | |
300 | << | |
301 |