# This is really the wxPython version number, and will be placed in the
# Makefiles for use with the distribution related targets.
-__version__ = '2.1b3'
+__version__ = '2.1.12'
#----------------------------------------------------------------------------
runClean = runClean,
runUninstall = runUninstall)
+ err = 0
if config.readConfigFiles(args):
config.doFixups()
config.makeMakefile()
- err = 0
if config.runBuild:
cmd = "%s -f %s" % (config.MAKE, config.MAKEFILE)
print "Running:", cmd
err = os.system(cmd)
+ return err
#----------------------------------------------------------------------------
self.VERSION = __version__
self.MODULE = ''
self.SWIGFILES = []
- self.SWIGFLAGS = '-c++ -shadow -python -dnone -I$(WXPSRCDIR)'
+ self.SWIGFLAGS = '-c++ -shadow -python -keyword -dnone -I$(WXPSRCDIR)'
self.SOURCES = []
self.PYFILES = []
self.LFLAGS = ''
self.OTHERLIBS = ''
self.OTHERTARGETS = ''
self.OTHERINSTALLTARGETS = ''
+ self.OTHERUNINSTALLTARGETS = ''
self.OTHERRULES = ''
self.DEFAULTRULE = 'default: $(GENCODEDIR) $(TARGET)'
self.PYVERSION = sys.version[:3]
self.WXUSINGDLL = '1'
self.OTHERDEP = ''
self.WXPSRCDIR = '$(WXDIR)/utils/wxPython/src'
+ self.SWIGDEPS = ''
+ self.OTHERDEPS = ''
if sys.platform == 'win32':
self.RESFILE = ''
self.RESRULE = ''
self.OVERRIDEFLAGS = '/GX-'
+ self.RMCMD = '-erase '
+ self.WXPSRCDIR = os.path.normpath(self.WXPSRCDIR)
+ self.CRTFLAG = ''
+
else:
self.MAKE = 'make'
'-I$(WXPSRCDIR)'
self.LFLAGS = '-L$(WXPSRCDIR) `wx-config --libs`'
self.LIBS = '-l$(HELPERLIB)'
+ self.RMCMD = '-rm -f '
# **** What to do when I start supporting Motif, etc.???
self.GENCODEDIR = 'gtk'
# now build the text for the dependencies
depends = ""
for name in self.SWIGFILES:
- text = '$(GENCODEDIR)/%s.cpp $(GENCODEDIR)/%s.py : %s.i\n' \
+ rootname = os.path.splitext(name)[0]
+ text = '$(GENCODEDIR)/%s.cpp $(GENCODEDIR)/%s.py : %s.i %s\n' \
'$(TARGETDIR)\\%s.py : $(GENCODEDIR)\\%s.py\n' % \
- tuple([os.path.splitext(name)[0]] * 5)
+ (rootname, rootname, rootname, self.SWIGDEPS, rootname, rootname)
depends = depends + text
+ if self.OTHERDEPS:
+ text = '%s%s : %s\n' % \
+ (os.path.splitext(name)[0], self.OBJEXT, self.OTHERDEPS)
+ depends = depends + text
for name in self.PYFILES:
text = '$(TARGETDIR)\\%s.py : %s.py\n' % \
tuple([os.path.splitext(name)[0]] * 2)
depends = depends + text
+ if self.OTHERDEPS:
+ for name in self.SOURCES:
+ name = os.path.basename(name)
+ text = '%s%s : %s\n' % \
+ (os.path.splitext(name)[0], self.OBJEXT, self.OTHERDEPS)
+ depends = depends + text
+
self.DEPENDS = swapslash(depends)
self.PYMODULES = splitlines(swapslash(pymodules))
+ # now make a list of the python files that would need uninstalled
+ pycleanup = ""
+ for name in self.SWIGFILES:
+ pycleanup = pycleanup + self.makeCleanupList(name)
+ for name in self.PYFILES:
+ pycleanup = pycleanup + self.makeCleanupList(name)
+ self.PYCLEANUP = swapslash(pycleanup)
+
# finally, build the makefile
if sys.platform == 'win32':
print "Makefile created: ", self.MAKEFILE
+
+ #------------------------------------------------------------
+ def makeCleanupList(self, name):
+ st = ""
+ st = st + '\t%s$(TARGETDIR)\\%s.py\n' % (self.RMCMD, os.path.splitext(name)[0])
+ st = st + '\t%s$(TARGETDIR)\\%s.pyc\n' % (self.RMCMD, os.path.splitext(name)[0])
+ st = st + '\t%s$(TARGETDIR)\\%s.pyo\n' % (self.RMCMD, os.path.splitext(name)[0])
+ return st
+
+
#------------------------------------------------------------
def readConfigFiles(self, args):
return self.processFile(self.bldCfg, 1) and \
+#----------------------------------------------------------------------------
#----------------------------------------------------------------------------
#----------------------------------------------------------------------------
VERSION = %(VERSION)s
MODULE = %(MODULE)s
SWIGFLAGS = %(SWIGFLAGS)s %(SWIGTOOLKITFLAG)s %(OTHERSWIGFLAGS)s
-CFLAGS = %(CFLAGS)s %(OTHERCFLAGS)s
-LFLAGS = %(LFLAGS)s %(OTHERLFLAGS)s
+CFLAGS = %(CFLAGS)s
+LFLAGS = %(LFLAGS)s
PYVERSION = %(PYVERSION)s
PYPREFIX = %(PYPREFIX)s
EXECPREFIX = %(EXECPREFIX)s
NOPCH=1
-OVERRIDEFLAGS=%(OVERRIDEFLAGS)s %(OTHERCFLAGS)s
-EXTRAFLAGS = %(CFLAGS)s
+OVERRIDEFLAGS=%(OVERRIDEFLAGS)s
+EXTRAFLAGS = $(CFLAGS) %(OTHERCFLAGS)s
LFLAGS = %(LFLAGS)s %(OTHERLFLAGS)s
EXTRALIBS = %(LIBS)s %(OTHERLIBS)s
+CRTFLAG=%(CRTFLAG)s
+
#----------------------------------------------------------------------
!include $(WXDIR)\\src\\makevc.env
-erase $(TARGET)
-uninstall:
+uninstall: %(OTHERUNINSTALLTARGETS)s
-erase $(TARGETDIR)\\$(TARGET)
- -erase $(PYMODULES)
+%(PYCLEANUP)s
+
#----------------------------------------------------------------------
# implicit rule for compiling .cpp and .c files
#----------------------------------------------------------------------
+showflags:
+ @echo CPPFLAGS:
+ @echo $(CPPFLAGS)
+ @echo LFLAGS:
+ @echo $(LFLAGS)
+
+
%(OTHERRULES)s
'''
VERSION = %(VERSION)s
MODULE = %(MODULE)s
SWIGFLAGS = %(SWIGFLAGS)s %(SWIGTOOLKITFLAG)s %(OTHERSWIGFLAGS)s
-CFLAGS = %(CFLAGS)s %(OTHERCFLAGS)s
+CFLAGS = %(CFLAGS)s $(OPT) %(OTHERCFLAGS)s
LFLAGS = %(LFLAGS)s %(OTHERLFLAGS)s
LIBS = %(LIBS)s %(OTHERLIBS)s
PYVERSION = %(PYVERSION)s
install: $(TARGETDIR) $(TARGETDIR)/$(TARGET) pycfiles %(OTHERINSTALLTARGETS)s
clean:
- -rm -f *.o *.so *~
+ -rm -f *.o *$(SO) *~
-rm -f $(TARGET)
-uninstall:
+uninstall: %(OTHERUNINSTALLTARGETS)s
-rm -f $(TARGETDIR)/$(TARGET)
- -rm -f $(PYMODULES)
+%(PYCLEANUP)s
#----------------------------------------------------------------------
%%.o : $(GENCODEDIR)/%%.c
$(CC) $(CCSHARED) $(CFLAGS) $(OTHERCFLAGS) -c $<
+ifndef NOSWIG
$(GENCODEDIR)/%%.cpp : %%.i
swig $(SWIGFLAGS) -c -o $@ $<
$(GENCODEDIR)/%%.py : %%.i
swig $(SWIGFLAGS) -c -o $(GENCODEDIR)/tmp_wrap.cpp $<
rm $(GENCODEDIR)/tmp_wrap.cpp
+endif
+
$(TARGETDIR)/%% : %%
cp -f $< $@
$(TARGETDIR) :
- mkdir $(TARGETDIR)
+ mkdir -p $(TARGETDIR)
$(GENCODEDIR):
mkdir $(GENCODEDIR)
#----------------------------------------------------------------------------
if __name__ == '__main__':
- main(sys.argv)
+ err = main(sys.argv)
+ sys.exit(err)
#----------------------------------------------------------------------------