]> git.saurik.com Git - wxWidgets.git/blame_incremental - src/makevc.env
changes to wx-config --static to allow static linkage in presence of shared library
[wxWidgets.git] / src / makevc.env
... / ...
CommitLineData
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)" == ""
12RM= erase
13!endif
14
15WXVERSION=232
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
37WAITFLAG=/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) -DSTRICT
41WINFLAGS=-c -W3 -nologo -DWIN32 -D__WIN32__ -D_WINDOWS $(WINVERSION) -DSTRICT
42WINLINKFLAGS=/INCREMENTAL:NO /NOLOGO -machine:$(CPU) -subsystem:windows,$(APPVER)
43BASELINKFLAGS=/INCREMENTAL:NO /NOLOGO -machine:$(CPU) -subsystem:console,$(APPVER)
44WINLIBS=kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib oldnames.lib\
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
46
47# Set a WXWIN environment variable be the path to your WXWIN directory
48WXDIR=$(WXWIN)
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#
61# wxWin as DLL Defined - Defined wx$(WXVERSION).lib
62#
63# App using wxWin DLL - Defined - wx$(WXVERSION).lib
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
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
102!ifndef UNICODE
103UNICODE=0
104!endif
105
106!ifndef FINAL
107FINAL=0
108DEBUG=1
109!endif
110
111!ifndef DLL
112DLL=0
113!endif
114
115# Set this to 1 if you don't want to use precompiled headers
116!ifndef NOPCH
117NOPCH=0
118!endif
119
120# This sets 'D' to a suitable directory name
121# for this kind of build, and WXLIBNAME to one of wx (static release), wxd (static debug),
122# wx$(WXVERSION) (DLL release), wx$(WXVERSION)d (DLL debug)
123
124!if "$(WXMAKINGDLL)" == "1" || "$(WXUSINGDLL)" == "1"
125WXLIBNAME=wxmsw$(WXVERSION)
126!else
127WXLIBNAME=wxmsw
128!endif
129
130!if "$(NEW_WXLIBNAME)" != ""
131WXLIBNAME=$(NEW_WXLIBNAME)
132!endif
133
134!if "$(UNICODE)" == "1"
135UNIEXT=u
136WXLIBNAME=$(WXLIBNAME)$(UNIEXT)
137!endif
138
139!if "$(FINAL)" == "1"
140D=Release
141!else if "$(FINAL)" == "hybrid"
142D=Hybrid
143LIBEXT=h
144WXLIBNAME=$(WXLIBNAME)$(LIBEXT)
145!else
146guilibsdll= oldnames.lib kernel32.lib \
147 ws2_32.lib mswsock.lib advapi32.lib user32.lib \
148 gdi32.lib comdlg32.lib winspool.lib
149D=Debug
150LIBEXT=d
151WXLIBNAME=$(WXLIBNAME)$(LIBEXT)
152!endif
153
154!if "$(wxUSE_GUI)" == "0"
155WXLIBNAME=wxBase
156D=Base$(D)
157WXLIBNAME=$(WXLIBNAME)$(UNIEXT)$(LIBEXT)
158!endif
159
160!if "$(UNICODE)" == "1"
161D=$(D)Unicode
162!endif
163
164INCEXT=$(UNIEXT)$(LIBEXT)
165
166!if "$(WXMAKINGDLL)" == "1" || "$(WXUSINGDLL)" == "1"
167D=$(D)DLL
168INCEXT=dll$(INCEXT)
169!endif
170
171WXLIB=$(WXDIR)\lib\$(WXLIBNAME).lib
172
173INC=$(EXTRAINC) -I$(WXDIR)/lib/msw$(INCEXT) -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
174
175!if "$(WXUSINGDLL)" == "1" || "$(wxUSE_GUI)" == "0"
176LIBS = $(EXTRALIBS) $(WXLIB) $(WINLIBS) $(WXDIR)\lib\regex$(LIBEXT).lib $(WXDIR)\lib\zlib$(LIBEXT).lib
177!else
178LIBS = $(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
179!endif
180
181MAKEPRECOMP=/YcWX/WXPREC.H
182OPTIONS=
183
184!if "$(FINAL)" == "0"
185OPT = /Od /Gy
186# ***N.B.*** to save space/time, comment out /FR to avoid browse info (.sbr files) being generated
187DEBUG_FLAGS= /Zi /D__WXDEBUG__ # /DDEBUG=1 # /FR
188LINK_DEBUG_FLAGS=-debug:full -debugtype:cv # /PDB:NONE
189_CRTFLAG=/MDd
190
191!else if "$(FINAL)" == "hybrid"
192OPT = /Od /Gy
193DEBUG_FLAGS= /Zi /D__WXDEBUG__ /D__NO_VC_CRTDBG__
194LINK_DEBUG_FLAGS=-debug:full -debugtype:cv
195_CRTFLAG=/MD
196
197!else
198# /O1 - smallest code
199# /O2 - fastest code
200OPT = /O1 # /O2 # /Od
201DEBUG_FLAGS=
202LINK_DEBUG_FLAGS=/RELEASE
203_CRTFLAG=/MD
204!endif
205
206
207!if "$(CRTFLAG)" == ""
208CRTFLAG=$(_CRTFLAG)
209!endif
210
211!if "$(DLL)" == "0"
212
213!if "$(NOPCH)" == "1"
214PCH=
215PRECOMP=
216MAKEPRECOMP=
217!else
218
219!if "$(wxUSE_GUI)" == "0"
220PCH=wxBase.pch
221!else
222PCH=wxWindows.pch
223!endif
224
225PRECOMP=/YuWX/WXPREC.H /Fp$(WXDIR)\$D\$(PCH) /Fd$(WXDIR)\$D\vc60.pdb
226MAKEPRECOMP=/YcWX/WXPREC.H
227!endif
228
229
230
231CPPFLAGS=$(WINFLAGS) $(DEBUG_FLAGS) $(PRECOMP) $(EXTRAFLAGS) /D__WXMSW__ $(INC) $(OPT) $(EXTRADLLFLAGS) $(CRTFLAG) /D__WINDOWS__ /GX- $(OVERRIDEFLAGS)
232# If you don't include wxprec.h, use CPPFLAGS2
233CPPFLAGS2=$(WINFLAGS) $(DEBUG_FLAGS) /D__WXMSW__ $(INC) $(EXTRAFLAGS) $(OPT) $(EXTRADLLFLAGS) $(CRTFLAG) /D__WINDOWS__ /GX- $(OVERRIDEFLAGS)
234!if "$(wxUSE_GUI)" == "0"
235LINKFLAGS=$(LINK_DEBUG_FLAGS) $(BASELINKFLAGS)
236!else
237LINKFLAGS=$(LINK_DEBUG_FLAGS) $(WINLINKFLAGS) -entry:WinMainCRTStartup
238!endif
239DUMMY=dummy
240
241!else
242
243!if "$(WXMAKINGDLL)" == "1"
244PCH=wxWindows.pch
245DUMMY=dummydll
246!else
247PCH=wxWindows.pch
248DUMMY=dummy
249!endif
250
251PRECOMP=/YuWX/WXPREC.H /Fp$(WXDIR)\$D\$(PCH) /Fd$(WXDIR)\lib\$(WXLIBNAME).pdb
252CPPFLAGS=$(WINFLAGS) $(DEBUG_FLAGS) $(PRECOMP) $(EXTRAFLAGS) /D__WXMSW__ $(INC) $(OPT) /D_DLL $(CRTFLAG) $(EXTRADLLFLAGS) /D_WINDOWS /D__WINDOWS__ /D_WINDLL
253CPPFLAGS2=$(WINFLAGS) $(DEBUG_FLAGS) /D__WXMSW__ $(INC) $(EXTRAFLAGS) $(OPT) /D_DLL $(CRTFLAG) $(EXTRADLLFLAGS) /D_WINDOWS /D__WINDOWS__ /D_WINDLL
254LINKFLAGS=$(LINK_DEBUG_FLAGS) -machine:i386 -subsystem:windows,$(APPVER) -dll # -entry:_DllMainCRTStartup$(DLLENTRY)
255!endif
256
257DUMMYOBJ=$(WXDIR)\$D\$(DUMMY).obj
258
259.c.obj:
260 cl @<<
261$(CPPFLAGS2) /Fo$@ /c $<
262<<
263
264.cpp.obj:
265 cl @<<
266$(CPPFLAGS2) /Fo$@ /c $<
267<<
268
269#use CPPFLAGS2 so as not to use precompiled headers
270{}.c{$D}.obj:
271 cl @<<
272$(CPPFLAGS2) /Fo$@ /c $<
273<<
274
275{}.cpp{$D}.obj:
276 cl @<<
277$(CPPFLAGS) /Fo$@ /c /Tp $<
278<<
279