2 #----------------------------------------------------------------------------
4 # Purpose: Win32, VC++ 5/6 makefile for wxPython
10 # Copyright: (c) 1998 by Total Control Software
11 # Licence: wxWindows license
12 #----------------------------------------------------------------------------
15 # Set WXDIR to the root wxWindows directory for your system
18 # Set this to the root of the Python installation
19 PYTHONDIR=e:\Tools\Python15
21 # Set this to 1 for a non-debug, optimised compile
24 # Set this to where you want the stuff installed at. It should
25 # be a directory contained in a PYTHONPATH directory, and should be
29 # Set this to 1 for make to pre-compile the Python modules, 0 to
30 # just copy the sources and let Python compile them the first
31 # time they are imported.
34 # If your wxWindows is built as a DLL, set this to 1. Using 0 or unset
35 # means that wxWindows will be staticaly linked with wxPython.
38 # If you want to compile in code to aquire/release the Python
39 # Interpreter Lock at the appropriate places
43 # Set this if you want to build the wxGLCanvas
49 #----------------------------------------------------------------------
51 !if "$(WXP_USE_THREAD)" == "1"
52 THREAD=-DWXP_USE_THREAD=1
55 #----------------------------------------------------------------------
58 THISDIR=$(WXDIR)\utils\wxPython
61 EXTRALIBS=$(PYTHONDIR)\libs\python15.lib $(GLLIBS)
62 #EXTRALIBS=$(PYTHONDIR)\PCbuild\python15_d.lib -D_DEBUG
63 EXTRAINC=-I$(PYTHONDIR)\include -I. -I$(WXDIR)\utils\glcanvas\win
64 EXTRAFLAGS=/Fpwxp.pch /YXhelpers.h -DSWIG_GLOBAL -DHAVE_CONFIG_H $(THREAD)
65 OVERRIDEFLAGS=/GX- $(OTHERCFLAGS)
68 !if "$(WITH_GLCANVAS)" == "1"
69 GLLIBS=$(WXDIR)\lib\glcanvas.lib glu32.lib opengl32.lib
70 OTHERSWIGFLAGS=-DWITH_GLCANVAS
71 OTHERCFLAGS=-DWITH_GLCANVAS
74 SWIGFLAGS=-c++ -shadow -python -dnone -D__WXMSW__ $(OTHERSWIGFLAGS)
78 !include $(WXDIR)\src\makevc.env
80 #----------------------------------------------------------------------
84 OBJECTS = helpers.obj libpy.obj \
85 wx.obj windows.obj events.obj \
86 misc.obj gdi.obj mdi.obj controls.obj \
87 controls2.obj windows2.obj cmndlgs.obj stattool.obj \
88 frames.obj windows3.obj image.obj printfw.obj \
90 !if "$(SEPARATE)" == "0"
92 !if "$(WITH_GLCANVAS)" == "1"
97 OTHERCFLAGS=$(OTHERCFLAGS) -DSEPARATE=1
98 OTHERSWIGFLAGS=$(OTHERSWIGFLAGS) -DSEPARATE
101 target2=$(TARGETDIR)\$(TARGET2).pyd
104 OBJECTS3 = glcanvas.obj
105 target3=$(TARGETDIR)\$(TARGET3).pyd
109 #target4=$(TARGETDIR)\$(TARGET4).pyd
112 PYMODULES = $(TARGETDIR)\wx.py $(TARGETDIR)\events.py \
113 $(TARGETDIR)\windows.py $(TARGETDIR)\misc.py \
114 $(TARGETDIR)\gdi.py $(TARGETDIR)\mdi.py \
115 $(TARGETDIR)\controls.py $(TARGETDIR)\controls2.py \
116 $(TARGETDIR)\windows2.py $(TARGETDIR)\cmndlgs.py \
117 $(TARGETDIR)\stattool.py $(TARGETDIR)\frames.py \
118 $(TARGETDIR)\windows3.py $(TARGETDIR)\__init__.py \
119 $(TARGETDIR)\utils.py $(TARGETDIR)\image.py \
120 $(TARGETDIR)\printfw.py $(TARGETDIR)\misc2.py \
121 !if "$(WITH_GLCANVAS)" == "1"
122 $(TARGETDIR)\glcanvas.py
125 #----------------------------------------------------------------------
127 !if "$(FINAL)" == "0"
128 DEBUGLFLAGS = /DEBUG /INCREMENTAL:YES
130 DEBUGLFLAGS = /INCREMENTAL:NO
133 LFLAGS= $(DEBUGLFLAGS) /DLL /subsystem:windows,3.50 /machine:I386 /nologo
135 #----------------------------------------------------------------------
137 default: $(TARGETDIR)\$(TARGET).pyd $(target2) $(target3) pycfiles
139 all: wx $(TARGET) $(TARGET2) $(TARGET3)
143 nmake -f makefile.nt FINAL=$(FINAL)
148 nmake -f makefile.nt clean
152 pycfiles : $(PYMODULES)
153 !if "$(COMPILEPY)" == "1"
154 $(PYTHONDIR)\python $(PYTHONDIR)\Lib\compileall.py -l $(TARGETDIR)
155 $(PYTHONDIR)\python -O $(PYTHONDIR)\Lib\compileall.py -l $(TARGETDIR)
158 #----------------------------------------------------------------------
160 $(TARGETDIR)\$(TARGET).pyd : $(DUMMYOBJ) $(WXLIB) $(OBJECTS) $(TARGET).res
163 $(LFLAGS) /def:$(TARGET).def /implib:./$(TARGET).lib
164 $(DUMMYOBJ) $(OBJECTS) $(TARGET).res
168 $(TARGETDIR)\$(TARGET2).pyd : $(DUMMYOBJ) $(WXLIB) $(OBJECTS2)
171 $(LFLAGS) /def:$(TARGET2).def /implib:./$(TARGET2).lib
172 $(DUMMYOBJ) $(OBJECTS2)
176 $(TARGETDIR)\$(TARGET3).pyd : $(DUMMYOBJ) $(WXLIB) $(OBJECTS3)
179 $(LFLAGS) /def:$(TARGET3).def /implib:./$(TARGET3).lib
180 $(DUMMYOBJ) $(OBJECTS3)
181 $(LIBS) $(WXDIR)\lib\glcanvas.lib glu32.lib opengl32.lib wxc.lib
185 #$(TARGETDIR)\$(TARGET4).pyd : $(DUMMYOBJ) $(WXLIB) $(OBJECTS4)
188 #$(LFLAGS) /def:$(TARGET4).def /implib:./$(TARGET4).lib
189 #$(DUMMYOBJ) $(OBJECTS4)
190 #$(LIBS) wxc.lib $(WXDIR)\lib\ogl$(LIBEXT).lib
194 $(TARGET).res : $(TARGET).rc $(WXDIR)\include\wx\msw\wx.rc
195 $(rc) -r /i$(WXDIR)\include -fo$@ $(TARGET).rc
199 # implicit rule for compiling .cpp and .c files
202 $(CPPFLAGS) /c /Tp $<
205 {$(GENCODEDIR)}.cpp{}.obj:
207 $(CPPFLAGS) /c /Tp $<
226 -erase $(TARGETDIR)\$(TARGET).*
227 !if "$(SEPARATE)" != "0"
228 -erase $(TARGET2).exp
229 -erase $(TARGET2).lib
230 -erase $(TARGETDIR)\$(TARGET2).*
231 -erase $(TARGET3).exp
232 -erase $(TARGET3).lib
233 -erase $(TARGETDIR)\$(TARGET3).*
234 # -erase $(TARGET4).exp
235 # -erase $(TARGET4).lib
236 # -erase $(TARGETDIR)\$(TARGET4).*
238 -erase $(TARGETDIR)\$(TARGET).pyd
239 -erase $(TARGETDIR)\*.py
240 -erase $(TARGETDIR)\*.pyc
241 -erase $(TARGETDIR)\*.pyo
247 #------------------------------------------------------------------------
251 # Implicit rules to run SWIG
252 {}.i{$(GENCODEDIR)}.cpp:
253 swig $(SWIGFLAGS) -c -o $@ $<
255 {}.i{$(GENCODEDIR)}.py:
256 swig $(SWIGFLAGS) -c -o $@ $<
259 {$(GENCODEDIR)}.py{$(TARGETDIR)}.py:
262 {}.py{$(TARGETDIR)}.py:
265 #{}.py{$(TARGETDIR)}.$(PYEXT):
266 # $(PYTHON) -c "import py_compile; py_compile.compile('$<', '$@')"
272 # Define some dependencies. These MUST use forward slashes so SWIG
273 # will write the shadow file to the right directory.
274 $(GENCODEDIR)/wx.cpp $(GENCODEDIR)/wx.py : wx.i my_typemaps.i _defs.i
275 $(GENCODEDIR)/windows.cpp $(GENCODEDIR)/windows.py : windows.i my_typemaps.i _defs.i
276 $(GENCODEDIR)/windows2.cpp $(GENCODEDIR)/windows2.py : windows2.i my_typemaps.i _defs.i
277 $(GENCODEDIR)/windows3.cpp $(GENCODEDIR)/windows3.py : windows3.i my_typemaps.i _defs.i
278 $(GENCODEDIR)/events.cpp $(GENCODEDIR)/events.py : events.i my_typemaps.i _defs.i
279 $(GENCODEDIR)/misc.cpp $(GENCODEDIR)/misc.py : misc.i my_typemaps.i _defs.i
280 $(GENCODEDIR)/misc2.cpp $(GENCODEDIR)/misc2.py : misc2.i my_typemaps.i _defs.i
281 $(GENCODEDIR)/gdi.cpp $(GENCODEDIR)/gdi.py : gdi.i my_typemaps.i _defs.i
282 $(GENCODEDIR)/mdi.cpp $(GENCODEDIR)/mdi.py : mdi.i my_typemaps.i _defs.i
283 $(GENCODEDIR)/controls.cpp $(GENCODEDIR)/controls.py : controls.i my_typemaps.i _defs.i
284 $(GENCODEDIR)/controls2.cpp $(GENCODEDIR)/controls2.py : controls2.i my_typemaps.i _defs.i
285 $(GENCODEDIR)/cmndlgs.cpp $(GENCODEDIR)/cmndlgs.py : cmndlgs.i my_typemaps.i _defs.i
286 $(GENCODEDIR)/stattool.cpp $(GENCODEDIR)/stattool.py : stattool.i my_typemaps.i _defs.i
287 $(GENCODEDIR)/frames.cpp $(GENCODEDIR)/frames.py : frames.i my_typemaps.i _defs.i
288 $(GENCODEDIR)/image.cpp $(GENCODEDIR)/image.py : image.i my_typemaps.i _defs.i
289 $(GENCODEDIR)/printfw.cpp $(GENCODEDIR)/printfw.py : printfw.i my_typemaps.i _defs.i
291 $(GENCODEDIR)/utils.cpp $(GENCODEDIR)/utils.py : utils.i my_typemaps.i _defs.i
292 $(GENCODEDIR)/glcanvas.cpp $(GENCODEDIR)/glcanvas.py : glcanvas.i my_typemaps.i _defs.i
293 #$(GENCODEDIR)/ogl.cpp $(GENCODEDIR)/ogl.py : ogl.i my_typemaps.i _defs.i
297 $(TARGETDIR)\wx.py : $(GENCODEDIR)\wx.py
298 $(TARGETDIR)\windows.py : $(GENCODEDIR)\windows.py
299 $(TARGETDIR)\windows2.py : $(GENCODEDIR)\windows2.py
300 $(TARGETDIR)\windows3.py : $(GENCODEDIR)\windows3.py
301 $(TARGETDIR)\events.py : $(GENCODEDIR)\events.py
302 $(TARGETDIR)\misc.py : $(GENCODEDIR)\misc.py
303 $(TARGETDIR)\misc2.py : $(GENCODEDIR)\misc2.py
304 $(TARGETDIR)\gdi.py : $(GENCODEDIR)\gdi.py
305 $(TARGETDIR)\mdi.py : $(GENCODEDIR)\mdi.py
306 $(TARGETDIR)\controls.py : $(GENCODEDIR)\controls.py
307 $(TARGETDIR)\controls2.py : $(GENCODEDIR)\controls2.py
308 $(TARGETDIR)\cmndlgs.py : $(GENCODEDIR)\cmndlgs.py
309 $(TARGETDIR)\frames.py : $(GENCODEDIR)\frames.py
310 $(TARGETDIR)\stattool.py : $(GENCODEDIR)\stattool.py
311 $(TARGETDIR)\__init__.py : __init__.py
312 $(TARGETDIR)\utils.py : $(GENCODEDIR)\utils.py
313 $(TARGETDIR)\image.py : $(GENCODEDIR)\image.py
314 $(TARGETDIR)\printfw.py : $(GENCODEDIR)\printfw.py
315 #$(TARGETDIR)\ogl.py : $(GENCODEDIR)\ogl.py
317 !if "$(WITH_GLCANVAS)" == "1"
318 $(TARGETDIR)\glcanvas.py : $(GENCODEDIR)\glcanvas.py
322 SOURCES = $(GENCODEDIR)/wx.cpp $(GENCODEDIR)/wx.py \
323 $(GENCODEDIR)/windows.cpp $(GENCODEDIR)/windows.py \
324 $(GENCODEDIR)/windows2.cpp $(GENCODEDIR)/windows2.py \
325 $(GENCODEDIR)/windows3.cpp $(GENCODEDIR)/windows3.py \
326 $(GENCODEDIR)/events.cpp $(GENCODEDIR)/events.py \
327 $(GENCODEDIR)/misc.cpp $(GENCODEDIR)/misc.py \
328 $(GENCODEDIR)/misc2.cpp $(GENCODEDIR)/misc2.py \
329 $(GENCODEDIR)/gdi.cpp $(GENCODEDIR)/gdi.py \
330 $(GENCODEDIR)/mdi.cpp $(GENCODEDIR)/mdi.py \
331 $(GENCODEDIR)/controls.cpp $(GENCODEDIR)/controls.py \
332 $(GENCODEDIR)/controls2.cpp $(GENCODEDIR)/controls2.py\
333 $(GENCODEDIR)/cmndlgs.cpp $(GENCODEDIR)/cmndlgs.py \
334 $(GENCODEDIR)/stattool.cpp $(GENCODEDIR)/stattool.py \
335 $(GENCODEDIR)/frames.cpp $(GENCODEDIR)/frames.py \
336 $(GENCODEDIR)/utils.cpp $(GENCODEDIR)/utils.py \
337 $(GENCODEDIR)/image.cpp $(GENCODEDIR)/image.py \
338 $(GENCODEDIR)/printfw.cpp $(GENCODEDIR)/printfw.py \
339 !if "$(WITH_GLCANVAS)" == "1"
340 $(GENCODEDIR)/glcanvas.cpp $(GENCODEDIR)/glcanvas.py \
349 wxPython\distrib\zipit.bat $(VERSION)
351 #------------------------------------------------------------------------