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