]> git.saurik.com Git - wxWidgets.git/blame - utils/wxPython/src/makefile.vc
some dist helpers for wxPython
[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#----------------------------------------------------------------------------
bb0054cd 12VERSION=2.1b1
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.
bb0054cd 35WXUSINGDLL=1
cf694132
RD
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)
bb0054cd 46SEPARATE=1
b8b8dda7 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
bb0054cd 77!include $(WXDIR)\src\makevc.env
7bf85405
RD
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 \
bb0054cd
RD
86 frames.obj windows3.obj image.obj printfw.obj \
87 misc2.obj \
b8b8dda7 88!if "$(SEPARATE)" == "0"
cf694132
RD
89 utils.obj \
90!if "$(WITH_GLCANVAS)" == "1"
91 glcanvas.obj
92!endif
b8b8dda7 93!else
9c039d08 94
cf694132
RD
95OTHERCFLAGS=$(OTHERCFLAGS) -DSEPARATE=1
96OTHERSWIGFLAGS=$(OTHERSWIGFLAGS) -DSEPARATE
b8b8dda7
RD
97TARGET2 = utilsc
98OBJECTS2 = utils.obj
99target2=$(TARGETDIR)\$(TARGET2).pyd
cf694132
RD
100
101TARGET3 = glcanvasc
102OBJECTS3 = glcanvas.obj
103target3=$(TARGETDIR)\$(TARGET3).pyd
b8b8dda7 104!endif
7bf85405 105
b8b8dda7 106PYMODULES = $(TARGETDIR)\wx.py $(TARGETDIR)\events.py \
7bf85405
RD
107 $(TARGETDIR)\windows.py $(TARGETDIR)\misc.py \
108 $(TARGETDIR)\gdi.py $(TARGETDIR)\mdi.py \
109 $(TARGETDIR)\controls.py $(TARGETDIR)\controls2.py \
110 $(TARGETDIR)\windows2.py $(TARGETDIR)\cmndlgs.py \
9c039d08 111 $(TARGETDIR)\stattool.py $(TARGETDIR)\frames.py \
cf694132
RD
112 $(TARGETDIR)\windows3.py $(TARGETDIR)\__init__.py \
113 $(TARGETDIR)\utils.py $(TARGETDIR)\image.py \
bb0054cd 114 $(TARGETDIR)\printfw.py $(TARGETDIR)\misc2.py \
cf694132
RD
115!if "$(WITH_GLCANVAS)" == "1"
116 $(TARGETDIR)\glcanvas.py
117!endif
7bf85405
RD
118
119#----------------------------------------------------------------------
120
121!if "$(FINAL)" == "0"
122DEBUGLFLAGS = /DEBUG /INCREMENTAL:YES
123!else
124DEBUGLFLAGS = /INCREMENTAL:NO
125!endif
126
cf694132 127LFLAGS= $(DEBUGLFLAGS) /DLL /subsystem:windows,3.50 /machine:I386 /nologo
b8b8dda7 128
7bf85405
RD
129#----------------------------------------------------------------------
130
cf694132 131default: $(TARGETDIR)\$(TARGET).pyd $(target2) $(target3) pycfiles
7bf85405 132
cf694132 133all: wx $(TARGET) $(TARGET2) $(TARGET3)
7bf85405
RD
134
135wx:
136 cd $(WXDIR)\src\msw
137 nmake -f makefile.nt FINAL=$(FINAL)
138 cd $(THISDIR)
139
140wxclean:
141 cd $(WXDIR)\src\msw
142 nmake -f makefile.nt clean
143 cd $(THISDIR)
144
145
146pycfiles : $(PYMODULES)
3b8b2387 147!if "$(COMPILEPY)" == "1"
7bf85405
RD
148 $(PYTHONDIR)\python $(PYTHONDIR)\Lib\compileall.py -l $(TARGETDIR)
149 $(PYTHONDIR)\python -O $(PYTHONDIR)\Lib\compileall.py -l $(TARGETDIR)
3b8b2387 150!endif
7bf85405
RD
151
152#----------------------------------------------------------------------
153
154$(TARGETDIR)\$(TARGET).pyd : $(DUMMYOBJ) $(WXLIB) $(OBJECTS) $(TARGET).res
155 $(link) @<<
156/out:$@ /dll
cf694132 157$(LFLAGS) /def:$(TARGET).def /implib:./$(TARGET).lib
7bf85405
RD
158$(DUMMYOBJ) $(OBJECTS) $(TARGET).res
159$(LIBS)
160<<
161
b8b8dda7
RD
162$(TARGETDIR)\$(TARGET2).pyd : $(DUMMYOBJ) $(WXLIB) $(OBJECTS2)
163 $(link) @<<
164/out:$@ /dll
cf694132 165$(LFLAGS) /def:$(TARGET2).def /implib:./$(TARGET2).lib
b8b8dda7 166$(DUMMYOBJ) $(OBJECTS2)
cf694132
RD
167$(LIBS) wxc.lib
168<<
169
170$(TARGETDIR)\$(TARGET3).pyd : $(DUMMYOBJ) $(WXLIB) $(OBJECTS3)
171 $(link) @<<
172/out:$@ /dll
173$(LFLAGS) /def:$(TARGET3).def /implib:./$(TARGET3).lib
174$(DUMMYOBJ) $(OBJECTS3)
175$(LIBS) $(WXDIR)\lib\glcanvas.lib glu32.lib opengl32.lib wxc.lib
b8b8dda7
RD
176<<
177
7bf85405
RD
178
179$(TARGET).res : $(TARGET).rc $(WXDIR)\include\wx\msw\wx.rc
180 $(rc) -r /i$(WXDIR)\include -fo$@ $(TARGET).rc
181
182
183
184# implicit rule for compiling .cpp files
185{}.cpp{}.obj:
186 $(cc) @<<
187$(CPPFLAGS) /c /Tp $<
188<<
189
b62bdb48
RD
190{$(GENCODEDIR)}.cpp{}.obj:
191 $(cc) @<<
192$(CPPFLAGS) /c /Tp $<
193<<
194
7bf85405
RD
195
196clean:
197 -erase *.obj
198 -erase *.exe
199 -erase *.res
200 -erase *.map
201 -erase *.sbr
202 -erase *.pdb
203 -erase *.pch
204 -erase $(TARGET).exp
205 -erase $(TARGET).lib
b8b8dda7
RD
206 -erase $(TARGETDIR)\$(TARGET).*
207!if "$(SEPARATE)" != "0"
208 -erase $(TARGET2).exp
209 -erase $(TARGET2).lib
210 -erase $(TARGETDIR)\$(TARGET2).*
cf694132
RD
211 -erase $(TARGET3).exp
212 -erase $(TARGET3).lib
213 -erase $(TARGETDIR)\$(TARGET3).*
b8b8dda7 214!endif
7bf85405
RD
215 -erase $(TARGETDIR)\$(TARGET).pyd
216 -erase $(TARGETDIR)\*.py
217 -erase $(TARGETDIR)\*.pyc
218 -erase $(TARGETDIR)\*.pyo
7bf85405
RD
219
220
af309447
RD
221showflags:
222 @echo $(CPPFLAGS)
7bf85405
RD
223
224#------------------------------------------------------------------------
225
226.SUFFIXES : .i .py
227
228# Implicit rules to run SWIG
b62bdb48
RD
229{}.i{$(GENCODEDIR)}.cpp:
230 swig $(SWIGFLAGS) -c -o $@ $<
7bf85405 231
b62bdb48
RD
232{}.i{$(GENCODEDIR)}.py:
233 swig $(SWIGFLAGS) -c -o $@ $<
b62bdb48
RD
234
235
236{$(GENCODEDIR)}.py{$(TARGETDIR)}.py:
237 copy $< $@
7bf85405
RD
238
239{}.py{$(TARGETDIR)}.py:
240 copy $< $@
241
242#{}.py{$(TARGETDIR)}.$(PYEXT):
243# $(PYTHON) -c "import py_compile; py_compile.compile('$<', '$@')"
244
245
246
247
248# This one must leave out the -c flag so we define the whole rule
b8b8dda7
RD
249$(GENCODEDIR)\wx.cpp $(GENCODEDIR)\wx.py : wx.i my_typemaps.i _defs.i _extras.py
250 swig $(SWIGFLAGS) -o $(GENCODEDIR)/wx.cpp wx.i
7bf85405
RD
251
252
8f89cfc1
RD
253# Define some dependencies. These MUST use forward slashes so SWIG
254# will write the shadow file to the right directory.
255$(GENCODEDIR)/windows.cpp $(GENCODEDIR)/windows.py : windows.i my_typemaps.i _defs.i
256$(GENCODEDIR)/windows2.cpp $(GENCODEDIR)/windows2.py : windows2.i my_typemaps.i _defs.i
08127323 257$(GENCODEDIR)/windows3.cpp $(GENCODEDIR)/windows3.py : windows3.i my_typemaps.i _defs.i
8f89cfc1
RD
258$(GENCODEDIR)/events.cpp $(GENCODEDIR)/events.py : events.i my_typemaps.i _defs.i
259$(GENCODEDIR)/misc.cpp $(GENCODEDIR)/misc.py : misc.i my_typemaps.i _defs.i
bb0054cd 260$(GENCODEDIR)/misc2.cpp $(GENCODEDIR)/misc2.py : misc2.i my_typemaps.i _defs.i
8f89cfc1
RD
261$(GENCODEDIR)/gdi.cpp $(GENCODEDIR)/gdi.py : gdi.i my_typemaps.i _defs.i
262$(GENCODEDIR)/mdi.cpp $(GENCODEDIR)/mdi.py : mdi.i my_typemaps.i _defs.i
263$(GENCODEDIR)/controls.cpp $(GENCODEDIR)/controls.py : controls.i my_typemaps.i _defs.i
264$(GENCODEDIR)/controls2.cpp $(GENCODEDIR)/controls2.py : controls2.i my_typemaps.i _defs.i
265$(GENCODEDIR)/cmndlgs.cpp $(GENCODEDIR)/cmndlgs.py : cmndlgs.i my_typemaps.i _defs.i
9c039d08
RD
266$(GENCODEDIR)/stattool.cpp $(GENCODEDIR)/stattool.py : stattool.i my_typemaps.i _defs.i
267$(GENCODEDIR)/frames.cpp $(GENCODEDIR)/frames.py : frames.i my_typemaps.i _defs.i
cf694132 268$(GENCODEDIR)/image.cpp $(GENCODEDIR)/image.py : image.i my_typemaps.i _defs.i
bb0054cd 269$(GENCODEDIR)/printfw.cpp $(GENCODEDIR)/printfw.py : printfw.i my_typemaps.i _defs.i
b62bdb48 270
b8b8dda7
RD
271!if "$(SEPARATE)" == "1"
272$(GENCODEDIR)\utils.cpp $(GENCODEDIR)\utils.py : utils.i my_typemaps.i
273 swig $(SWIGFLAGS) -o $(GENCODEDIR)/utils.cpp utils.i
cf694132
RD
274
275!if "$(WITH_GLCANVAS)" == "1"
276$(GENCODEDIR)\glcanvas.cpp $(GENCODEDIR)\glcanvas.py : glcanvas.i my_typemaps.i
277 swig $(SWIGFLAGS) -c -o $(GENCODEDIR)/glcanvas.cpp glcanvas.i
278!endif
b8b8dda7
RD
279!else
280$(GENCODEDIR)/utils.cpp $(GENCODEDIR)/utils.py : utils.i my_typemaps.i _defs.i
cf694132
RD
281!if "$(WITH_GLCANVAS)" == "1"
282$(GENCODEDIR)/glcanvas.cpp $(GENCODEDIR)/glcanvas.py : glcanvas.i my_typemaps.i _defs.i
283!endif
b8b8dda7
RD
284!endif
285
b62bdb48 286
b8b8dda7 287$(TARGETDIR)\wx.py : $(GENCODEDIR)\wx.py
b62bdb48
RD
288$(TARGETDIR)\windows.py : $(GENCODEDIR)\windows.py
289$(TARGETDIR)\windows2.py : $(GENCODEDIR)\windows2.py
08127323 290$(TARGETDIR)\windows3.py : $(GENCODEDIR)\windows3.py
b62bdb48
RD
291$(TARGETDIR)\events.py : $(GENCODEDIR)\events.py
292$(TARGETDIR)\misc.py : $(GENCODEDIR)\misc.py
bb0054cd 293$(TARGETDIR)\misc2.py : $(GENCODEDIR)\misc2.py
b62bdb48
RD
294$(TARGETDIR)\gdi.py : $(GENCODEDIR)\gdi.py
295$(TARGETDIR)\mdi.py : $(GENCODEDIR)\mdi.py
296$(TARGETDIR)\controls.py : $(GENCODEDIR)\controls.py
297$(TARGETDIR)\controls2.py : $(GENCODEDIR)\controls2.py
298$(TARGETDIR)\cmndlgs.py : $(GENCODEDIR)\cmndlgs.py
b8b8dda7 299$(TARGETDIR)\frames.py : $(GENCODEDIR)\frames.py
9c039d08 300$(TARGETDIR)\stattool.py : $(GENCODEDIR)\stattool.py
b62bdb48 301$(TARGETDIR)\__init__.py : __init__.py
cf694132 302$(TARGETDIR)\utils.py : $(GENCODEDIR)\utils.py
bb0054cd
RD
303$(TARGETDIR)\image.py : $(GENCODEDIR)\image.py
304$(TARGETDIR)\printfw.py : $(GENCODEDIR)\printfw.py
cf694132
RD
305!if "$(WITH_GLCANVAS)" == "1"
306$(TARGETDIR)\glcanvas.py : $(GENCODEDIR)\glcanvas.py
307!endif
7bf85405
RD
308
309
08127323
RD
310SOURCES = $(GENCODEDIR)\wx.cpp $(GENCODEDIR)\wx.py \
311 $(GENCODEDIR)/windows.cpp $(GENCODEDIR)/windows.py \
312 $(GENCODEDIR)/windows2.cpp $(GENCODEDIR)/windows2.py \
313 $(GENCODEDIR)/windows3.cpp $(GENCODEDIR)/windows3.py \
314 $(GENCODEDIR)/events.cpp $(GENCODEDIR)/events.py \
315 $(GENCODEDIR)/misc.cpp $(GENCODEDIR)/misc.py \
bb0054cd 316 $(GENCODEDIR)/misc2.cpp $(GENCODEDIR)/misc2.py \
08127323
RD
317 $(GENCODEDIR)/gdi.cpp $(GENCODEDIR)/gdi.py \
318 $(GENCODEDIR)/mdi.cpp $(GENCODEDIR)/mdi.py \
319 $(GENCODEDIR)/controls.cpp $(GENCODEDIR)/controls.py \
320 $(GENCODEDIR)/controls2.cpp $(GENCODEDIR)/controls2.py\
321 $(GENCODEDIR)/cmndlgs.cpp $(GENCODEDIR)/cmndlgs.py \
322 $(GENCODEDIR)/stattool.cpp $(GENCODEDIR)/stattool.py \
323 $(GENCODEDIR)/frames.cpp $(GENCODEDIR)/frames.py \
324 $(GENCODEDIR)/utils.cpp $(GENCODEDIR)/utils.py \
cf694132 325 $(GENCODEDIR)/image.cpp $(GENCODEDIR)/image.py \
bb0054cd 326 $(GENCODEDIR)/printfw.cpp $(GENCODEDIR)/printfw.py \
cf694132
RD
327!if "$(WITH_GLCANVAS)" == "1"
328 $(GENCODEDIR)/glcanvas.cpp $(GENCODEDIR)/glcanvas.py \
329!endif
08127323
RD
330
331
332sources : $(SOURCES)
333
73c5ed36
RD
334
335dist:
336 cd ..\..
337 wxPython\distrib\zipit.bat $(VERSION)
338
7bf85405
RD
339#------------------------------------------------------------------------
340#