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