]>
Commit | Line | Data |
---|---|---|
8bf5d46e | 1 | # -*- makefile -*- |
7bf85405 RD |
2 | #---------------------------------------------------------------------------- |
3 | # Name: makefile.nt | |
af309447 | 4 | # Purpose: Win32, VC++ 5/6 makefile for wxPython |
7bf85405 RD |
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 | #---------------------------------------------------------------------------- | |
1d99702e | 13 | VERSION=2.1b3 |
7bf85405 RD |
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 | |
b8b8dda7 RD |
25 | # be a directory contained in a PYTHONPATH directory, and should be |
26 | # named wxPython | |
7bf85405 RD |
27 | TARGETDIR=.. |
28 | ||
3b8b2387 | 29 | # Set this to 1 for make to pre-compile the Python modules, 0 to |
cf694132 RD |
30 | # just copy the sources and let Python compile them the first |
31 | # time they are imported. | |
3b8b2387 | 32 | COMPILEPY=0 |
7bf85405 | 33 | |
cf694132 RD |
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. | |
bb0054cd | 36 | WXUSINGDLL=1 |
cf694132 RD |
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 | |
af309447 RD |
45 | |
46 | # (experimental) | |
bb0054cd | 47 | SEPARATE=1 |
b8b8dda7 | 48 | |
7bf85405 RD |
49 | #---------------------------------------------------------------------- |
50 | ||
cf694132 RD |
51 | !if "$(WXP_USE_THREAD)" == "1" |
52 | THREAD=-DWXP_USE_THREAD=1 | |
53 | !endif | |
54 | ||
55 | #---------------------------------------------------------------------- | |
56 | ||
7bf85405 RD |
57 | NOPCH=1 |
58 | THISDIR=$(WXDIR)\utils\wxPython | |
59 | ||
cf694132 RD |
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) | |
2ea09579 | 66 | |
7bf85405 | 67 | |
cf694132 RD |
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 | ||
0699c864 | 74 | SWIGFLAGS=-c++ -shadow -python -dnone -D__WXMSW__ $(OTHERSWIGFLAGS) |
b62bdb48 | 75 | GENCODEDIR=msw |
7bf85405 RD |
76 | |
77 | ||
bb0054cd | 78 | !include $(WXDIR)\src\makevc.env |
7bf85405 RD |
79 | |
80 | #---------------------------------------------------------------------- | |
81 | ||
b8b8dda7 | 82 | TARGET = wxc |
7bf85405 | 83 | |
1d99702e | 84 | OBJECTS = helpers.obj libpy.obj \ |
009a1c89 | 85 | wx.obj windows.obj events.obj \ |
7bf85405 | 86 | misc.obj gdi.obj mdi.obj controls.obj \ |
9c039d08 | 87 | controls2.obj windows2.obj cmndlgs.obj stattool.obj \ |
009a1c89 | 88 | frames.obj windows3.obj image.obj printfw.obj \ |
8bf5d46e | 89 | misc2.obj \ |
b8b8dda7 | 90 | !if "$(SEPARATE)" == "0" |
8bf5d46e | 91 | utils.obj \ |
cf694132 RD |
92 | !if "$(WITH_GLCANVAS)" == "1" |
93 | glcanvas.obj | |
94 | !endif | |
b8b8dda7 | 95 | !else |
9c039d08 | 96 | |
cf694132 RD |
97 | OTHERCFLAGS=$(OTHERCFLAGS) -DSEPARATE=1 |
98 | OTHERSWIGFLAGS=$(OTHERSWIGFLAGS) -DSEPARATE | |
b8b8dda7 RD |
99 | TARGET2 = utilsc |
100 | OBJECTS2 = utils.obj | |
101 | target2=$(TARGETDIR)\$(TARGET2).pyd | |
cf694132 RD |
102 | |
103 | TARGET3 = glcanvasc | |
104 | OBJECTS3 = glcanvas.obj | |
105 | target3=$(TARGETDIR)\$(TARGET3).pyd | |
8bf5d46e | 106 | |
009a1c89 RD |
107 | #TARGET4 = oglcc |
108 | #OBJECTS4 = ogl.obj | |
109 | #target4=$(TARGETDIR)\$(TARGET4).pyd | |
b8b8dda7 | 110 | !endif |
7bf85405 | 111 | |
b8b8dda7 | 112 | PYMODULES = $(TARGETDIR)\wx.py $(TARGETDIR)\events.py \ |
7bf85405 RD |
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 \ | |
9c039d08 | 117 | $(TARGETDIR)\stattool.py $(TARGETDIR)\frames.py \ |
cf694132 RD |
118 | $(TARGETDIR)\windows3.py $(TARGETDIR)\__init__.py \ |
119 | $(TARGETDIR)\utils.py $(TARGETDIR)\image.py \ | |
bb0054cd | 120 | $(TARGETDIR)\printfw.py $(TARGETDIR)\misc2.py \ |
cf694132 RD |
121 | !if "$(WITH_GLCANVAS)" == "1" |
122 | $(TARGETDIR)\glcanvas.py | |
123 | !endif | |
7bf85405 RD |
124 | |
125 | #---------------------------------------------------------------------- | |
126 | ||
127 | !if "$(FINAL)" == "0" | |
128 | DEBUGLFLAGS = /DEBUG /INCREMENTAL:YES | |
129 | !else | |
130 | DEBUGLFLAGS = /INCREMENTAL:NO | |
131 | !endif | |
132 | ||
cf694132 | 133 | LFLAGS= $(DEBUGLFLAGS) /DLL /subsystem:windows,3.50 /machine:I386 /nologo |
b8b8dda7 | 134 | |
7bf85405 RD |
135 | #---------------------------------------------------------------------- |
136 | ||
cf694132 | 137 | default: $(TARGETDIR)\$(TARGET).pyd $(target2) $(target3) pycfiles |
7bf85405 | 138 | |
cf694132 | 139 | all: wx $(TARGET) $(TARGET2) $(TARGET3) |
7bf85405 RD |
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) | |
3b8b2387 | 153 | !if "$(COMPILEPY)" == "1" |
7bf85405 RD |
154 | $(PYTHONDIR)\python $(PYTHONDIR)\Lib\compileall.py -l $(TARGETDIR) |
155 | $(PYTHONDIR)\python -O $(PYTHONDIR)\Lib\compileall.py -l $(TARGETDIR) | |
3b8b2387 | 156 | !endif |
7bf85405 RD |
157 | |
158 | #---------------------------------------------------------------------- | |
159 | ||
160 | $(TARGETDIR)\$(TARGET).pyd : $(DUMMYOBJ) $(WXLIB) $(OBJECTS) $(TARGET).res | |
161 | $(link) @<< | |
162 | /out:$@ /dll | |
cf694132 | 163 | $(LFLAGS) /def:$(TARGET).def /implib:./$(TARGET).lib |
7bf85405 RD |
164 | $(DUMMYOBJ) $(OBJECTS) $(TARGET).res |
165 | $(LIBS) | |
166 | << | |
167 | ||
b8b8dda7 RD |
168 | $(TARGETDIR)\$(TARGET2).pyd : $(DUMMYOBJ) $(WXLIB) $(OBJECTS2) |
169 | $(link) @<< | |
170 | /out:$@ /dll | |
cf694132 | 171 | $(LFLAGS) /def:$(TARGET2).def /implib:./$(TARGET2).lib |
b8b8dda7 | 172 | $(DUMMYOBJ) $(OBJECTS2) |
cf694132 RD |
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 | |
b8b8dda7 RD |
182 | << |
183 | ||
7bf85405 | 184 | |
009a1c89 RD |
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 | #<< | |
8bf5d46e RD |
192 | |
193 | ||
7bf85405 RD |
194 | $(TARGET).res : $(TARGET).rc $(WXDIR)\include\wx\msw\wx.rc |
195 | $(rc) -r /i$(WXDIR)\include -fo$@ $(TARGET).rc | |
196 | ||
197 | ||
198 | ||
009a1c89 | 199 | # implicit rule for compiling .cpp and .c files |
7bf85405 RD |
200 | {}.cpp{}.obj: |
201 | $(cc) @<< | |
202 | $(CPPFLAGS) /c /Tp $< | |
203 | << | |
204 | ||
b62bdb48 RD |
205 | {$(GENCODEDIR)}.cpp{}.obj: |
206 | $(cc) @<< | |
207 | $(CPPFLAGS) /c /Tp $< | |
208 | << | |
209 | ||
009a1c89 RD |
210 | {}.c{}.obj: |
211 | $(cc) @<< | |
212 | $(CPPFLAGS) /c $< | |
213 | << | |
214 | ||
7bf85405 RD |
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 | |
b8b8dda7 RD |
226 | -erase $(TARGETDIR)\$(TARGET).* |
227 | !if "$(SEPARATE)" != "0" | |
228 | -erase $(TARGET2).exp | |
229 | -erase $(TARGET2).lib | |
230 | -erase $(TARGETDIR)\$(TARGET2).* | |
cf694132 RD |
231 | -erase $(TARGET3).exp |
232 | -erase $(TARGET3).lib | |
233 | -erase $(TARGETDIR)\$(TARGET3).* | |
009a1c89 RD |
234 | # -erase $(TARGET4).exp |
235 | # -erase $(TARGET4).lib | |
236 | # -erase $(TARGETDIR)\$(TARGET4).* | |
b8b8dda7 | 237 | !endif |
7bf85405 RD |
238 | -erase $(TARGETDIR)\$(TARGET).pyd |
239 | -erase $(TARGETDIR)\*.py | |
240 | -erase $(TARGETDIR)\*.pyc | |
241 | -erase $(TARGETDIR)\*.pyo | |
7bf85405 RD |
242 | |
243 | ||
af309447 RD |
244 | showflags: |
245 | @echo $(CPPFLAGS) | |
7bf85405 RD |
246 | |
247 | #------------------------------------------------------------------------ | |
248 | ||
249 | .SUFFIXES : .i .py | |
250 | ||
251 | # Implicit rules to run SWIG | |
b62bdb48 RD |
252 | {}.i{$(GENCODEDIR)}.cpp: |
253 | swig $(SWIGFLAGS) -c -o $@ $< | |
7bf85405 | 254 | |
b62bdb48 RD |
255 | {}.i{$(GENCODEDIR)}.py: |
256 | swig $(SWIGFLAGS) -c -o $@ $< | |
b62bdb48 RD |
257 | |
258 | ||
259 | {$(GENCODEDIR)}.py{$(TARGETDIR)}.py: | |
260 | copy $< $@ | |
7bf85405 RD |
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 | ||
7bf85405 | 271 | |
8f89cfc1 RD |
272 | # Define some dependencies. These MUST use forward slashes so SWIG |
273 | # will write the shadow file to the right directory. | |
009a1c89 | 274 | $(GENCODEDIR)/wx.cpp $(GENCODEDIR)/wx.py : wx.i my_typemaps.i _defs.i |
8f89cfc1 RD |
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 | |
08127323 | 277 | $(GENCODEDIR)/windows3.cpp $(GENCODEDIR)/windows3.py : windows3.i my_typemaps.i _defs.i |
8f89cfc1 RD |
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 | |
bb0054cd | 280 | $(GENCODEDIR)/misc2.cpp $(GENCODEDIR)/misc2.py : misc2.i my_typemaps.i _defs.i |
8f89cfc1 RD |
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 | |
9c039d08 RD |
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 | |
cf694132 | 288 | $(GENCODEDIR)/image.cpp $(GENCODEDIR)/image.py : image.i my_typemaps.i _defs.i |
bb0054cd | 289 | $(GENCODEDIR)/printfw.cpp $(GENCODEDIR)/printfw.py : printfw.i my_typemaps.i _defs.i |
b62bdb48 | 290 | |
8bf5d46e | 291 | $(GENCODEDIR)/utils.cpp $(GENCODEDIR)/utils.py : utils.i my_typemaps.i _defs.i |
009a1c89 RD |
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 | ||
b8b8dda7 | 295 | |
b62bdb48 | 296 | |
b8b8dda7 | 297 | $(TARGETDIR)\wx.py : $(GENCODEDIR)\wx.py |
b62bdb48 RD |
298 | $(TARGETDIR)\windows.py : $(GENCODEDIR)\windows.py |
299 | $(TARGETDIR)\windows2.py : $(GENCODEDIR)\windows2.py | |
08127323 | 300 | $(TARGETDIR)\windows3.py : $(GENCODEDIR)\windows3.py |
b62bdb48 RD |
301 | $(TARGETDIR)\events.py : $(GENCODEDIR)\events.py |
302 | $(TARGETDIR)\misc.py : $(GENCODEDIR)\misc.py | |
bb0054cd | 303 | $(TARGETDIR)\misc2.py : $(GENCODEDIR)\misc2.py |
b62bdb48 RD |
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 | |
b8b8dda7 | 309 | $(TARGETDIR)\frames.py : $(GENCODEDIR)\frames.py |
9c039d08 | 310 | $(TARGETDIR)\stattool.py : $(GENCODEDIR)\stattool.py |
b62bdb48 | 311 | $(TARGETDIR)\__init__.py : __init__.py |
cf694132 | 312 | $(TARGETDIR)\utils.py : $(GENCODEDIR)\utils.py |
bb0054cd RD |
313 | $(TARGETDIR)\image.py : $(GENCODEDIR)\image.py |
314 | $(TARGETDIR)\printfw.py : $(GENCODEDIR)\printfw.py | |
009a1c89 | 315 | #$(TARGETDIR)\ogl.py : $(GENCODEDIR)\ogl.py |
8bf5d46e | 316 | |
cf694132 RD |
317 | !if "$(WITH_GLCANVAS)" == "1" |
318 | $(TARGETDIR)\glcanvas.py : $(GENCODEDIR)\glcanvas.py | |
319 | !endif | |
7bf85405 RD |
320 | |
321 | ||
009a1c89 | 322 | SOURCES = $(GENCODEDIR)/wx.cpp $(GENCODEDIR)/wx.py \ |
08127323 RD |
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 \ | |
bb0054cd | 328 | $(GENCODEDIR)/misc2.cpp $(GENCODEDIR)/misc2.py \ |
08127323 RD |
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 \ | |
cf694132 | 337 | $(GENCODEDIR)/image.cpp $(GENCODEDIR)/image.py \ |
bb0054cd | 338 | $(GENCODEDIR)/printfw.cpp $(GENCODEDIR)/printfw.py \ |
cf694132 RD |
339 | !if "$(WITH_GLCANVAS)" == "1" |
340 | $(GENCODEDIR)/glcanvas.cpp $(GENCODEDIR)/glcanvas.py \ | |
341 | !endif | |
08127323 RD |
342 | |
343 | ||
344 | sources : $(SOURCES) | |
345 | ||
73c5ed36 RD |
346 | |
347 | dist: | |
348 | cd ..\.. | |
349 | wxPython\distrib\zipit.bat $(VERSION) | |
350 | ||
7bf85405 RD |
351 | #------------------------------------------------------------------------ |
352 | # | |
009a1c89 RD |
353 | |
354 |