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