]> git.saurik.com Git - wxWidgets.git/blob - utils/wxPython/src/makefile.nt
made pre-compiling the python files optional
[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
39 EXTRAFLAGS=/Fpwxp.pch /YXhelpers.h -DSWIG_GLOBAL -DHAVE_CONFIG_H
40
41 SWIGFLAGS=-c++ -shadow -python -dnone
42
43
44 !include $(WXDIR)\src\ntwxwin.mak
45
46 #----------------------------------------------------------------------
47
48 TARGET = wxpc
49
50 OBJECTS = wxp.obj helpers.obj windows.obj events.obj \
51 misc.obj gdi.obj mdi.obj controls.obj \
52 controls2.obj windows2.obj cmndlgs.obj
53
54 PYMODULES = $(TARGETDIR)\wxp.py $(TARGETDIR)\events.py \
55 $(TARGETDIR)\windows.py $(TARGETDIR)\misc.py \
56 $(TARGETDIR)\gdi.py $(TARGETDIR)\mdi.py \
57 $(TARGETDIR)\controls.py $(TARGETDIR)\controls2.py \
58 $(TARGETDIR)\windows2.py $(TARGETDIR)\cmndlgs.py \
59 $(TARGETDIR)\__init__.py
60
61 #----------------------------------------------------------------------
62
63 !if "$(FINAL)" == "0"
64 DEBUGLFLAGS = /DEBUG /INCREMENTAL:YES
65 !else
66 DEBUGLFLAGS = /INCREMENTAL:NO
67 !endif
68
69 LFLAGS= $(DEBUGLFLAGS) /DLL /def:$(TARGET).def /subsystem:windows,3.50 \
70 /machine:I386 /implib:./$(TARGET).lib /nologo
71
72 #----------------------------------------------------------------------
73
74 default: $(TARGETDIR)\$(TARGET).pyd pycfiles
75
76 all: wx $(TARGET)
77
78 wx:
79 cd $(WXDIR)\src\msw
80 nmake -f makefile.nt FINAL=$(FINAL)
81 cd $(THISDIR)
82
83 wxclean:
84 cd $(WXDIR)\src\msw
85 nmake -f makefile.nt clean
86 cd $(THISDIR)
87
88
89 pycfiles : $(PYMODULES)
90 !if "$(COMPILEPY)" == "1"
91 $(PYTHONDIR)\python $(PYTHONDIR)\Lib\compileall.py -l $(TARGETDIR)
92 $(PYTHONDIR)\python -O $(PYTHONDIR)\Lib\compileall.py -l $(TARGETDIR)
93 !endif
94
95 #----------------------------------------------------------------------
96
97 $(TARGETDIR)\$(TARGET).pyd : $(DUMMYOBJ) $(WXLIB) $(OBJECTS) $(TARGET).res
98 $(link) @<<
99 /out:$@ /dll
100 $(LFLAGS)
101 $(DUMMYOBJ) $(OBJECTS) $(TARGET).res
102 $(LIBS)
103 <<
104
105
106 $(TARGET).res : $(TARGET).rc $(WXDIR)\include\wx\msw\wx.rc
107 $(rc) -r /i$(WXDIR)\include -fo$@ $(TARGET).rc
108
109
110
111 # implicit rule for compiling .cpp files
112 {}.cpp{}.obj:
113 $(cc) @<<
114 $(CPPFLAGS) /c /Tp $<
115 <<
116
117
118 clean:
119 -erase *.obj
120 -erase *.exe
121 -erase *.res
122 -erase *.map
123 -erase *.sbr
124 -erase *.pdb
125 -erase *.pch
126 -erase $(TARGET).exp
127 -erase $(TARGET).lib
128 -erase $(TARGETDIR)\$(TARGET).pyd
129 -erase $(TARGETDIR)\*.py
130 -erase $(TARGETDIR)\*.pyc
131 -erase $(TARGETDIR)\*.pyo
132 -erase $(TARGETDIR)\$(TARGET).*
133
134
135
136 #------------------------------------------------------------------------
137
138 .SUFFIXES : .i .py
139
140 # Implicit rules to run SWIG
141 {}.i{}.cpp:
142 swig $(SWIGFLAGS) -c -o $*.cpp $*.i
143
144 {}.i{}.py:
145 swig $(SWIGFLAGS) -c -o $*.cpp $*.i
146
147 {}.py{$(TARGETDIR)}.py:
148 copy $< $@
149
150 #{}.py{$(TARGETDIR)}.$(PYEXT):
151 # $(PYTHON) -c "import py_compile; py_compile.compile('$<', '$@')"
152
153
154
155
156 # This one must leave out the -c flag so we define the whole rule
157 wxp.cpp wxp.py : wxp.i my_typemaps.i _defs.i _extras.py
158 swig $(SWIGFLAGS) -o wxp.cpp wxp.i
159
160
161 # define some dependencies
162 windows.cpp windows.py : windows.i my_typemaps.i _defs.i
163 windows2.cpp windows2.py : windows2.i my_typemaps.i _defs.i
164 events.cpp events.py : events.i my_typemaps.i _defs.i
165 misc.cpp misc.py : misc.i my_typemaps.i _defs.i
166 gdi.cpp gdi.py : gdi.i my_typemaps.i _defs.i
167 mdi.cpp mdi.py : mdi.i my_typemaps.i _defs.i
168 controls.cpp controls.py : controls.i my_typemaps.i _defs.i
169 controls2.cpp controls2.py : controls2.i my_typemaps.i _defs.i
170 cmndlgs.cpp cmndlgs.py : cmndlgs.i my_typemaps.i _defs.i
171
172
173 $(TARGETDIR)\wxp.py : wxp.py
174 $(TARGETDIR)\windows.py : windows.py
175 $(TARGETDIR)\windows2.py : windows2.py
176 $(TARGETDIR)\events.py : events.py
177 $(TARGETDIR)\misc.py : misc.py
178 $(TARGETDIR)\gdi.py : gdi.py
179 $(TARGETDIR)\mdi.py : mdi.py
180 $(TARGETDIR)\controls.py : controls.py
181 $(TARGETDIR)\controls2.py : controls2.py
182 $(TARGETDIR)\cmndlgs.py : cmndlgs.py
183
184
185 #------------------------------------------------------------------------
186 #
187 # $Log$
188 # Revision 1.2 1998/08/14 03:34:23 RD
189 # made pre-compiling the python files optional
190 #
191 # Revision 1.1 1998/08/09 08:25:51 RD
192 # Initial version
193 #