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