]> git.saurik.com Git - wxWidgets.git/blob - utils/wxPython/src/makefile.vc
Changes needed to enable wxGTK compatibility.
[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.0b5
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 at the first
30 # runtime.
31 COMPILEPY=0
32
33 # If your wxWindows is built as a DLL, set this to 1. Using 0 means
34 # that wxWindows will be staticaly linked with wxPython.
35 WXUSINGDLL=1
36
37 # (experimental)
38 SEPARATE=0
39
40 #----------------------------------------------------------------------
41
42 NOPCH=1
43 THISDIR=$(WXDIR)\utils\wxPython
44
45 EXTRALIBS=$(PYTHONDIR)\libs\python15.lib
46 EXTRAINC=-I$(PYTHONDIR)\include -I.
47 EXTRAFLAGS=/Fpwxp.pch /YXhelpers.h -DSWIG_GLOBAL -DHAVE_CONFIG_H
48 OVERRIDEFLAGS=/GX- /DwxUSE_GLOBAL_MEMORY_OPERATORS=0
49
50
51 SWIGFLAGS=-c++ -shadow -python -dnone -D__WXMSW__
52 GENCODEDIR=msw
53
54
55 !include $(WXDIR)\src\ntwxwin.mak
56
57 #----------------------------------------------------------------------
58
59 TARGET = wxc
60
61 OBJECTS = wx.obj helpers.obj windows.obj events.obj \
62 misc.obj gdi.obj mdi.obj controls.obj \
63 controls2.obj windows2.obj cmndlgs.obj stattool.obj \
64 frames.obj windows3.obj \
65 !if "$(SEPARATE)" == "0"
66 utils.obj
67 !else
68
69 TARGET2 = utilsc
70 OBJECTS2 = utils.obj
71 target2=$(TARGETDIR)\$(TARGET2).pyd
72 !endif
73
74 PYMODULES = $(TARGETDIR)\wx.py $(TARGETDIR)\events.py \
75 $(TARGETDIR)\windows.py $(TARGETDIR)\misc.py \
76 $(TARGETDIR)\gdi.py $(TARGETDIR)\mdi.py \
77 $(TARGETDIR)\controls.py $(TARGETDIR)\controls2.py \
78 $(TARGETDIR)\windows2.py $(TARGETDIR)\cmndlgs.py \
79 $(TARGETDIR)\stattool.py $(TARGETDIR)\frames.py \
80 $(TARGETDIR)\utils.py $(TARGETDIR)\windows3.py \
81 $(TARGETDIR)\__init__.py
82
83
84 #----------------------------------------------------------------------
85
86 !if "$(FINAL)" == "0"
87 DEBUGLFLAGS = /DEBUG /INCREMENTAL:YES
88 !else
89 DEBUGLFLAGS = /INCREMENTAL:NO
90 !endif
91
92 LFLAGS= $(DEBUGLFLAGS) /DLL /def:$(TARGET).def /subsystem:windows,3.50 \
93 /machine:I386 /implib:./$(TARGET).lib /nologo
94
95 LFLAGS2=$(DEBUGLFLAGS) /DLL /def:$(TARGET2).def /subsystem:windows,3.50 \
96 /machine:I386 /implib:./$(TARGET2).lib /nologo
97
98 #----------------------------------------------------------------------
99
100 default: $(TARGETDIR)\$(TARGET).pyd $(target2) pycfiles
101
102 all: wx $(TARGET) $(TARGET2)
103
104 wx:
105 cd $(WXDIR)\src\msw
106 nmake -f makefile.nt FINAL=$(FINAL)
107 cd $(THISDIR)
108
109 wxclean:
110 cd $(WXDIR)\src\msw
111 nmake -f makefile.nt clean
112 cd $(THISDIR)
113
114
115 pycfiles : $(PYMODULES)
116 !if "$(COMPILEPY)" == "1"
117 $(PYTHONDIR)\python $(PYTHONDIR)\Lib\compileall.py -l $(TARGETDIR)
118 $(PYTHONDIR)\python -O $(PYTHONDIR)\Lib\compileall.py -l $(TARGETDIR)
119 !endif
120
121 #----------------------------------------------------------------------
122
123 $(TARGETDIR)\$(TARGET).pyd : $(DUMMYOBJ) $(WXLIB) $(OBJECTS) $(TARGET).res
124 $(link) @<<
125 /out:$@ /dll
126 $(LFLAGS)
127 $(DUMMYOBJ) $(OBJECTS) $(TARGET).res
128 $(LIBS)
129 <<
130
131 $(TARGETDIR)\$(TARGET2).pyd : $(DUMMYOBJ) $(WXLIB) $(OBJECTS2)
132 $(link) @<<
133 /out:$@ /dll
134 $(LFLAGS2)
135 $(DUMMYOBJ) $(OBJECTS2)
136 $(LIBS)
137 <<
138
139
140 $(TARGET).res : $(TARGET).rc $(WXDIR)\include\wx\msw\wx.rc
141 $(rc) -r /i$(WXDIR)\include -fo$@ $(TARGET).rc
142
143
144
145 # implicit rule for compiling .cpp files
146 {}.cpp{}.obj:
147 $(cc) @<<
148 $(CPPFLAGS) /c /Tp $<
149 <<
150
151 {$(GENCODEDIR)}.cpp{}.obj:
152 $(cc) @<<
153 $(CPPFLAGS) /c /Tp $<
154 <<
155
156
157 clean:
158 -erase *.obj
159 -erase *.exe
160 -erase *.res
161 -erase *.map
162 -erase *.sbr
163 -erase *.pdb
164 -erase *.pch
165 -erase $(TARGET).exp
166 -erase $(TARGET).lib
167 -erase $(TARGETDIR)\$(TARGET).*
168 !if "$(SEPARATE)" != "0"
169 -erase $(TARGET2).exp
170 -erase $(TARGET2).lib
171 -erase $(TARGETDIR)\$(TARGET2).*
172 !endif
173 -erase $(TARGETDIR)\$(TARGET).pyd
174 -erase $(TARGETDIR)\*.py
175 -erase $(TARGETDIR)\*.pyc
176 -erase $(TARGETDIR)\*.pyo
177
178
179 showflags:
180 @echo $(CPPFLAGS)
181
182 #------------------------------------------------------------------------
183
184 .SUFFIXES : .i .py
185
186 # Implicit rules to run SWIG
187 {}.i{$(GENCODEDIR)}.cpp:
188 swig $(SWIGFLAGS) -c -o $@ $<
189
190 {}.i{$(GENCODEDIR)}.py:
191 swig $(SWIGFLAGS) -c -o $@ $<
192
193
194 {$(GENCODEDIR)}.py{$(TARGETDIR)}.py:
195 copy $< $@
196
197 {}.py{$(TARGETDIR)}.py:
198 copy $< $@
199
200 #{}.py{$(TARGETDIR)}.$(PYEXT):
201 # $(PYTHON) -c "import py_compile; py_compile.compile('$<', '$@')"
202
203
204
205
206 # This one must leave out the -c flag so we define the whole rule
207 $(GENCODEDIR)\wx.cpp $(GENCODEDIR)\wx.py : wx.i my_typemaps.i _defs.i _extras.py
208 swig $(SWIGFLAGS) -o $(GENCODEDIR)/wx.cpp wx.i
209
210
211 # Define some dependencies. These MUST use forward slashes so SWIG
212 # will write the shadow file to the right directory.
213 $(GENCODEDIR)/windows.cpp $(GENCODEDIR)/windows.py : windows.i my_typemaps.i _defs.i
214 $(GENCODEDIR)/windows2.cpp $(GENCODEDIR)/windows2.py : windows2.i my_typemaps.i _defs.i
215 $(GENCODEDIR)/windows3.cpp $(GENCODEDIR)/windows3.py : windows3.i my_typemaps.i _defs.i
216 $(GENCODEDIR)/events.cpp $(GENCODEDIR)/events.py : events.i my_typemaps.i _defs.i
217 $(GENCODEDIR)/misc.cpp $(GENCODEDIR)/misc.py : misc.i my_typemaps.i _defs.i
218 $(GENCODEDIR)/gdi.cpp $(GENCODEDIR)/gdi.py : gdi.i my_typemaps.i _defs.i
219 $(GENCODEDIR)/mdi.cpp $(GENCODEDIR)/mdi.py : mdi.i my_typemaps.i _defs.i
220 $(GENCODEDIR)/controls.cpp $(GENCODEDIR)/controls.py : controls.i my_typemaps.i _defs.i
221 $(GENCODEDIR)/controls2.cpp $(GENCODEDIR)/controls2.py : controls2.i my_typemaps.i _defs.i
222 $(GENCODEDIR)/cmndlgs.cpp $(GENCODEDIR)/cmndlgs.py : cmndlgs.i my_typemaps.i _defs.i
223 $(GENCODEDIR)/stattool.cpp $(GENCODEDIR)/stattool.py : stattool.i my_typemaps.i _defs.i
224 $(GENCODEDIR)/frames.cpp $(GENCODEDIR)/frames.py : frames.i my_typemaps.i _defs.i
225
226 !if "$(SEPARATE)" == "1"
227 $(GENCODEDIR)\utils.cpp $(GENCODEDIR)\utils.py : utils.i my_typemaps.i
228 swig $(SWIGFLAGS) -o $(GENCODEDIR)/utils.cpp utils.i
229 !else
230 $(GENCODEDIR)/utils.cpp $(GENCODEDIR)/utils.py : utils.i my_typemaps.i _defs.i
231 !endif
232
233
234 $(TARGETDIR)\wx.py : $(GENCODEDIR)\wx.py
235 $(TARGETDIR)\windows.py : $(GENCODEDIR)\windows.py
236 $(TARGETDIR)\windows2.py : $(GENCODEDIR)\windows2.py
237 $(TARGETDIR)\windows3.py : $(GENCODEDIR)\windows3.py
238 $(TARGETDIR)\events.py : $(GENCODEDIR)\events.py
239 $(TARGETDIR)\misc.py : $(GENCODEDIR)\misc.py
240 $(TARGETDIR)\gdi.py : $(GENCODEDIR)\gdi.py
241 $(TARGETDIR)\mdi.py : $(GENCODEDIR)\mdi.py
242 $(TARGETDIR)\controls.py : $(GENCODEDIR)\controls.py
243 $(TARGETDIR)\controls2.py : $(GENCODEDIR)\controls2.py
244 $(TARGETDIR)\cmndlgs.py : $(GENCODEDIR)\cmndlgs.py
245 $(TARGETDIR)\frames.py : $(GENCODEDIR)\frames.py
246 $(TARGETDIR)\stattool.py : $(GENCODEDIR)\stattool.py
247 $(TARGETDIR)\utils.py : $(GENCODEDIR)\utils.py
248 $(TARGETDIR)\__init__.py : __init__.py
249
250
251 SOURCES = $(GENCODEDIR)\wx.cpp $(GENCODEDIR)\wx.py \
252 $(GENCODEDIR)/windows.cpp $(GENCODEDIR)/windows.py \
253 $(GENCODEDIR)/windows2.cpp $(GENCODEDIR)/windows2.py \
254 $(GENCODEDIR)/windows3.cpp $(GENCODEDIR)/windows3.py \
255 $(GENCODEDIR)/events.cpp $(GENCODEDIR)/events.py \
256 $(GENCODEDIR)/misc.cpp $(GENCODEDIR)/misc.py \
257 $(GENCODEDIR)/gdi.cpp $(GENCODEDIR)/gdi.py \
258 $(GENCODEDIR)/mdi.cpp $(GENCODEDIR)/mdi.py \
259 $(GENCODEDIR)/controls.cpp $(GENCODEDIR)/controls.py \
260 $(GENCODEDIR)/controls2.cpp $(GENCODEDIR)/controls2.py\
261 $(GENCODEDIR)/cmndlgs.cpp $(GENCODEDIR)/cmndlgs.py \
262 $(GENCODEDIR)/stattool.cpp $(GENCODEDIR)/stattool.py \
263 $(GENCODEDIR)/frames.cpp $(GENCODEDIR)/frames.py \
264 $(GENCODEDIR)/utils.cpp $(GENCODEDIR)/utils.py \
265
266
267 sources : $(SOURCES)
268
269
270 dist:
271 cd ..\..
272 wxPython\distrib\zipit.bat $(VERSION)
273
274 #------------------------------------------------------------------------
275 #
276 # $Log$
277 # Revision 1.2 1999/02/20 09:03:00 RD
278 # Added wxWindow_FromHWND(hWnd) for wxMSW to construct a wxWindow from a
279 # window handle. If you can get the window handle into the python code,
280 # it should just work... More news on this later.
281 #
282 # Added wxImageList, wxToolTip.
283 #
284 # Re-enabled wxConfig.DeleteAll() since it is reportedly fixed for the
285 # wxRegConfig class.
286 #
287 # As usual, some bug fixes, tweaks, etc.
288 #
289 # Revision 1.1 1999/02/06 23:47:03 RD
290 #
291 # Changing makefile.nt to makefile.vc as in rest of wxWindows
292 #
293 # Revision 1.10 1999/02/01 00:10:40 RD
294 #
295 # Added the missing EVT_LIST_ITEM_SELECTED and friends.
296 #
297 # Revision 1.9 1999/01/30 07:30:13 RD
298 #
299 # Added wxSashWindow, wxSashEvent, wxLayoutAlgorithm, etc.
300 #
301 # Various cleanup, tweaks, minor additions, etc. to maintain
302 # compatibility with the current wxWindows.
303 #
304 # Revision 1.8 1998/12/21 19:58:06 RD
305 #
306 # Now compiles with /GX- on MSW.
307 #
308 # Revision 1.7 1998/12/15 20:41:20 RD
309 # Changed the import semantics from "from wxPython import *" to "from
310 # wxPython.wx import *" This is for people who are worried about
311 # namespace pollution, they can use "from wxPython import wx" and then
312 # prefix all the wxPython identifiers with "wx."
313 #
314 # Added wxTaskbarIcon for wxMSW.
315 #
316 # Made the events work for wxGrid.
317 #
318 # Added wxConfig.
319 #
320 # Added wxMiniFrame for wxGTK, (untested.)
321 #
322 # Changed many of the args and return values that were pointers to gdi
323 # objects to references to reflect changes in the wxWindows API.
324 #
325 # Other assorted fixes and additions.
326 #
327 # Revision 1.6 1998/10/02 06:40:41 RD
328 #
329 # Version 0.4 of wxPython for MSW.
330 #
331 # Revision 1.5 1998/08/19 00:38:23 RD
332 #
333 # A few tweaks
334 #
335 # Revision 1.4 1998/08/18 21:55:10 RD
336 #
337 # New build directory structure
338 #
339 # Revision 1.3 1998/08/15 07:36:37 RD
340 # - Moved the header in the .i files out of the code that gets put into
341 # the .cpp files. It caused CVS conflicts because of the RCS ID being
342 # different each time.
343 #
344 # - A few minor fixes.
345 #
346 # Revision 1.2 1998/08/14 03:34:23 RD
347 # made pre-compiling the python files optional
348 #
349 # Revision 1.1 1998/08/09 08:25:51 RD
350 # Initial version
351 #