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