]> git.saurik.com Git - wxWidgets.git/blame - utils/wxPython/src/makefile.vc
fixes for GetReturnCode/SetReturnCode
[wxWidgets.git] / utils / wxPython / src / makefile.vc
CommitLineData
7bf85405
RD
1#----------------------------------------------------------------------------
2# Name: makefile.nt
af309447 3# Purpose: Win32, VC++ 5/6 makefile for wxPython
7bf85405
RD
4#
5# Author: Robin Dunn
6#
7# Created: 3/27/97
8# RCS-ID: $Id$
9# Copyright: (c) 1998 by Total Control Software
10# Licence: wxWindows license
11#----------------------------------------------------------------------------
cf694132 12VERSION=2.0b9
7bf85405
RD
13
14# Set WXDIR to the root wxWindows directory for your system
15WXDIR = $(WXWIN)
16
17# Set this to the root of the Python installation
18PYTHONDIR=e:\Tools\Python15
19
20# Set this to 1 for a non-debug, optimised compile
21FINAL=0
22
23# Set this to where you want the stuff installed at. It should
b8b8dda7
RD
24# be a directory contained in a PYTHONPATH directory, and should be
25# named wxPython
7bf85405
RD
26TARGETDIR=..
27
3b8b2387 28# Set this to 1 for make to pre-compile the Python modules, 0 to
cf694132
RD
29# just copy the sources and let Python compile them the first
30# time they are imported.
3b8b2387 31COMPILEPY=0
7bf85405 32
cf694132
RD
33# If your wxWindows is built as a DLL, set this to 1. Using 0 or unset
34# means that wxWindows will be staticaly linked with wxPython.
35#WXUSINGDLL=1
36
37# If you want to compile in code to aquire/release the Python
38# Interpreter Lock at the appropriate places
39WXP_USE_THREAD=1
40
41
42# Set this if you want to build the wxGLCanvas
43WITH_GLCANVAS=1
af309447
RD
44
45# (experimental)
b8b8dda7
RD
46SEPARATE=0
47
7bf85405
RD
48#----------------------------------------------------------------------
49
cf694132
RD
50!if "$(WXP_USE_THREAD)" == "1"
51THREAD=-DWXP_USE_THREAD=1
52!endif
53
54#----------------------------------------------------------------------
55
7bf85405
RD
56NOPCH=1
57THISDIR=$(WXDIR)\utils\wxPython
58
cf694132
RD
59
60EXTRALIBS=$(PYTHONDIR)\libs\python15.lib $(GLLIBS)
61#EXTRALIBS=$(PYTHONDIR)\PCbuild\python15_d.lib -D_DEBUG
62EXTRAINC=-I$(PYTHONDIR)\include -I. -I$(WXDIR)\utils\glcanvas\win
63EXTRAFLAGS=/Fpwxp.pch /YXhelpers.h -DSWIG_GLOBAL -DHAVE_CONFIG_H $(THREAD)
64OVERRIDEFLAGS=/GX- $(OTHERCFLAGS)
2ea09579 65
7bf85405 66
cf694132
RD
67!if "$(WITH_GLCANVAS)" == "1"
68GLLIBS=$(WXDIR)\lib\glcanvas.lib glu32.lib opengl32.lib
69OTHERSWIGFLAGS=-DWITH_GLCANVAS
70OTHERCFLAGS=-DWITH_GLCANVAS
71!endif
72
0699c864 73SWIGFLAGS=-c++ -shadow -python -dnone -D__WXMSW__ $(OTHERSWIGFLAGS)
b62bdb48 74GENCODEDIR=msw
7bf85405
RD
75
76
77!include $(WXDIR)\src\ntwxwin.mak
78
79#----------------------------------------------------------------------
80
b8b8dda7 81TARGET = wxc
7bf85405 82
b8b8dda7 83OBJECTS = wx.obj helpers.obj windows.obj events.obj \
7bf85405 84 misc.obj gdi.obj mdi.obj controls.obj \
9c039d08 85 controls2.obj windows2.obj cmndlgs.obj stattool.obj \
c127177f 86 frames.obj windows3.obj image.obj \
b8b8dda7 87!if "$(SEPARATE)" == "0"
cf694132
RD
88 utils.obj \
89!if "$(WITH_GLCANVAS)" == "1"
90 glcanvas.obj
91!endif
b8b8dda7 92!else
9c039d08 93
cf694132
RD
94OTHERCFLAGS=$(OTHERCFLAGS) -DSEPARATE=1
95OTHERSWIGFLAGS=$(OTHERSWIGFLAGS) -DSEPARATE
b8b8dda7
RD
96TARGET2 = utilsc
97OBJECTS2 = utils.obj
98target2=$(TARGETDIR)\$(TARGET2).pyd
cf694132
RD
99
100TARGET3 = glcanvasc
101OBJECTS3 = glcanvas.obj
102target3=$(TARGETDIR)\$(TARGET3).pyd
b8b8dda7 103!endif
7bf85405 104
b8b8dda7 105PYMODULES = $(TARGETDIR)\wx.py $(TARGETDIR)\events.py \
7bf85405
RD
106 $(TARGETDIR)\windows.py $(TARGETDIR)\misc.py \
107 $(TARGETDIR)\gdi.py $(TARGETDIR)\mdi.py \
108 $(TARGETDIR)\controls.py $(TARGETDIR)\controls2.py \
109 $(TARGETDIR)\windows2.py $(TARGETDIR)\cmndlgs.py \
9c039d08 110 $(TARGETDIR)\stattool.py $(TARGETDIR)\frames.py \
cf694132
RD
111 $(TARGETDIR)\windows3.py $(TARGETDIR)\__init__.py \
112 $(TARGETDIR)\utils.py $(TARGETDIR)\image.py \
113!if "$(WITH_GLCANVAS)" == "1"
114 $(TARGETDIR)\glcanvas.py
115!endif
7bf85405
RD
116
117#----------------------------------------------------------------------
118
119!if "$(FINAL)" == "0"
120DEBUGLFLAGS = /DEBUG /INCREMENTAL:YES
121!else
122DEBUGLFLAGS = /INCREMENTAL:NO
123!endif
124
cf694132 125LFLAGS= $(DEBUGLFLAGS) /DLL /subsystem:windows,3.50 /machine:I386 /nologo
b8b8dda7 126
7bf85405
RD
127#----------------------------------------------------------------------
128
cf694132 129default: $(TARGETDIR)\$(TARGET).pyd $(target2) $(target3) pycfiles
7bf85405 130
cf694132 131all: wx $(TARGET) $(TARGET2) $(TARGET3)
7bf85405
RD
132
133wx:
134 cd $(WXDIR)\src\msw
135 nmake -f makefile.nt FINAL=$(FINAL)
136 cd $(THISDIR)
137
138wxclean:
139 cd $(WXDIR)\src\msw
140 nmake -f makefile.nt clean
141 cd $(THISDIR)
142
143
144pycfiles : $(PYMODULES)
3b8b2387 145!if "$(COMPILEPY)" == "1"
7bf85405
RD
146 $(PYTHONDIR)\python $(PYTHONDIR)\Lib\compileall.py -l $(TARGETDIR)
147 $(PYTHONDIR)\python -O $(PYTHONDIR)\Lib\compileall.py -l $(TARGETDIR)
3b8b2387 148!endif
7bf85405
RD
149
150#----------------------------------------------------------------------
151
152$(TARGETDIR)\$(TARGET).pyd : $(DUMMYOBJ) $(WXLIB) $(OBJECTS) $(TARGET).res
153 $(link) @<<
154/out:$@ /dll
cf694132 155$(LFLAGS) /def:$(TARGET).def /implib:./$(TARGET).lib
7bf85405
RD
156$(DUMMYOBJ) $(OBJECTS) $(TARGET).res
157$(LIBS)
158<<
159
b8b8dda7
RD
160$(TARGETDIR)\$(TARGET2).pyd : $(DUMMYOBJ) $(WXLIB) $(OBJECTS2)
161 $(link) @<<
162/out:$@ /dll
cf694132 163$(LFLAGS) /def:$(TARGET2).def /implib:./$(TARGET2).lib
b8b8dda7 164$(DUMMYOBJ) $(OBJECTS2)
cf694132
RD
165$(LIBS) wxc.lib
166<<
167
168$(TARGETDIR)\$(TARGET3).pyd : $(DUMMYOBJ) $(WXLIB) $(OBJECTS3)
169 $(link) @<<
170/out:$@ /dll
171$(LFLAGS) /def:$(TARGET3).def /implib:./$(TARGET3).lib
172$(DUMMYOBJ) $(OBJECTS3)
173$(LIBS) $(WXDIR)\lib\glcanvas.lib glu32.lib opengl32.lib wxc.lib
b8b8dda7
RD
174<<
175
7bf85405
RD
176
177$(TARGET).res : $(TARGET).rc $(WXDIR)\include\wx\msw\wx.rc
178 $(rc) -r /i$(WXDIR)\include -fo$@ $(TARGET).rc
179
180
181
182# implicit rule for compiling .cpp files
183{}.cpp{}.obj:
184 $(cc) @<<
185$(CPPFLAGS) /c /Tp $<
186<<
187
b62bdb48
RD
188{$(GENCODEDIR)}.cpp{}.obj:
189 $(cc) @<<
190$(CPPFLAGS) /c /Tp $<
191<<
192
7bf85405
RD
193
194clean:
195 -erase *.obj
196 -erase *.exe
197 -erase *.res
198 -erase *.map
199 -erase *.sbr
200 -erase *.pdb
201 -erase *.pch
202 -erase $(TARGET).exp
203 -erase $(TARGET).lib
b8b8dda7
RD
204 -erase $(TARGETDIR)\$(TARGET).*
205!if "$(SEPARATE)" != "0"
206 -erase $(TARGET2).exp
207 -erase $(TARGET2).lib
208 -erase $(TARGETDIR)\$(TARGET2).*
cf694132
RD
209 -erase $(TARGET3).exp
210 -erase $(TARGET3).lib
211 -erase $(TARGETDIR)\$(TARGET3).*
b8b8dda7 212!endif
7bf85405
RD
213 -erase $(TARGETDIR)\$(TARGET).pyd
214 -erase $(TARGETDIR)\*.py
215 -erase $(TARGETDIR)\*.pyc
216 -erase $(TARGETDIR)\*.pyo
7bf85405
RD
217
218
af309447
RD
219showflags:
220 @echo $(CPPFLAGS)
7bf85405
RD
221
222#------------------------------------------------------------------------
223
224.SUFFIXES : .i .py
225
226# Implicit rules to run SWIG
b62bdb48
RD
227{}.i{$(GENCODEDIR)}.cpp:
228 swig $(SWIGFLAGS) -c -o $@ $<
7bf85405 229
b62bdb48
RD
230{}.i{$(GENCODEDIR)}.py:
231 swig $(SWIGFLAGS) -c -o $@ $<
b62bdb48
RD
232
233
234{$(GENCODEDIR)}.py{$(TARGETDIR)}.py:
235 copy $< $@
7bf85405
RD
236
237{}.py{$(TARGETDIR)}.py:
238 copy $< $@
239
240#{}.py{$(TARGETDIR)}.$(PYEXT):
241# $(PYTHON) -c "import py_compile; py_compile.compile('$<', '$@')"
242
243
244
245
246# This one must leave out the -c flag so we define the whole rule
b8b8dda7
RD
247$(GENCODEDIR)\wx.cpp $(GENCODEDIR)\wx.py : wx.i my_typemaps.i _defs.i _extras.py
248 swig $(SWIGFLAGS) -o $(GENCODEDIR)/wx.cpp wx.i
7bf85405
RD
249
250
8f89cfc1
RD
251# Define some dependencies. These MUST use forward slashes so SWIG
252# will write the shadow file to the right directory.
253$(GENCODEDIR)/windows.cpp $(GENCODEDIR)/windows.py : windows.i my_typemaps.i _defs.i
254$(GENCODEDIR)/windows2.cpp $(GENCODEDIR)/windows2.py : windows2.i my_typemaps.i _defs.i
08127323 255$(GENCODEDIR)/windows3.cpp $(GENCODEDIR)/windows3.py : windows3.i my_typemaps.i _defs.i
8f89cfc1
RD
256$(GENCODEDIR)/events.cpp $(GENCODEDIR)/events.py : events.i my_typemaps.i _defs.i
257$(GENCODEDIR)/misc.cpp $(GENCODEDIR)/misc.py : misc.i my_typemaps.i _defs.i
258$(GENCODEDIR)/gdi.cpp $(GENCODEDIR)/gdi.py : gdi.i my_typemaps.i _defs.i
259$(GENCODEDIR)/mdi.cpp $(GENCODEDIR)/mdi.py : mdi.i my_typemaps.i _defs.i
260$(GENCODEDIR)/controls.cpp $(GENCODEDIR)/controls.py : controls.i my_typemaps.i _defs.i
261$(GENCODEDIR)/controls2.cpp $(GENCODEDIR)/controls2.py : controls2.i my_typemaps.i _defs.i
262$(GENCODEDIR)/cmndlgs.cpp $(GENCODEDIR)/cmndlgs.py : cmndlgs.i my_typemaps.i _defs.i
9c039d08
RD
263$(GENCODEDIR)/stattool.cpp $(GENCODEDIR)/stattool.py : stattool.i my_typemaps.i _defs.i
264$(GENCODEDIR)/frames.cpp $(GENCODEDIR)/frames.py : frames.i my_typemaps.i _defs.i
cf694132 265$(GENCODEDIR)/image.cpp $(GENCODEDIR)/image.py : image.i my_typemaps.i _defs.i
b62bdb48 266
b8b8dda7
RD
267!if "$(SEPARATE)" == "1"
268$(GENCODEDIR)\utils.cpp $(GENCODEDIR)\utils.py : utils.i my_typemaps.i
269 swig $(SWIGFLAGS) -o $(GENCODEDIR)/utils.cpp utils.i
cf694132
RD
270
271!if "$(WITH_GLCANVAS)" == "1"
272$(GENCODEDIR)\glcanvas.cpp $(GENCODEDIR)\glcanvas.py : glcanvas.i my_typemaps.i
273 swig $(SWIGFLAGS) -c -o $(GENCODEDIR)/glcanvas.cpp glcanvas.i
274!endif
b8b8dda7
RD
275!else
276$(GENCODEDIR)/utils.cpp $(GENCODEDIR)/utils.py : utils.i my_typemaps.i _defs.i
cf694132
RD
277!if "$(WITH_GLCANVAS)" == "1"
278$(GENCODEDIR)/glcanvas.cpp $(GENCODEDIR)/glcanvas.py : glcanvas.i my_typemaps.i _defs.i
279!endif
b8b8dda7
RD
280!endif
281
b62bdb48 282
b8b8dda7 283$(TARGETDIR)\wx.py : $(GENCODEDIR)\wx.py
b62bdb48
RD
284$(TARGETDIR)\windows.py : $(GENCODEDIR)\windows.py
285$(TARGETDIR)\windows2.py : $(GENCODEDIR)\windows2.py
08127323 286$(TARGETDIR)\windows3.py : $(GENCODEDIR)\windows3.py
b62bdb48
RD
287$(TARGETDIR)\events.py : $(GENCODEDIR)\events.py
288$(TARGETDIR)\misc.py : $(GENCODEDIR)\misc.py
289$(TARGETDIR)\gdi.py : $(GENCODEDIR)\gdi.py
290$(TARGETDIR)\mdi.py : $(GENCODEDIR)\mdi.py
291$(TARGETDIR)\controls.py : $(GENCODEDIR)\controls.py
292$(TARGETDIR)\controls2.py : $(GENCODEDIR)\controls2.py
293$(TARGETDIR)\cmndlgs.py : $(GENCODEDIR)\cmndlgs.py
b8b8dda7 294$(TARGETDIR)\frames.py : $(GENCODEDIR)\frames.py
9c039d08 295$(TARGETDIR)\stattool.py : $(GENCODEDIR)\stattool.py
b62bdb48 296$(TARGETDIR)\__init__.py : __init__.py
cf694132
RD
297$(TARGETDIR)\utils.py : $(GENCODEDIR)\utils.py
298$(TARGETDIR)\image.py : $(GENCODEDIR)\utils.py
299!if "$(WITH_GLCANVAS)" == "1"
300$(TARGETDIR)\glcanvas.py : $(GENCODEDIR)\glcanvas.py
301!endif
7bf85405
RD
302
303
08127323
RD
304SOURCES = $(GENCODEDIR)\wx.cpp $(GENCODEDIR)\wx.py \
305 $(GENCODEDIR)/windows.cpp $(GENCODEDIR)/windows.py \
306 $(GENCODEDIR)/windows2.cpp $(GENCODEDIR)/windows2.py \
307 $(GENCODEDIR)/windows3.cpp $(GENCODEDIR)/windows3.py \
308 $(GENCODEDIR)/events.cpp $(GENCODEDIR)/events.py \
309 $(GENCODEDIR)/misc.cpp $(GENCODEDIR)/misc.py \
310 $(GENCODEDIR)/gdi.cpp $(GENCODEDIR)/gdi.py \
311 $(GENCODEDIR)/mdi.cpp $(GENCODEDIR)/mdi.py \
312 $(GENCODEDIR)/controls.cpp $(GENCODEDIR)/controls.py \
313 $(GENCODEDIR)/controls2.cpp $(GENCODEDIR)/controls2.py\
314 $(GENCODEDIR)/cmndlgs.cpp $(GENCODEDIR)/cmndlgs.py \
315 $(GENCODEDIR)/stattool.cpp $(GENCODEDIR)/stattool.py \
316 $(GENCODEDIR)/frames.cpp $(GENCODEDIR)/frames.py \
317 $(GENCODEDIR)/utils.cpp $(GENCODEDIR)/utils.py \
cf694132
RD
318 $(GENCODEDIR)/image.cpp $(GENCODEDIR)/image.py \
319!if "$(WITH_GLCANVAS)" == "1"
320 $(GENCODEDIR)/glcanvas.cpp $(GENCODEDIR)/glcanvas.py \
321!endif
08127323
RD
322
323
324sources : $(SOURCES)
325
73c5ed36
RD
326
327dist:
328 cd ..\..
329 wxPython\distrib\zipit.bat $(VERSION)
330
7bf85405
RD
331#------------------------------------------------------------------------
332#