]> git.saurik.com Git - wxWidgets.git/blame - utils/wxPython/src/makefile.nt
New build directory structure
[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
23# be a directory contained in a PYTHONPATH directory.
24TARGETDIR=..
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.
29COMPILEPY=0
7bf85405
RD
30
31#----------------------------------------------------------------------
32
33WXUSINGDLL=0
34NOPCH=1
35THISDIR=$(WXDIR)\utils\wxPython
36
37EXTRALIBS=$(PYTHONDIR)\libs\python15.lib
b62bdb48 38EXTRAINC=-I$(PYTHONDIR)\include -I.
7bf85405
RD
39EXTRAFLAGS=/Fpwxp.pch /YXhelpers.h -DSWIG_GLOBAL -DHAVE_CONFIG_H
40
03e9bead 41SWIGFLAGS=-c++ -shadow -python -dnone -D__WXMSW__
b62bdb48 42GENCODEDIR=msw
7bf85405
RD
43
44
45!include $(WXDIR)\src\ntwxwin.mak
46
47#----------------------------------------------------------------------
48
49TARGET = wxpc
50
51OBJECTS = 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
55PYMODULES = $(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"
65DEBUGLFLAGS = /DEBUG /INCREMENTAL:YES
66!else
67DEBUGLFLAGS = /INCREMENTAL:NO
68!endif
69
70LFLAGS= $(DEBUGLFLAGS) /DLL /def:$(TARGET).def /subsystem:windows,3.50 \
71 /machine:I386 /implib:./$(TARGET).lib /nologo
72
73#----------------------------------------------------------------------
74
75default: $(TARGETDIR)\$(TARGET).pyd pycfiles
76
77all: wx $(TARGET)
78
79wx:
80 cd $(WXDIR)\src\msw
81 nmake -f makefile.nt FINAL=$(FINAL)
82 cd $(THISDIR)
83
84wxclean:
85 cd $(WXDIR)\src\msw
86 nmake -f makefile.nt clean
87 cd $(THISDIR)
88
89
90pycfiles : $(PYMODULES)
3b8b2387 91!if "$(COMPILEPY)" == "1"
7bf85405
RD
92 $(PYTHONDIR)\python $(PYTHONDIR)\Lib\compileall.py -l $(TARGETDIR)
93 $(PYTHONDIR)\python -O $(PYTHONDIR)\Lib\compileall.py -l $(TARGETDIR)
3b8b2387 94!endif
7bf85405
RD
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
b62bdb48
RD
118{$(GENCODEDIR)}.cpp{}.obj:
119 $(cc) @<<
120$(CPPFLAGS) /c /Tp $<
121<<
122
7bf85405
RD
123
124clean:
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
b62bdb48
RD
147{}.i{$(GENCODEDIR)}.cpp:
148 swig $(SWIGFLAGS) -c -o $@ $<
149 move $(@B).py $(GENCODEDIR)
7bf85405 150
b62bdb48
RD
151{}.i{$(GENCODEDIR)}.py:
152 swig $(SWIGFLAGS) -c -o $@ $<
153 move $(@B).py $(GENCODEDIR)
154
155
156{$(GENCODEDIR)}.py{$(TARGETDIR)}.py:
157 copy $< $@
7bf85405
RD
158
159{}.py{$(TARGETDIR)}.py:
160 copy $< $@
161
162#{}.py{$(TARGETDIR)}.$(PYEXT):
163# $(PYTHON) -c "import py_compile; py_compile.compile('$<', '$@')"
164
165
166
167
168# This one must leave out the -c flag so we define the whole rule
b62bdb48
RD
169$(GENCODEDIR)\wxp.cpp $(GENCODEDIR)\wxp.py : wxp.i my_typemaps.i _defs.i _extras.py
170 swig $(SWIGFLAGS) -o $(GENCODEDIR)\wxp.cpp wxp.i
171 move wxp.py $(GENCODEDIR)\wxp.py
7bf85405
RD
172
173
174# define some dependencies
b62bdb48
RD
175$(GENCODEDIR)\windows.cpp $(GENCODEDIR)\windows.py : windows.i my_typemaps.i _defs.i
176$(GENCODEDIR)\windows2.cpp $(GENCODEDIR)\windows2.py : windows2.i my_typemaps.i _defs.i
177$(GENCODEDIR)\events.cpp $(GENCODEDIR)\events.py : events.i my_typemaps.i _defs.i
178$(GENCODEDIR)\misc.cpp $(GENCODEDIR)\misc.py : misc.i my_typemaps.i _defs.i
179$(GENCODEDIR)\gdi.cpp $(GENCODEDIR)\gdi.py : gdi.i my_typemaps.i _defs.i
180$(GENCODEDIR)\mdi.cpp $(GENCODEDIR)\mdi.py : mdi.i my_typemaps.i _defs.i
181$(GENCODEDIR)\controls.cpp $(GENCODEDIR)\controls.py : controls.i my_typemaps.i _defs.i
182$(GENCODEDIR)\controls2.cpp $(GENCODEDIR)\controls2.py : controls2.i my_typemaps.i _defs.i
183$(GENCODEDIR)\cmndlgs.cpp $(GENCODEDIR)\cmndlgs.py : cmndlgs.i my_typemaps.i _defs.i
184
185
186$(TARGETDIR)\wxp.py : $(GENCODEDIR)\wxp.py
187$(TARGETDIR)\windows.py : $(GENCODEDIR)\windows.py
188$(TARGETDIR)\windows2.py : $(GENCODEDIR)\windows2.py
189$(TARGETDIR)\events.py : $(GENCODEDIR)\events.py
190$(TARGETDIR)\misc.py : $(GENCODEDIR)\misc.py
191$(TARGETDIR)\gdi.py : $(GENCODEDIR)\gdi.py
192$(TARGETDIR)\mdi.py : $(GENCODEDIR)\mdi.py
193$(TARGETDIR)\controls.py : $(GENCODEDIR)\controls.py
194$(TARGETDIR)\controls2.py : $(GENCODEDIR)\controls2.py
195$(TARGETDIR)\cmndlgs.py : $(GENCODEDIR)\cmndlgs.py
196$(TARGETDIR)\__init__.py : __init__.py
7bf85405
RD
197
198
199#------------------------------------------------------------------------
200#
201# $Log$
b62bdb48
RD
202# Revision 1.4 1998/08/18 21:55:10 RD
203# New build directory structure
204#
03e9bead
RD
205# Revision 1.3 1998/08/15 07:36:37 RD
206# - Moved the header in the .i files out of the code that gets put into
207# the .cpp files. It caused CVS conflicts because of the RCS ID being
208# different each time.
209#
210# - A few minor fixes.
211#
3b8b2387
RD
212# Revision 1.2 1998/08/14 03:34:23 RD
213# made pre-compiling the python files optional
214#
7bf85405
RD
215# Revision 1.1 1998/08/09 08:25:51 RD
216# Initial version
217#