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