]> git.saurik.com Git - wxWidgets.git/blame - utils/wxPython/src/makefile.nt
Changed the import semantics from "from wxPython import *" to "from
[wxWidgets.git] / utils / wxPython / src / makefile.nt
CommitLineData
7bf85405
RD
1#----------------------------------------------------------------------------
2# Name: makefile.nt
3# Purpose: Win32, VC++ 5 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
13# Set WXDIR to the root wxWindows directory for your system
14WXDIR = $(WXWIN)
15
16# Set this to the root of the Python installation
17PYTHONDIR=e:\Tools\Python15
18
19# Set this to 1 for a non-debug, optimised compile
20FINAL=0
21
22# Set this to where you want the stuff installed at. It should
b8b8dda7
RD
23# be a directory contained in a PYTHONPATH directory, and should be
24# named wxPython
7bf85405
RD
25TARGETDIR=..
26
3b8b2387
RD
27# Set this to 1 for make to pre-compile the Python modules, 0 to
28# just copy the sources and let Python compile them at the first
29# runtime.
30COMPILEPY=0
7bf85405 31
b8b8dda7
RD
32SEPARATE=0
33
7bf85405
RD
34#----------------------------------------------------------------------
35
36WXUSINGDLL=0
37NOPCH=1
38THISDIR=$(WXDIR)\utils\wxPython
39
40EXTRALIBS=$(PYTHONDIR)\libs\python15.lib
b62bdb48 41EXTRAINC=-I$(PYTHONDIR)\include -I.
7bf85405
RD
42EXTRAFLAGS=/Fpwxp.pch /YXhelpers.h -DSWIG_GLOBAL -DHAVE_CONFIG_H
43
03e9bead 44SWIGFLAGS=-c++ -shadow -python -dnone -D__WXMSW__
b62bdb48 45GENCODEDIR=msw
7bf85405
RD
46
47
48!include $(WXDIR)\src\ntwxwin.mak
49
50#----------------------------------------------------------------------
51
b8b8dda7 52TARGET = wxc
7bf85405 53
b8b8dda7 54OBJECTS = wx.obj helpers.obj windows.obj events.obj \
7bf85405 55 misc.obj gdi.obj mdi.obj controls.obj \
9c039d08 56 controls2.obj windows2.obj cmndlgs.obj stattool.obj \
b8b8dda7
RD
57 frames.obj \
58!if "$(SEPARATE)" == "0"
59 utils.obj
60!else
9c039d08 61
b8b8dda7
RD
62TARGET2 = utilsc
63OBJECTS2 = utils.obj
64target2=$(TARGETDIR)\$(TARGET2).pyd
65!endif
7bf85405 66
b8b8dda7 67PYMODULES = $(TARGETDIR)\wx.py $(TARGETDIR)\events.py \
7bf85405
RD
68 $(TARGETDIR)\windows.py $(TARGETDIR)\misc.py \
69 $(TARGETDIR)\gdi.py $(TARGETDIR)\mdi.py \
70 $(TARGETDIR)\controls.py $(TARGETDIR)\controls2.py \
71 $(TARGETDIR)\windows2.py $(TARGETDIR)\cmndlgs.py \
9c039d08 72 $(TARGETDIR)\stattool.py $(TARGETDIR)\frames.py \
b8b8dda7 73 $(TARGETDIR)\utils.py $(TARGETDIR)\__init__.py
9c039d08 74
7bf85405
RD
75
76#----------------------------------------------------------------------
77
78!if "$(FINAL)" == "0"
79DEBUGLFLAGS = /DEBUG /INCREMENTAL:YES
80!else
81DEBUGLFLAGS = /INCREMENTAL:NO
82!endif
83
84LFLAGS= $(DEBUGLFLAGS) /DLL /def:$(TARGET).def /subsystem:windows,3.50 \
85 /machine:I386 /implib:./$(TARGET).lib /nologo
86
b8b8dda7
RD
87LFLAGS2=$(DEBUGLFLAGS) /DLL /def:$(TARGET2).def /subsystem:windows,3.50 \
88 /machine:I386 /implib:./$(TARGET2).lib /nologo
89
7bf85405
RD
90#----------------------------------------------------------------------
91
b8b8dda7 92default: $(TARGETDIR)\$(TARGET).pyd $(target2) pycfiles
7bf85405 93
b8b8dda7 94all: wx $(TARGET) $(TARGET2)
7bf85405
RD
95
96wx:
97 cd $(WXDIR)\src\msw
98 nmake -f makefile.nt FINAL=$(FINAL)
99 cd $(THISDIR)
100
101wxclean:
102 cd $(WXDIR)\src\msw
103 nmake -f makefile.nt clean
104 cd $(THISDIR)
105
106
107pycfiles : $(PYMODULES)
3b8b2387 108!if "$(COMPILEPY)" == "1"
7bf85405
RD
109 $(PYTHONDIR)\python $(PYTHONDIR)\Lib\compileall.py -l $(TARGETDIR)
110 $(PYTHONDIR)\python -O $(PYTHONDIR)\Lib\compileall.py -l $(TARGETDIR)
3b8b2387 111!endif
7bf85405
RD
112
113#----------------------------------------------------------------------
114
115$(TARGETDIR)\$(TARGET).pyd : $(DUMMYOBJ) $(WXLIB) $(OBJECTS) $(TARGET).res
116 $(link) @<<
117/out:$@ /dll
118$(LFLAGS)
119$(DUMMYOBJ) $(OBJECTS) $(TARGET).res
120$(LIBS)
121<<
122
b8b8dda7
RD
123$(TARGETDIR)\$(TARGET2).pyd : $(DUMMYOBJ) $(WXLIB) $(OBJECTS2)
124 $(link) @<<
125/out:$@ /dll
126$(LFLAGS2)
127$(DUMMYOBJ) $(OBJECTS2)
128$(LIBS)
129<<
130
7bf85405
RD
131
132$(TARGET).res : $(TARGET).rc $(WXDIR)\include\wx\msw\wx.rc
133 $(rc) -r /i$(WXDIR)\include -fo$@ $(TARGET).rc
134
135
136
137# implicit rule for compiling .cpp files
138{}.cpp{}.obj:
139 $(cc) @<<
140$(CPPFLAGS) /c /Tp $<
141<<
142
b62bdb48
RD
143{$(GENCODEDIR)}.cpp{}.obj:
144 $(cc) @<<
145$(CPPFLAGS) /c /Tp $<
146<<
147
7bf85405
RD
148
149clean:
150 -erase *.obj
151 -erase *.exe
152 -erase *.res
153 -erase *.map
154 -erase *.sbr
155 -erase *.pdb
156 -erase *.pch
157 -erase $(TARGET).exp
158 -erase $(TARGET).lib
b8b8dda7
RD
159 -erase $(TARGETDIR)\$(TARGET).*
160!if "$(SEPARATE)" != "0"
161 -erase $(TARGET2).exp
162 -erase $(TARGET2).lib
163 -erase $(TARGETDIR)\$(TARGET2).*
164!endif
7bf85405
RD
165 -erase $(TARGETDIR)\$(TARGET).pyd
166 -erase $(TARGETDIR)\*.py
167 -erase $(TARGETDIR)\*.pyc
168 -erase $(TARGETDIR)\*.pyo
7bf85405
RD
169
170
171
172#------------------------------------------------------------------------
173
174.SUFFIXES : .i .py
175
176# Implicit rules to run SWIG
b62bdb48
RD
177{}.i{$(GENCODEDIR)}.cpp:
178 swig $(SWIGFLAGS) -c -o $@ $<
7bf85405 179
b62bdb48
RD
180{}.i{$(GENCODEDIR)}.py:
181 swig $(SWIGFLAGS) -c -o $@ $<
b62bdb48
RD
182
183
184{$(GENCODEDIR)}.py{$(TARGETDIR)}.py:
185 copy $< $@
7bf85405
RD
186
187{}.py{$(TARGETDIR)}.py:
188 copy $< $@
189
190#{}.py{$(TARGETDIR)}.$(PYEXT):
191# $(PYTHON) -c "import py_compile; py_compile.compile('$<', '$@')"
192
193
194
195
196# This one must leave out the -c flag so we define the whole rule
b8b8dda7
RD
197$(GENCODEDIR)\wx.cpp $(GENCODEDIR)\wx.py : wx.i my_typemaps.i _defs.i _extras.py
198 swig $(SWIGFLAGS) -o $(GENCODEDIR)/wx.cpp wx.i
7bf85405
RD
199
200
8f89cfc1
RD
201# Define some dependencies. These MUST use forward slashes so SWIG
202# will write the shadow file to the right directory.
203$(GENCODEDIR)/windows.cpp $(GENCODEDIR)/windows.py : windows.i my_typemaps.i _defs.i
204$(GENCODEDIR)/windows2.cpp $(GENCODEDIR)/windows2.py : windows2.i my_typemaps.i _defs.i
205$(GENCODEDIR)/events.cpp $(GENCODEDIR)/events.py : events.i my_typemaps.i _defs.i
206$(GENCODEDIR)/misc.cpp $(GENCODEDIR)/misc.py : misc.i my_typemaps.i _defs.i
207$(GENCODEDIR)/gdi.cpp $(GENCODEDIR)/gdi.py : gdi.i my_typemaps.i _defs.i
208$(GENCODEDIR)/mdi.cpp $(GENCODEDIR)/mdi.py : mdi.i my_typemaps.i _defs.i
209$(GENCODEDIR)/controls.cpp $(GENCODEDIR)/controls.py : controls.i my_typemaps.i _defs.i
210$(GENCODEDIR)/controls2.cpp $(GENCODEDIR)/controls2.py : controls2.i my_typemaps.i _defs.i
211$(GENCODEDIR)/cmndlgs.cpp $(GENCODEDIR)/cmndlgs.py : cmndlgs.i my_typemaps.i _defs.i
9c039d08
RD
212$(GENCODEDIR)/stattool.cpp $(GENCODEDIR)/stattool.py : stattool.i my_typemaps.i _defs.i
213$(GENCODEDIR)/frames.cpp $(GENCODEDIR)/frames.py : frames.i my_typemaps.i _defs.i
b62bdb48 214
b8b8dda7
RD
215!if "$(SEPARATE)" == "1"
216$(GENCODEDIR)\utils.cpp $(GENCODEDIR)\utils.py : utils.i my_typemaps.i
217 swig $(SWIGFLAGS) -o $(GENCODEDIR)/utils.cpp utils.i
218!else
219$(GENCODEDIR)/utils.cpp $(GENCODEDIR)/utils.py : utils.i my_typemaps.i _defs.i
220!endif
221
b62bdb48 222
b8b8dda7 223$(TARGETDIR)\wx.py : $(GENCODEDIR)\wx.py
b62bdb48
RD
224$(TARGETDIR)\windows.py : $(GENCODEDIR)\windows.py
225$(TARGETDIR)\windows2.py : $(GENCODEDIR)\windows2.py
226$(TARGETDIR)\events.py : $(GENCODEDIR)\events.py
227$(TARGETDIR)\misc.py : $(GENCODEDIR)\misc.py
228$(TARGETDIR)\gdi.py : $(GENCODEDIR)\gdi.py
229$(TARGETDIR)\mdi.py : $(GENCODEDIR)\mdi.py
230$(TARGETDIR)\controls.py : $(GENCODEDIR)\controls.py
231$(TARGETDIR)\controls2.py : $(GENCODEDIR)\controls2.py
232$(TARGETDIR)\cmndlgs.py : $(GENCODEDIR)\cmndlgs.py
b8b8dda7 233$(TARGETDIR)\frames.py : $(GENCODEDIR)\frames.py
9c039d08 234$(TARGETDIR)\stattool.py : $(GENCODEDIR)\stattool.py
b8b8dda7 235$(TARGETDIR)\utils.py : $(GENCODEDIR)\utils.py
b62bdb48 236$(TARGETDIR)\__init__.py : __init__.py
7bf85405
RD
237
238
239#------------------------------------------------------------------------
240#
241# $Log$
b8b8dda7
RD
242# Revision 1.7 1998/12/15 20:41:20 RD
243# Changed the import semantics from "from wxPython import *" to "from
244# wxPython.wx import *" This is for people who are worried about
245# namespace pollution, they can use "from wxPython import wx" and then
246# prefix all the wxPython identifiers with "wx."
247#
248# Added wxTaskbarIcon for wxMSW.
249#
250# Made the events work for wxGrid.
251#
252# Added wxConfig.
253#
254# Added wxMiniFrame for wxGTK, (untested.)
255#
256# Changed many of the args and return values that were pointers to gdi
257# objects to references to reflect changes in the wxWindows API.
258#
259# Other assorted fixes and additions.
260#
9c039d08 261# Revision 1.6 1998/10/02 06:40:41 RD
b8b8dda7 262#
9c039d08
RD
263# Version 0.4 of wxPython for MSW.
264#
8f89cfc1 265# Revision 1.5 1998/08/19 00:38:23 RD
9c039d08 266#
8f89cfc1
RD
267# A few tweaks
268#
b62bdb48 269# Revision 1.4 1998/08/18 21:55:10 RD
8f89cfc1 270#
b62bdb48
RD
271# New build directory structure
272#
03e9bead
RD
273# Revision 1.3 1998/08/15 07:36:37 RD
274# - Moved the header in the .i files out of the code that gets put into
275# the .cpp files. It caused CVS conflicts because of the RCS ID being
276# different each time.
277#
278# - A few minor fixes.
279#
3b8b2387
RD
280# Revision 1.2 1998/08/14 03:34:23 RD
281# made pre-compiling the python files optional
282#
7bf85405
RD
283# Revision 1.1 1998/08/09 08:25:51 RD
284# Initial version
285#