1 #----------------------------------------------------------------------------
3 # Purpose: Win32, VC++ 5/6 makefile for wxPython
9 # Copyright: (c) 1998 by Total Control Software
10 # Licence: wxWindows license
11 #----------------------------------------------------------------------------
14 # Set WXDIR to the root wxWindows directory for your system
17 # Set this to the root of the Python installation
18 PYTHONDIR=e:\Tools\Python15
20 # Set this to 1 for a non-debug, optimised compile
23 # Set this to where you want the stuff installed at. It should
24 # be a directory contained in a PYTHONPATH directory, and should be
28 # Set this to 1 for make to pre-compile the Python modules, 0 to
29 # just copy the sources and let Python compile them the first
30 # time they are imported.
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.
37 # If you want to compile in code to aquire/release the Python
38 # Interpreter Lock at the appropriate places
42 # Set this if you want to build the wxGLCanvas
48 #----------------------------------------------------------------------
50 !if "$(WXP_USE_THREAD)" == "1"
51 THREAD=-DWXP_USE_THREAD=1
54 #----------------------------------------------------------------------
57 THISDIR=$(WXDIR)\utils\wxPython
60 EXTRALIBS=$(PYTHONDIR)\libs\python15.lib $(GLLIBS)
61 #EXTRALIBS=$(PYTHONDIR)\PCbuild\python15_d.lib -D_DEBUG
62 EXTRAINC=-I$(PYTHONDIR)\include -I. -I$(WXDIR)\utils\glcanvas\win
63 EXTRAFLAGS=/Fpwxp.pch /YXhelpers.h -DSWIG_GLOBAL -DHAVE_CONFIG_H $(THREAD)
64 OVERRIDEFLAGS=/GX- $(OTHERCFLAGS)
67 !if "$(WITH_GLCANVAS)" == "1"
68 GLLIBS=$(WXDIR)\lib\glcanvas.lib glu32.lib opengl32.lib
69 OTHERSWIGFLAGS=-DWITH_GLCANVAS
70 OTHERCFLAGS=-DWITH_GLCANVAS
73 SWIGFLAGS=-c++ -shadow -python -dnone -D__WXMSW__ $(OTHERSWIGFLAGS)
77 !include $(WXDIR)\src\ntwxwin.mak
79 #----------------------------------------------------------------------
83 OBJECTS = wx.obj helpers.obj windows.obj events.obj \
84 misc.obj gdi.obj mdi.obj controls.obj \
85 controls2.obj windows2.obj cmndlgs.obj stattool.obj \
86 frames.obj windows3.obj image.obj \
87 !if "$(SEPARATE)" == "0"
89 !if "$(WITH_GLCANVAS)" == "1"
94 OTHERCFLAGS=$(OTHERCFLAGS) -DSEPARATE=1
95 OTHERSWIGFLAGS=$(OTHERSWIGFLAGS) -DSEPARATE
98 target2=$(TARGETDIR)\$(TARGET2).pyd
101 OBJECTS3 = glcanvas.obj
102 target3=$(TARGETDIR)\$(TARGET3).pyd
105 PYMODULES = $(TARGETDIR)\wx.py $(TARGETDIR)\events.py \
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 \
110 $(TARGETDIR)\stattool.py $(TARGETDIR)\frames.py \
111 $(TARGETDIR)\windows3.py $(TARGETDIR)\__init__.py \
112 $(TARGETDIR)\utils.py $(TARGETDIR)\image.py \
113 !if "$(WITH_GLCANVAS)" == "1"
114 $(TARGETDIR)\glcanvas.py
117 #----------------------------------------------------------------------
119 !if "$(FINAL)" == "0"
120 DEBUGLFLAGS = /DEBUG /INCREMENTAL:YES
122 DEBUGLFLAGS = /INCREMENTAL:NO
125 LFLAGS= $(DEBUGLFLAGS) /DLL /subsystem:windows,3.50 /machine:I386 /nologo
127 #----------------------------------------------------------------------
129 default: $(TARGETDIR)\$(TARGET).pyd $(target2) $(target3) pycfiles
131 all: wx $(TARGET) $(TARGET2) $(TARGET3)
135 nmake -f makefile.nt FINAL=$(FINAL)
140 nmake -f makefile.nt clean
144 pycfiles : $(PYMODULES)
145 !if "$(COMPILEPY)" == "1"
146 $(PYTHONDIR)\python $(PYTHONDIR)\Lib\compileall.py -l $(TARGETDIR)
147 $(PYTHONDIR)\python -O $(PYTHONDIR)\Lib\compileall.py -l $(TARGETDIR)
150 #----------------------------------------------------------------------
152 $(TARGETDIR)\$(TARGET).pyd : $(DUMMYOBJ) $(WXLIB) $(OBJECTS) $(TARGET).res
155 $(LFLAGS) /def:$(TARGET).def /implib:./$(TARGET).lib
156 $(DUMMYOBJ) $(OBJECTS) $(TARGET).res
160 $(TARGETDIR)\$(TARGET2).pyd : $(DUMMYOBJ) $(WXLIB) $(OBJECTS2)
163 $(LFLAGS) /def:$(TARGET2).def /implib:./$(TARGET2).lib
164 $(DUMMYOBJ) $(OBJECTS2)
168 $(TARGETDIR)\$(TARGET3).pyd : $(DUMMYOBJ) $(WXLIB) $(OBJECTS3)
171 $(LFLAGS) /def:$(TARGET3).def /implib:./$(TARGET3).lib
172 $(DUMMYOBJ) $(OBJECTS3)
173 $(LIBS) $(WXDIR)\lib\glcanvas.lib glu32.lib opengl32.lib wxc.lib
177 $(TARGET).res : $(TARGET).rc $(WXDIR)\include\wx\msw\wx.rc
178 $(rc) -r /i$(WXDIR)\include -fo$@ $(TARGET).rc
182 # implicit rule for compiling .cpp files
185 $(CPPFLAGS) /c /Tp $<
188 {$(GENCODEDIR)}.cpp{}.obj:
190 $(CPPFLAGS) /c /Tp $<
204 -erase $(TARGETDIR)\$(TARGET).*
205 !if "$(SEPARATE)" != "0"
206 -erase $(TARGET2).exp
207 -erase $(TARGET2).lib
208 -erase $(TARGETDIR)\$(TARGET2).*
209 -erase $(TARGET3).exp
210 -erase $(TARGET3).lib
211 -erase $(TARGETDIR)\$(TARGET3).*
213 -erase $(TARGETDIR)\$(TARGET).pyd
214 -erase $(TARGETDIR)\*.py
215 -erase $(TARGETDIR)\*.pyc
216 -erase $(TARGETDIR)\*.pyo
222 #------------------------------------------------------------------------
226 # Implicit rules to run SWIG
227 {}.i{$(GENCODEDIR)}.cpp:
228 swig $(SWIGFLAGS) -c -o $@ $<
230 {}.i{$(GENCODEDIR)}.py:
231 swig $(SWIGFLAGS) -c -o $@ $<
234 {$(GENCODEDIR)}.py{$(TARGETDIR)}.py:
237 {}.py{$(TARGETDIR)}.py:
240 #{}.py{$(TARGETDIR)}.$(PYEXT):
241 # $(PYTHON) -c "import py_compile; py_compile.compile('$<', '$@')"
246 # This one must leave out the -c flag so we define the whole rule
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
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
255 $(GENCODEDIR)/windows3.cpp $(GENCODEDIR)/windows3.py : windows3.i my_typemaps.i _defs.i
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
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
265 $(GENCODEDIR)/image.cpp $(GENCODEDIR)/image.py : image.i my_typemaps.i _defs.i
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
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
276 $(GENCODEDIR)/utils.cpp $(GENCODEDIR)/utils.py : utils.i my_typemaps.i _defs.i
277 !if "$(WITH_GLCANVAS)" == "1"
278 $(GENCODEDIR)/glcanvas.cpp $(GENCODEDIR)/glcanvas.py : glcanvas.i my_typemaps.i _defs.i
283 $(TARGETDIR)\wx.py : $(GENCODEDIR)\wx.py
284 $(TARGETDIR)\windows.py : $(GENCODEDIR)\windows.py
285 $(TARGETDIR)\windows2.py : $(GENCODEDIR)\windows2.py
286 $(TARGETDIR)\windows3.py : $(GENCODEDIR)\windows3.py
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
294 $(TARGETDIR)\frames.py : $(GENCODEDIR)\frames.py
295 $(TARGETDIR)\stattool.py : $(GENCODEDIR)\stattool.py
296 $(TARGETDIR)\__init__.py : __init__.py
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
304 SOURCES = $(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 \
318 $(GENCODEDIR)/image.cpp $(GENCODEDIR)/image.py \
319 !if "$(WITH_GLCANVAS)" == "1"
320 $(GENCODEDIR)/glcanvas.cpp $(GENCODEDIR)/glcanvas.py \
329 wxPython\distrib\zipit.bat $(VERSION)
331 #------------------------------------------------------------------------