]> git.saurik.com Git - wxWidgets.git/blob - utils/wxPython/src/makefile.vc
TreeCtrl indentation and spacing
[wxWidgets.git] / utils / wxPython / src / makefile.vc
1 #----------------------------------------------------------------------------
2 # Name: makefile.nt
3 # Purpose: Win32, VC++ 5/6 makefile for wxPython
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 #----------------------------------------------------------------------------
12 VERSION=2.0b9
13
14 # Set WXDIR to the root wxWindows directory for your system
15 WXDIR = $(WXWIN)
16
17 # Set this to the root of the Python installation
18 PYTHONDIR=e:\Tools\Python15
19
20 # Set this to 1 for a non-debug, optimised compile
21 FINAL=0
22
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
25 # named wxPython
26 TARGETDIR=..
27
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.
31 COMPILEPY=0
32
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
39 WXP_USE_THREAD=1
40
41
42 # Set this if you want to build the wxGLCanvas
43 WITH_GLCANVAS=1
44
45 # (experimental)
46 SEPARATE=0
47
48 #----------------------------------------------------------------------
49
50 !if "$(WXP_USE_THREAD)" == "1"
51 THREAD=-DWXP_USE_THREAD=1
52 !endif
53
54 #----------------------------------------------------------------------
55
56 NOPCH=1
57 THISDIR=$(WXDIR)\utils\wxPython
58
59
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)
65
66
67 !if "$(WITH_GLCANVAS)" == "1"
68 GLLIBS=$(WXDIR)\lib\glcanvas.lib glu32.lib opengl32.lib
69 OTHERSWIGFLAGS=-DWITH_GLCANVAS
70 OTHERCFLAGS=-DWITH_GLCANVAS
71 !endif
72
73 SWIGFLAGS=-c++ -shadow -python -dnone -D__WXMSW__ $(OTHERSWIGFLAGS)
74 GENCODEDIR=msw
75
76
77 !include $(WXDIR)\src\ntwxwin.mak
78
79 #----------------------------------------------------------------------
80
81 TARGET = wxc
82
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"
88 utils.obj \
89 !if "$(WITH_GLCANVAS)" == "1"
90 glcanvas.obj
91 !endif
92 !else
93
94 OTHERCFLAGS=$(OTHERCFLAGS) -DSEPARATE=1
95 OTHERSWIGFLAGS=$(OTHERSWIGFLAGS) -DSEPARATE
96 TARGET2 = utilsc
97 OBJECTS2 = utils.obj
98 target2=$(TARGETDIR)\$(TARGET2).pyd
99
100 TARGET3 = glcanvasc
101 OBJECTS3 = glcanvas.obj
102 target3=$(TARGETDIR)\$(TARGET3).pyd
103 !endif
104
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
115 !endif
116
117 #----------------------------------------------------------------------
118
119 !if "$(FINAL)" == "0"
120 DEBUGLFLAGS = /DEBUG /INCREMENTAL:YES
121 !else
122 DEBUGLFLAGS = /INCREMENTAL:NO
123 !endif
124
125 LFLAGS= $(DEBUGLFLAGS) /DLL /subsystem:windows,3.50 /machine:I386 /nologo
126
127 #----------------------------------------------------------------------
128
129 default: $(TARGETDIR)\$(TARGET).pyd $(target2) $(target3) pycfiles
130
131 all: wx $(TARGET) $(TARGET2) $(TARGET3)
132
133 wx:
134 cd $(WXDIR)\src\msw
135 nmake -f makefile.nt FINAL=$(FINAL)
136 cd $(THISDIR)
137
138 wxclean:
139 cd $(WXDIR)\src\msw
140 nmake -f makefile.nt clean
141 cd $(THISDIR)
142
143
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)
148 !endif
149
150 #----------------------------------------------------------------------
151
152 $(TARGETDIR)\$(TARGET).pyd : $(DUMMYOBJ) $(WXLIB) $(OBJECTS) $(TARGET).res
153 $(link) @<<
154 /out:$@ /dll
155 $(LFLAGS) /def:$(TARGET).def /implib:./$(TARGET).lib
156 $(DUMMYOBJ) $(OBJECTS) $(TARGET).res
157 $(LIBS)
158 <<
159
160 $(TARGETDIR)\$(TARGET2).pyd : $(DUMMYOBJ) $(WXLIB) $(OBJECTS2)
161 $(link) @<<
162 /out:$@ /dll
163 $(LFLAGS) /def:$(TARGET2).def /implib:./$(TARGET2).lib
164 $(DUMMYOBJ) $(OBJECTS2)
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
174 <<
175
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
188 {$(GENCODEDIR)}.cpp{}.obj:
189 $(cc) @<<
190 $(CPPFLAGS) /c /Tp $<
191 <<
192
193
194 clean:
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
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).*
212 !endif
213 -erase $(TARGETDIR)\$(TARGET).pyd
214 -erase $(TARGETDIR)\*.py
215 -erase $(TARGETDIR)\*.pyc
216 -erase $(TARGETDIR)\*.pyo
217
218
219 showflags:
220 @echo $(CPPFLAGS)
221
222 #------------------------------------------------------------------------
223
224 .SUFFIXES : .i .py
225
226 # Implicit rules to run SWIG
227 {}.i{$(GENCODEDIR)}.cpp:
228 swig $(SWIGFLAGS) -c -o $@ $<
229
230 {}.i{$(GENCODEDIR)}.py:
231 swig $(SWIGFLAGS) -c -o $@ $<
232
233
234 {$(GENCODEDIR)}.py{$(TARGETDIR)}.py:
235 copy $< $@
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
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
249
250
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
266
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
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
275 !else
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
279 !endif
280 !endif
281
282
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
301 !endif
302
303
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 \
321 !endif
322
323
324 sources : $(SOURCES)
325
326
327 dist:
328 cd ..\..
329 wxPython\distrib\zipit.bat $(VERSION)
330
331 #------------------------------------------------------------------------
332 #