]>
Commit | Line | Data |
---|---|---|
1 | # -*- makefile -*- | |
2 | #---------------------------------------------------------------------------- | |
3 | # Name: makefile.nt | |
4 | # Purpose: Win32, VC++ 5/6 makefile for wxPython | |
5 | # | |
6 | # Author: Robin Dunn | |
7 | # | |
8 | # Created: 3/27/97 | |
9 | # RCS-ID: $Id$ | |
10 | # Copyright: (c) 1998 by Total Control Software | |
11 | # Licence: wxWindows license | |
12 | #---------------------------------------------------------------------------- | |
13 | VERSION=2.1b3 | |
14 | ||
15 | # Set WXDIR to the root wxWindows directory for your system | |
16 | WXDIR = $(WXWIN) | |
17 | ||
18 | # Set this to the root of the Python installation | |
19 | PYTHONDIR=e:\Tools\Python15 | |
20 | ||
21 | # Set this to 1 for a non-debug, optimised compile | |
22 | FINAL=0 | |
23 | ||
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 | |
26 | # named wxPython | |
27 | TARGETDIR=.. | |
28 | ||
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. | |
32 | COMPILEPY=0 | |
33 | ||
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. | |
36 | WXUSINGDLL=1 | |
37 | ||
38 | # If you want to compile in code to aquire/release the Python | |
39 | # Interpreter Lock at the appropriate places | |
40 | WXP_USE_THREAD=1 | |
41 | ||
42 | ||
43 | # Set this if you want to build the wxGLCanvas | |
44 | WITH_GLCANVAS=1 | |
45 | ||
46 | # (experimental) | |
47 | SEPARATE=1 | |
48 | ||
49 | #---------------------------------------------------------------------- | |
50 | ||
51 | !if "$(WXP_USE_THREAD)" == "1" | |
52 | THREAD=-DWXP_USE_THREAD=1 | |
53 | !endif | |
54 | ||
55 | #---------------------------------------------------------------------- | |
56 | ||
57 | NOPCH=1 | |
58 | THISDIR=$(WXDIR)\utils\wxPython | |
59 | ||
60 | ||
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) | |
66 | ||
67 | ||
68 | !if "$(WITH_GLCANVAS)" == "1" | |
69 | GLLIBS=$(WXDIR)\lib\glcanvas.lib glu32.lib opengl32.lib | |
70 | OTHERSWIGFLAGS=-DWITH_GLCANVAS | |
71 | OTHERCFLAGS=-DWITH_GLCANVAS | |
72 | !endif | |
73 | ||
74 | SWIGFLAGS=-c++ -shadow -python -dnone -D__WXMSW__ $(OTHERSWIGFLAGS) | |
75 | GENCODEDIR=msw | |
76 | ||
77 | ||
78 | !include $(WXDIR)\src\makevc.env | |
79 | ||
80 | #---------------------------------------------------------------------- | |
81 | ||
82 | TARGET = wxc | |
83 | ||
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 \ | |
89 | misc2.obj \ | |
90 | !if "$(SEPARATE)" == "0" | |
91 | utils.obj \ | |
92 | !if "$(WITH_GLCANVAS)" == "1" | |
93 | glcanvas.obj | |
94 | !endif | |
95 | !else | |
96 | ||
97 | OTHERCFLAGS=$(OTHERCFLAGS) -DSEPARATE=1 | |
98 | OTHERSWIGFLAGS=$(OTHERSWIGFLAGS) -DSEPARATE | |
99 | TARGET2 = utilsc | |
100 | OBJECTS2 = utils.obj | |
101 | target2=$(TARGETDIR)\$(TARGET2).pyd | |
102 | ||
103 | TARGET3 = glcanvasc | |
104 | OBJECTS3 = glcanvas.obj | |
105 | target3=$(TARGETDIR)\$(TARGET3).pyd | |
106 | ||
107 | #TARGET4 = oglcc | |
108 | #OBJECTS4 = ogl.obj | |
109 | #target4=$(TARGETDIR)\$(TARGET4).pyd | |
110 | !endif | |
111 | ||
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 | |
123 | !endif | |
124 | ||
125 | #---------------------------------------------------------------------- | |
126 | ||
127 | !if "$(FINAL)" == "0" | |
128 | DEBUGLFLAGS = /DEBUG /INCREMENTAL:YES | |
129 | !else | |
130 | DEBUGLFLAGS = /INCREMENTAL:NO | |
131 | !endif | |
132 | ||
133 | LFLAGS= $(DEBUGLFLAGS) /DLL /subsystem:windows,3.50 /machine:I386 /nologo | |
134 | ||
135 | #---------------------------------------------------------------------- | |
136 | ||
137 | default: $(TARGETDIR)\$(TARGET).pyd $(target2) $(target3) pycfiles | |
138 | ||
139 | all: wx $(TARGET) $(TARGET2) $(TARGET3) | |
140 | ||
141 | wx: | |
142 | cd $(WXDIR)\src\msw | |
143 | nmake -f makefile.nt FINAL=$(FINAL) | |
144 | cd $(THISDIR) | |
145 | ||
146 | wxclean: | |
147 | cd $(WXDIR)\src\msw | |
148 | nmake -f makefile.nt clean | |
149 | cd $(THISDIR) | |
150 | ||
151 | ||
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) | |
156 | !endif | |
157 | ||
158 | #---------------------------------------------------------------------- | |
159 | ||
160 | $(TARGETDIR)\$(TARGET).pyd : $(DUMMYOBJ) $(WXLIB) $(OBJECTS) $(TARGET).res | |
161 | $(link) @<< | |
162 | /out:$@ /dll | |
163 | $(LFLAGS) /def:$(TARGET).def /implib:./$(TARGET).lib | |
164 | $(DUMMYOBJ) $(OBJECTS) $(TARGET).res | |
165 | $(LIBS) | |
166 | << | |
167 | ||
168 | $(TARGETDIR)\$(TARGET2).pyd : $(DUMMYOBJ) $(WXLIB) $(OBJECTS2) | |
169 | $(link) @<< | |
170 | /out:$@ /dll | |
171 | $(LFLAGS) /def:$(TARGET2).def /implib:./$(TARGET2).lib | |
172 | $(DUMMYOBJ) $(OBJECTS2) | |
173 | $(LIBS) wxc.lib | |
174 | << | |
175 | ||
176 | $(TARGETDIR)\$(TARGET3).pyd : $(DUMMYOBJ) $(WXLIB) $(OBJECTS3) | |
177 | $(link) @<< | |
178 | /out:$@ /dll | |
179 | $(LFLAGS) /def:$(TARGET3).def /implib:./$(TARGET3).lib | |
180 | $(DUMMYOBJ) $(OBJECTS3) | |
181 | $(LIBS) $(WXDIR)\lib\glcanvas.lib glu32.lib opengl32.lib wxc.lib | |
182 | << | |
183 | ||
184 | ||
185 | #$(TARGETDIR)\$(TARGET4).pyd : $(DUMMYOBJ) $(WXLIB) $(OBJECTS4) | |
186 | # $(link) @<< | |
187 | #/out:$@ /dll | |
188 | #$(LFLAGS) /def:$(TARGET4).def /implib:./$(TARGET4).lib | |
189 | #$(DUMMYOBJ) $(OBJECTS4) | |
190 | #$(LIBS) wxc.lib $(WXDIR)\lib\ogl$(LIBEXT).lib | |
191 | #<< | |
192 | ||
193 | ||
194 | $(TARGET).res : $(TARGET).rc $(WXDIR)\include\wx\msw\wx.rc | |
195 | $(rc) -r /i$(WXDIR)\include -fo$@ $(TARGET).rc | |
196 | ||
197 | ||
198 | ||
199 | # implicit rule for compiling .cpp and .c files | |
200 | {}.cpp{}.obj: | |
201 | $(cc) @<< | |
202 | $(CPPFLAGS) /c /Tp $< | |
203 | << | |
204 | ||
205 | {$(GENCODEDIR)}.cpp{}.obj: | |
206 | $(cc) @<< | |
207 | $(CPPFLAGS) /c /Tp $< | |
208 | << | |
209 | ||
210 | {}.c{}.obj: | |
211 | $(cc) @<< | |
212 | $(CPPFLAGS) /c $< | |
213 | << | |
214 | ||
215 | ||
216 | clean: | |
217 | -erase *.obj | |
218 | -erase *.exe | |
219 | -erase *.res | |
220 | -erase *.map | |
221 | -erase *.sbr | |
222 | -erase *.pdb | |
223 | -erase *.pch | |
224 | -erase $(TARGET).exp | |
225 | -erase $(TARGET).lib | |
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).* | |
237 | !endif | |
238 | -erase $(TARGETDIR)\$(TARGET).pyd | |
239 | -erase $(TARGETDIR)\*.py | |
240 | -erase $(TARGETDIR)\*.pyc | |
241 | -erase $(TARGETDIR)\*.pyo | |
242 | ||
243 | ||
244 | showflags: | |
245 | @echo $(CPPFLAGS) | |
246 | ||
247 | #------------------------------------------------------------------------ | |
248 | ||
249 | .SUFFIXES : .i .py | |
250 | ||
251 | # Implicit rules to run SWIG | |
252 | {}.i{$(GENCODEDIR)}.cpp: | |
253 | swig $(SWIGFLAGS) -c -o $@ $< | |
254 | ||
255 | {}.i{$(GENCODEDIR)}.py: | |
256 | swig $(SWIGFLAGS) -c -o $@ $< | |
257 | ||
258 | ||
259 | {$(GENCODEDIR)}.py{$(TARGETDIR)}.py: | |
260 | copy $< $@ | |
261 | ||
262 | {}.py{$(TARGETDIR)}.py: | |
263 | copy $< $@ | |
264 | ||
265 | #{}.py{$(TARGETDIR)}.$(PYEXT): | |
266 | # $(PYTHON) -c "import py_compile; py_compile.compile('$<', '$@')" | |
267 | ||
268 | ||
269 | ||
270 | ||
271 | ||
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 | |
290 | ||
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 | |
294 | ||
295 | ||
296 | ||
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 | |
316 | ||
317 | !if "$(WITH_GLCANVAS)" == "1" | |
318 | $(TARGETDIR)\glcanvas.py : $(GENCODEDIR)\glcanvas.py | |
319 | !endif | |
320 | ||
321 | ||
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 \ | |
341 | !endif | |
342 | ||
343 | ||
344 | sources : $(SOURCES) | |
345 | ||
346 | ||
347 | dist: | |
348 | cd ..\.. | |
349 | wxPython\distrib\zipit.bat $(VERSION) | |
350 | ||
351 | #------------------------------------------------------------------------ | |
352 | # | |
353 | ||
354 |