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