]> git.saurik.com Git - wxWidgets.git/blob - utils/wxPython/src/makefile.nt
A few tweaks
[wxWidgets.git] / utils / wxPython / src / makefile.nt
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
14 WXDIR = $(WXWIN)
15
16 # Set this to the root of the Python installation
17 PYTHONDIR=e:\Tools\Python15
18
19 # Set this to 1 for a non-debug, optimised compile
20 FINAL=0
21
22 # Set this to where you want the stuff installed at. It should
23 # be a directory contained in a PYTHONPATH directory.
24 TARGETDIR=..
25
26 # Set this to 1 for make to pre-compile the Python modules, 0 to
27 # just copy the sources and let Python compile them at the first
28 # runtime.
29 COMPILEPY=0
30
31 #----------------------------------------------------------------------
32
33 WXUSINGDLL=0
34 NOPCH=1
35 THISDIR=$(WXDIR)\utils\wxPython
36
37 EXTRALIBS=$(PYTHONDIR)\libs\python15.lib
38 EXTRAINC=-I$(PYTHONDIR)\include -I.
39 EXTRAFLAGS=/Fpwxp.pch /YXhelpers.h -DSWIG_GLOBAL -DHAVE_CONFIG_H
40
41 SWIGFLAGS=-c++ -shadow -python -dnone -D__WXMSW__
42 GENCODEDIR=msw
43
44
45 !include $(WXDIR)\src\ntwxwin.mak
46
47 #----------------------------------------------------------------------
48
49 TARGET = wxpc
50
51 OBJECTS = wxp.obj helpers.obj windows.obj events.obj \
52 misc.obj gdi.obj mdi.obj controls.obj \
53 controls2.obj windows2.obj cmndlgs.obj
54
55 PYMODULES = $(TARGETDIR)\wxp.py $(TARGETDIR)\events.py \
56 $(TARGETDIR)\windows.py $(TARGETDIR)\misc.py \
57 $(TARGETDIR)\gdi.py $(TARGETDIR)\mdi.py \
58 $(TARGETDIR)\controls.py $(TARGETDIR)\controls2.py \
59 $(TARGETDIR)\windows2.py $(TARGETDIR)\cmndlgs.py \
60 $(TARGETDIR)\__init__.py
61
62 #----------------------------------------------------------------------
63
64 !if "$(FINAL)" == "0"
65 DEBUGLFLAGS = /DEBUG /INCREMENTAL:YES
66 !else
67 DEBUGLFLAGS = /INCREMENTAL:NO
68 !endif
69
70 LFLAGS= $(DEBUGLFLAGS) /DLL /def:$(TARGET).def /subsystem:windows,3.50 \
71 /machine:I386 /implib:./$(TARGET).lib /nologo
72
73 #----------------------------------------------------------------------
74
75 default: $(TARGETDIR)\$(TARGET).pyd pycfiles
76
77 all: wx $(TARGET)
78
79 wx:
80 cd $(WXDIR)\src\msw
81 nmake -f makefile.nt FINAL=$(FINAL)
82 cd $(THISDIR)
83
84 wxclean:
85 cd $(WXDIR)\src\msw
86 nmake -f makefile.nt clean
87 cd $(THISDIR)
88
89
90 pycfiles : $(PYMODULES)
91 !if "$(COMPILEPY)" == "1"
92 $(PYTHONDIR)\python $(PYTHONDIR)\Lib\compileall.py -l $(TARGETDIR)
93 $(PYTHONDIR)\python -O $(PYTHONDIR)\Lib\compileall.py -l $(TARGETDIR)
94 !endif
95
96 #----------------------------------------------------------------------
97
98 $(TARGETDIR)\$(TARGET).pyd : $(DUMMYOBJ) $(WXLIB) $(OBJECTS) $(TARGET).res
99 $(link) @<<
100 /out:$@ /dll
101 $(LFLAGS)
102 $(DUMMYOBJ) $(OBJECTS) $(TARGET).res
103 $(LIBS)
104 <<
105
106
107 $(TARGET).res : $(TARGET).rc $(WXDIR)\include\wx\msw\wx.rc
108 $(rc) -r /i$(WXDIR)\include -fo$@ $(TARGET).rc
109
110
111
112 # implicit rule for compiling .cpp files
113 {}.cpp{}.obj:
114 $(cc) @<<
115 $(CPPFLAGS) /c /Tp $<
116 <<
117
118 {$(GENCODEDIR)}.cpp{}.obj:
119 $(cc) @<<
120 $(CPPFLAGS) /c /Tp $<
121 <<
122
123
124 clean:
125 -erase *.obj
126 -erase *.exe
127 -erase *.res
128 -erase *.map
129 -erase *.sbr
130 -erase *.pdb
131 -erase *.pch
132 -erase $(TARGET).exp
133 -erase $(TARGET).lib
134 -erase $(TARGETDIR)\$(TARGET).pyd
135 -erase $(TARGETDIR)\*.py
136 -erase $(TARGETDIR)\*.pyc
137 -erase $(TARGETDIR)\*.pyo
138 -erase $(TARGETDIR)\$(TARGET).*
139
140
141
142 #------------------------------------------------------------------------
143
144 .SUFFIXES : .i .py
145
146 # Implicit rules to run SWIG
147 {}.i{$(GENCODEDIR)}.cpp:
148 swig $(SWIGFLAGS) -c -o $@ $<
149
150 {}.i{$(GENCODEDIR)}.py:
151 swig $(SWIGFLAGS) -c -o $@ $<
152
153
154 {$(GENCODEDIR)}.py{$(TARGETDIR)}.py:
155 copy $< $@
156
157 {}.py{$(TARGETDIR)}.py:
158 copy $< $@
159
160 #{}.py{$(TARGETDIR)}.$(PYEXT):
161 # $(PYTHON) -c "import py_compile; py_compile.compile('$<', '$@')"
162
163
164
165
166 # This one must leave out the -c flag so we define the whole rule
167 $(GENCODEDIR)\wxp.cpp $(GENCODEDIR)\wxp.py : wxp.i my_typemaps.i _defs.i _extras.py
168 swig $(SWIGFLAGS) -o $(GENCODEDIR)/wxp.cpp wxp.i
169
170
171 # Define some dependencies. These MUST use forward slashes so SWIG
172 # will write the shadow file to the right directory.
173 $(GENCODEDIR)/windows.cpp $(GENCODEDIR)/windows.py : windows.i my_typemaps.i _defs.i
174 $(GENCODEDIR)/windows2.cpp $(GENCODEDIR)/windows2.py : windows2.i my_typemaps.i _defs.i
175 $(GENCODEDIR)/events.cpp $(GENCODEDIR)/events.py : events.i my_typemaps.i _defs.i
176 $(GENCODEDIR)/misc.cpp $(GENCODEDIR)/misc.py : misc.i my_typemaps.i _defs.i
177 $(GENCODEDIR)/gdi.cpp $(GENCODEDIR)/gdi.py : gdi.i my_typemaps.i _defs.i
178 $(GENCODEDIR)/mdi.cpp $(GENCODEDIR)/mdi.py : mdi.i my_typemaps.i _defs.i
179 $(GENCODEDIR)/controls.cpp $(GENCODEDIR)/controls.py : controls.i my_typemaps.i _defs.i
180 $(GENCODEDIR)/controls2.cpp $(GENCODEDIR)/controls2.py : controls2.i my_typemaps.i _defs.i
181 $(GENCODEDIR)/cmndlgs.cpp $(GENCODEDIR)/cmndlgs.py : cmndlgs.i my_typemaps.i _defs.i
182
183
184 $(TARGETDIR)\wxp.py : $(GENCODEDIR)\wxp.py
185 $(TARGETDIR)\windows.py : $(GENCODEDIR)\windows.py
186 $(TARGETDIR)\windows2.py : $(GENCODEDIR)\windows2.py
187 $(TARGETDIR)\events.py : $(GENCODEDIR)\events.py
188 $(TARGETDIR)\misc.py : $(GENCODEDIR)\misc.py
189 $(TARGETDIR)\gdi.py : $(GENCODEDIR)\gdi.py
190 $(TARGETDIR)\mdi.py : $(GENCODEDIR)\mdi.py
191 $(TARGETDIR)\controls.py : $(GENCODEDIR)\controls.py
192 $(TARGETDIR)\controls2.py : $(GENCODEDIR)\controls2.py
193 $(TARGETDIR)\cmndlgs.py : $(GENCODEDIR)\cmndlgs.py
194 $(TARGETDIR)\__init__.py : __init__.py
195
196
197 #------------------------------------------------------------------------
198 #
199 # $Log$
200 # Revision 1.5 1998/08/19 00:38:23 RD
201 # A few tweaks
202 #
203 # Revision 1.4 1998/08/18 21:55:10 RD
204 #
205 # New build directory structure
206 #
207 # Revision 1.3 1998/08/15 07:36:37 RD
208 # - Moved the header in the .i files out of the code that gets put into
209 # the .cpp files. It caused CVS conflicts because of the RCS ID being
210 # different each time.
211 #
212 # - A few minor fixes.
213 #
214 # Revision 1.2 1998/08/14 03:34:23 RD
215 # made pre-compiling the python files optional
216 #
217 # Revision 1.1 1998/08/09 08:25:51 RD
218 # Initial version
219 #