]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/distrib/build.py
2 #----------------------------------------------------------------------------
4 # Purpose: This script is used to build wxPython. It reads a build
5 # configuration file in the requested project directory and
6 # based on the contents of the file can build Makefiles for
7 # unix or win32, and can execute make with various options
8 # potentially automating the entire build/install/clean process
9 # from a single command.
13 # Created: 18-Aug-1999
15 # Copyright: (c) 1999 by Total Control Software
16 # Licence: wxWindows license
17 #----------------------------------------------------------------------------
21 This script is used to build wxPython. It reads a build configuration
22 file in the requested project directory and based on the contents of
23 the file can build Makefiles for unix or win32, and can execute make
24 with various options potentially automating the entire
25 build/install/clean process from a single command.
27 The default action is to build the Makefile and exit.
30 -C dir CD to dir before doing anything
31 -B file Use file as the build configuration (default ./build.cfg)
32 -M file Use file as the name of the makefile to create
35 -b Build the module (runs make)
36 -i Install the module (runs make install)
37 -c Cleanup (runs make clean)
38 -u Uninstall (runs make uninstall)
45 The build configuration file lists targets, source files and options
46 for the the build process. The contents of the build.cfg are used to
47 dynamically generate the Makefile.
49 To prevent you from getting screwed when the default build.cfg is
50 updated, you can override the values in build.cfg by putting your
51 custom definitions in a file named build.local. You can also place a
52 build.local file in the parent directory, or even in the grandparent
53 directory for project-wide overrides. Finally, command-line arguments
54 of the form NAME=VALUE can also be used to override simple configuration
55 values. The order of evaluation is:
57 0. comman-line flags (-M, -b, etc.)
59 2. ../../build.local (if present)
60 3. ../build.local (if present)
61 4. ./build.local (if present)
62 5. command-line NAME=VALUEs
64 The config files are actually just Python files that get exec'ed in a
65 separate namespace which is then used later as a configuration object.
66 This keeps the build script simple in that it doesn't have to parse
67 anything, and the config files can be much more than just names and
68 values as pretty much any python code can be executed. The global
69 variables set in the config namespace are what are used later as
75 The following variables can be set in the config files. Only a few are
76 required, the rest will either have suitable defaults or will be
77 calculated from your current Python runtime environment.
79 MODULE The name of the extension module to produce
80 SWIGFILES A list of files that should be run through SWIG
81 SWIGFLAGS Flags for SWIG
82 SOURCES Other C/C++ sources that should be part of the module
83 PYFILES Other Python files that should be installed with the module
84 CFLAGS Flags to be used by the compiler
85 LFLAGS Flags to be used at the link step
86 LIBS Libraries to be linked with
88 OTHERCFLAGS Extra flags to append to CFLAGS
89 OTHERLFLAGS Extra flags to append to LFLAGS
90 OTHERSWIGFLAGS Extra flags to append to SWIGFLAGS
91 OTHERLIBS Other libraries to be linked with, in addition to LIBS
92 OTHERTARGETS Other targets to be placed on the default rule line
94 Other targets to be placed on the install rule line
95 OTHERDEFS Text to place near the begining of the Makefile
96 OTHERRULES This text is placed at the end of the makefile and
97 will typically be used for adding rules and such
98 DEFAULTRULE Text to be used for the default rule in the makefile
100 TARGETDIR Destination for the install step
102 MAKE The make program to use
103 MAKEFILE The name of the makefile
105 runBuild Setting this to 1 is eqivalent to the -b flag
106 runInstall Setting this to 1 is eqivalent to the -i flag
107 runClean Setting this to 1 is eqivalent to the -c flag
108 runUninstall Setting this to 1 is eqivalent to the -u flag
110 PYVERSION Version number of Python used in pathnames
111 PYPREFIX The root of the Python install
112 EXECPREFIX The root of the Python install for binary files
113 PYTHONLIB The Python link library
117 import sys
, os
, string
, getopt
119 #----------------------------------------------------------------------------
120 # This is really the wxPython version number, and will be placed in the
121 # Makefiles for use with the distribution related targets.
123 major_version
= '2.2'
126 __version__
= major_version
+ '.' + build_version
128 #----------------------------------------------------------------------------
132 opts
, args
= getopt
.getopt(args
[1:], 'C:B:M:bicu')
137 if not os
.environ
.has_key('WXWIN'):
138 print "WARNING: WXWIN is not set in the environment. WXDIR may not\n"\
139 " be set properly in the makefile, you will have to \n"\
140 " set the environment variable or override in build.local."
143 bldCfgLocal
= 'build.local'
144 MAKEFILE
= 'Makefile'
150 for flag
, value
in opts
:
151 if flag
== '-C': os
.chdir(value
)
152 elif flag
== '-B': bldCfgFile
= value
153 elif flag
== '-M': makefile
= value
154 elif flag
== '-b': runBuild
= 1
155 elif flag
== '-c': runClean
= 1
156 elif flag
== '-i': runInstall
= 1
157 elif flag
== '-u': runUninstall
= 1
159 elif flag
== '-h': usage(); sys
.exit(1)
160 else: usage(); sys
.exit(1)
162 config
= BuildConfig(bldCfg
= bldCfg
,
163 bldCfgLocal
= bldCfgLocal
,
166 runInstall
= runInstall
,
168 runUninstall
= runUninstall
)
171 if config
.readConfigFiles(args
):
173 config
.makeMakefile()
176 cmd
= "%s -f %s" % (config
.MAKE
, config
.MAKEFILE
)
177 print "Running:", cmd
180 if not err
and config
.runInstall
:
181 cmd
= "%s -f %s install" % (config
.MAKE
, config
.MAKEFILE
)
182 print "Running:", cmd
186 if not err
and config
.runClean
:
187 cmd
= "%s -f %s clean" % (config
.MAKE
, config
.MAKEFILE
)
188 print "Running:", cmd
191 if not err
and config
.runUninstall
:
192 cmd
= "%s -f %s uninstall" % (config
.MAKE
, config
.MAKEFILE
)
193 print "Running:", cmd
199 #----------------------------------------------------------------------------
204 #----------------------------------------------------------------------------
207 if sys
.platform
!= 'win32':
208 st
= string
.join(string
.split(st
, '\\'), '/')
211 #----------------------------------------------------------------------------
214 return string
.join(string
.split(string
.strip(st
), ' '), ' \\\n\t')
216 #----------------------------------------------------------------------------
219 def __init__(self
, **kw
):
220 self
.__dict
__.update(kw
)
223 #------------------------------------------------------------
224 def setDefaults(self
):
225 base
= os
.path
.split(sys
.argv
[0])[0]
226 base
= os
.path
.join(base
, '..')
227 self
.WXPYDIR
= os
.path
.abspath(base
)
228 self
.VERSION
= __version__
229 self
.MAJVER
= major_version
230 self
.BLDVER
= build_version
233 self
.SWIGFLAGS
= '-c++ -shadow -python -keyword -dnone -I$(WXPSRCDIR)'
237 self
.OTHERCFLAGS
= ''
238 self
.OTHERLFLAGS
= ''
239 self
.OTHERSWIGFLAGS
= ''
241 self
.OTHERTARGETS
= ''
242 self
.OTHERINSTALLTARGETS
= ''
243 self
.OTHERUNINSTALLTARGETS
= ''
245 self
.DEFAULTRULE
= 'default: $(GENCODEDIR) $(TARGET) $(BUILDDIR)/$(TARGET) bldpycfiles'
246 self
.PYVERSION
= sys
.version
[:3]
247 self
.PYPREFIX
= sys
.prefix
248 self
.EXECPREFIX
= sys
.exec_prefix
249 self
.WXDIR
= '$(WXWIN)'
251 self
.WXP_USE_THREAD
= '1'
252 self
.WXUSINGDLL
= '1'
254 self
.WXPSRCDIR
= '$(WXPYDIR)/src'
260 if sys
.platform
== 'win32':
262 self
.PYTHONLIB
= '$(PYPREFIX)\\libs\\python15.lib'
263 self
.TARGETDIR
= '$(PYPREFIX)\\wxPython'
264 self
.LIBS
= '$(PYTHONLIB) $(WXPSRCDIR)\wxc.lib'
265 self
.GENCODEDIR
= 'msw'
266 self
.SWIGTOOLKITFLAG
= '-D__WXMSW__'
268 self
.TARGET
= '$(MODULE).pyd'
269 self
.CFLAGS
= '-I$(PYPREFIX)\include -I$(WXPSRCDIR) -I. /Fp$(MODULE).pch /YXhelpers.h -DSWIG_GLOBAL -DHAVE_CONFIG_H $(THREAD) '
270 self
.LFLAGS
= '$(DEBUGLFLAGS) /DLL /subsystem:windows,3.50 /machine:I386 /nologo'
273 self
.OVERRIDEFLAGS
= '/GX-'
274 self
.RMCMD
= '-erase '
275 self
.WXPSRCDIR
= os
.path
.normpath(self
.WXPSRCDIR
)
281 self
.PYLIB
= '$(EXECPREFIX)/lib/python$(PYVERSION)'
282 self
.LIBPL
= '$(PYLIB)/config'
283 self
.PYTHONLIB
= '$(LIBPL)/libpython$(PYVERSION).a'
284 self
.TARGETDIR
= '$(EXECPREFIX)/lib/python$(PYVERSION)/site-packages/wxPython'
285 self
.TARGET
= '$(MODULE)module$(SO)'
287 self
.HELPERLIB
= 'wxPyHelpers'
288 self
.HELPERLIBDIR
= '$(EXECPREFIX)/lib'
289 self
.CFLAGS
= '-DSWIG_GLOBAL -DHAVE_CONFIG_H $(THREAD) -I. '\
290 '`$(WXCONFIG) --cflags` -I$(PYINCLUDE) -I$(EXECINCLUDE) '\
292 self
.LFLAGS
= '-L$(WXPSRCDIR) `$(WXCONFIG) --libs`'
293 self
.RMCMD
= '-rm -f '
294 self
.WXCONFIG
= 'wx-config'
295 self
.USE_SONAME
= '1'
297 # **** What to do when I start supporting Motif, etc.???
298 self
.GENCODEDIR
= 'gtk'
299 self
.SWIGTOOLKITFLAG
= '-D__WXGTK__'
301 # Extract a few things from Python's Makefile...
303 filename
= os
.path
.join(self
.EXECPREFIX
,
304 'lib/python'+self
.PYVERSION
,
306 mfText
= string
.split(open(filename
, 'r').read(), '\n')
308 raise SystemExit, "Python development files not found"
310 self
.CCC
= self
.findMFValue(mfText
, 'CCC')
311 self
.CC
= self
.findMFValue(mfText
, 'CC')
312 self
.OPT
= self
.findMFValue(mfText
, 'OPT')
313 self
.SO
= self
.findMFValue(mfText
, 'SO')
314 self
.LDSHARED
= self
.findMFValue(mfText
, 'LDSHARED')
315 self
.CCSHARED
= self
.findMFValue(mfText
, 'CCSHARED')
316 #self.LINKFORSHARED = self.findMFValue(mfText, 'LINKFORSHARED')
317 #self. = self.findMFValue(mfText, '')
318 #self. = self.findMFValue(mfText, '')
321 # The majority of cases will require LDSHARED to be
322 # modified to use the C++ driver instead of the C driver
323 # for linking. We'll try to do it here and if we goof up
324 # then the user can correct it in their build.local file.
325 self
.LDSHARED
= string
.join(['$(CCC)'] +
326 string
.split(self
.LDSHARED
, ' ')[1:],
330 #------------------------------------------------------------
332 # This is called after the config files have been evaluated
333 # so we can do some sanity checking...
334 if sys
.platform
!= 'win32':
336 self
.CCC
= os
.popen('%(WXCONFIG)s --cxx' % self
.__dict
__, 'r').read()[:-1]
338 print "Warning: C++ compiler not specified (CCC). Assuming c++"
341 self
.CCC
= os
.popen('%(WXCONFIG)s --cc' % self
.__dict
__, 'r').read()[:-1]
343 print "Warning: C compiler not specified (CC). Assuming cc"
346 #------------------------------------------------------------
347 def findMFValue(self
, mfText
, st
):
348 # Find line begining with st= and return the value
349 # Regex would probably be to cooler way to do this, but
350 # I think this is the most understandable.
352 if string
.find(line
, st
+'=') == 0:
353 st
= string
.strip(line
[len(st
)+1:])
357 #------------------------------------------------------------
358 def makeMakefile(self
):
360 # make a list of object file names
362 for name
in self
.SWIGFILES
:
363 objects
= objects
+ os
.path
.splitext(name
)[0] + self
.OBJEXT
+ ' '
364 for name
in self
.SOURCES
:
365 obj
= os
.path
.basename(name
)
366 objects
= objects
+ os
.path
.splitext(obj
)[0] + self
.OBJEXT
+ ' '
367 self
.OBJECTS
= splitlines(objects
)
370 # now build the text for the dependencies
372 for name
in self
.SWIGFILES
:
373 rootname
= os
.path
.splitext(name
)[0]
374 text
= '$(GENCODEDIR)/%s.cpp $(GENCODEDIR)/%s.py : %s.i %s\n' \
375 '$(TARGETDIR)\\%s.py : $(GENCODEDIR)\\%s.py\n' \
376 '$(BUILDDIR)\\%s.py : $(GENCODEDIR)\\%s.py\n' % \
377 (rootname
, rootname
, rootname
, self
.SWIGDEPS
,
378 rootname
, rootname
, rootname
, rootname
)
379 depends
= depends
+ text
381 text
= '%s%s : %s\n' % \
382 (os
.path
.splitext(name
)[0], self
.OBJEXT
, self
.OTHERDEPS
)
383 depends
= depends
+ text
384 for name
in self
.PYFILES
:
385 text
= '$(TARGETDIR)\\%s.py : %s.py\n' % \
386 tuple([os
.path
.splitext(name
)[0]] * 2)
387 depends
= depends
+ text
389 for name
in self
.SOURCES
:
390 name
= os
.path
.basename(name
)
391 text
= '%s%s : %s\n' % \
392 (os
.path
.splitext(name
)[0], self
.OBJEXT
, self
.OTHERDEPS
)
393 depends
= depends
+ text
395 self
.DEPENDS
= swapslash(depends
)
398 # and the list of .py files
401 for name
in self
.SWIGFILES
:
402 pymodules
= pymodules
+ '$(TARGETDIR)\\%s.py ' % os
.path
.splitext(name
)[0]
403 bldpymodules
= bldpymodules
+ '$(BUILDDIR)\\%s.py ' % os
.path
.splitext(name
)[0]
404 for name
in self
.PYFILES
:
405 pymodules
= pymodules
+ '$(TARGETDIR)\\%s.py ' % os
.path
.splitext(name
)[0]
406 bldpymodules
= bldpymodules
+ '$(BUILDDIR)\\%s.py ' % os
.path
.splitext(name
)[0]
407 self
.PYMODULES
= splitlines(swapslash(pymodules
))
408 self
.BLDPYMODULES
= splitlines(swapslash(bldpymodules
))
411 # now make a list of the python files that would need cleaned up
413 for name
in self
.SWIGFILES
:
414 pycleanup
= pycleanup
+ self
.makeCleanupList(name
)
415 for name
in self
.PYFILES
:
416 pycleanup
= pycleanup
+ self
.makeCleanupList(name
)
417 self
.PYCLEANUP
= swapslash(pycleanup
)
420 # now make a list of the python files that would need uninstalled
422 for name
in self
.SWIGFILES
:
423 pyUninstall
= pyUninstall
+ self
.makeUninstallList(name
)
424 for name
in self
.PYFILES
:
425 pyUninstall
= pyUninstall
+ self
.makeUninstallList(name
)
426 self
.PYUNINSTALL
= swapslash(pyUninstall
)
429 # finally, build the makefile
430 if sys
.platform
== 'win32':
432 self
.RESFILE
= '$(MODULE).res'
433 self
.RESRULE
= '$(MODULE).res : $(MODULE).rc $(WXDIR)\\include\\wx\\msw\\wx.rc\n\t'\
434 '$(rc) -r /i$(WXDIR)\\include -fo$@ $(MODULE).rc'
435 text
= win32Template
% self
.__dict
__
437 text
= unixTemplate
% self
.__dict
__
438 f
= open(self
.MAKEFILE
, 'w')
442 print "Makefile created: ", self
.MAKEFILE
446 #------------------------------------------------------------
447 def makeUninstallList(self
, name
):
449 st
= st
+ '\t%s$(TARGETDIR)\\%s.py\n' % (self
.RMCMD
, os
.path
.splitext(name
)[0])
450 st
= st
+ '\t%s$(TARGETDIR)\\%s.pyc\n' % (self
.RMCMD
, os
.path
.splitext(name
)[0])
451 st
= st
+ '\t%s$(TARGETDIR)\\%s.pyo\n' % (self
.RMCMD
, os
.path
.splitext(name
)[0])
455 #------------------------------------------------------------
456 def makeCleanupList(self
, name
):
458 st
= st
+ '\t%s$(BUILDDIR)\\%s.py\n' % (self
.RMCMD
, os
.path
.splitext(name
)[0])
459 st
= st
+ '\t%s$(BUILDDIR)\\%s.pyc\n' % (self
.RMCMD
, os
.path
.splitext(name
)[0])
460 st
= st
+ '\t%s$(BUILDDIR)\\%s.pyo\n' % (self
.RMCMD
, os
.path
.splitext(name
)[0])
464 #------------------------------------------------------------
465 def readConfigFiles(self
, args
):
466 return self
.processFile(self
.bldCfg
, 1) and \
467 self
.processFile(os
.path
.join('../..', self
.bldCfgLocal
)) and \
468 self
.processFile(os
.path
.join('..', self
.bldCfgLocal
)) and \
469 self
.processFile(os
.path
.join('.', self
.bldCfgLocal
)) and \
470 self
.processArgs(args
)
472 #------------------------------------------------------------
473 def processFile(self
, filename
, required
=0):
475 text
= open(filename
, 'r').read()
478 print "Unable to open %s" % filename
484 exec(text
, self
.__dict
__)
486 print "Error evaluating %s" % filename
488 traceback
.print_exc()
493 #------------------------------------------------------------
494 def processArgs(self
, args
):
497 pair
= string
.split(st
, '=')
499 value
= string
.join(pair
[1:], '=')
500 self
.__dict
__[name
] = value
502 print "Error parsing command-line: %s" % st
508 #------------------------------------------------------------
514 #----------------------------------------------------------------------------
515 #----------------------------------------------------------------------------
516 #----------------------------------------------------------------------------
519 #----------------------------------------------------------------------
520 # This makefile was autogenerated from build.py. Your changes will be
521 # lost if the generator is run again. You have been warned.
522 #----------------------------------------------------------------------
525 VERSION = %(VERSION)s
529 SWIGFLAGS = %(SWIGFLAGS)s %(SWIGTOOLKITFLAG)s %(OTHERSWIGFLAGS)s
532 PYVERSION = %(PYVERSION)s
533 PYPREFIX = %(PYPREFIX)s
534 EXECPREFIX = %(EXECPREFIX)s
535 PYTHONLIB = %(PYTHONLIB)s
537 WXP_USE_THREAD = %(WXP_USE_THREAD)s
538 WXUSINGDLL = %(WXUSINGDLL)s
539 GENCODEDIR = %(GENCODEDIR)s
540 RESFILE = %(RESFILE)s
541 WXPSRCDIR = %(WXPSRCDIR)s
544 WXPYDIR = %(WXPYDIR)s
545 BUILDDIR = $(WXPYDIR)\\wxPython
546 TARGETDIR = %(TARGETDIR)s
548 OBJECTS = %(OBJECTS)s
549 PYMODULES = %(PYMODULES)s
550 BLDPYMODULES = %(BLDPYMODULES)s
556 !if "$(FINAL)" == "0"
557 DEBUGLFLAGS = /DEBUG /INCREMENTAL:YES
559 DEBUGLFLAGS = /INCREMENTAL:NO
561 !if "$(WXP_USE_THREAD)" == "1"
562 THREAD=-DWXP_USE_THREAD=1
569 OVERRIDEFLAGS=%(OVERRIDEFLAGS)s
570 EXTRAFLAGS = $(CFLAGS) %(OTHERCFLAGS)s
572 LFLAGS = %(LFLAGS)s %(OTHERLFLAGS)s
573 EXTRALIBS = %(LIBS)s %(OTHERLIBS)s
577 #----------------------------------------------------------------------
579 !include $(WXDIR)\\src\\makevc.env
581 #----------------------------------------------------------------------
583 %(DEFAULTRULE)s %(OTHERTARGETS)s
587 install: default $(TARGETDIR) $(TARGETDIR)\\$(TARGET) pycfiles %(OTHERINSTALLTARGETS)s
601 -erase $(BUILDDIR)\$(TARGET)
605 uninstall: %(OTHERUNINSTALLTARGETS)s
606 -erase $(TARGETDIR)\\$(TARGET)
610 #----------------------------------------------------------------------
611 # implicit rule for compiling .cpp and .c files
614 $(CPPFLAGS) /c /Tp $<
617 {$(GENCODEDIR)}.cpp{}.obj:
619 $(CPPFLAGS) /c /Tp $<
629 # Implicit rules to run SWIG
630 {}.i{$(GENCODEDIR)}.cpp:
631 swig $(SWIGFLAGS) -c -o $@ $<
633 {}.i{$(GENCODEDIR)}.py:
634 swig $(SWIGFLAGS) -c -o $(GENCODEDIR)\\tmp_wrap.cpp $<
635 -erase $(GENCODEDIR)\\tmp_wrap.cpp
638 {$(GENCODEDIR)}.py{$(TARGETDIR)}.py:
641 {}.py{$(TARGETDIR)}.py:
645 {$(GENCODEDIR)}.py{$(BUILDDIR)}.py:
648 {}.py{$(BUILDDIR)}.py:
651 #----------------------------------------------------------------------
653 $(TARGET) : $(DUMMYOBJ) $(WXLIB) $(OBJECTS) $(RESFILE)
656 $(LFLAGS) /export:init$(MODULE) /implib:./$(MODULE).lib
657 $(DUMMYOBJ) $(OBJECTS) $(RESFILE)
665 $(TARGETDIR)\\$(TARGET) : $(TARGET)
668 $(BUILDDIR)\\$(TARGET) : $(TARGET)
672 pycfiles : $(PYMODULES)
673 $(EXECPREFIX)\\python $(PYPREFIX)\\Lib\\compileall.py -l $(TARGETDIR)
674 $(EXECPREFIX)\\python -O $(PYPREFIX)\Lib\\compileall.py -l $(TARGETDIR)
676 bldpycfiles : $(BLDPYMODULES)
685 #----------------------------------------------------------------------
689 #----------------------------------------------------------------------
703 #----------------------------------------------------------------------------
704 #----------------------------------------------------------------------------
705 #----------------------------------------------------------------------------
708 #----------------------------------------------------------------------
709 # This makefile was autogenerated from build.py. Your changes will be
710 # lost if the generator is run again. You have been warned.
711 #----------------------------------------------------------------------
714 VERSION = %(VERSION)s
718 SWIGFLAGS = %(SWIGFLAGS)s %(SWIGTOOLKITFLAG)s %(OTHERSWIGFLAGS)s
719 CFLAGS = %(CFLAGS)s $(OPT) %(OTHERCFLAGS)s
720 LFLAGS = %(LFLAGS)s %(OTHERLFLAGS)s
722 PYVERSION = %(PYVERSION)s
723 PYPREFIX = %(PYPREFIX)s
724 EXECPREFIX = %(EXECPREFIX)s
725 PYINCLUDE = $(PYPREFIX)/include/python$(PYVERSION)
726 EXECINCLUDE = $(EXECPREFIX)/include/python$(PYVERSION)
729 PYTHONLIB = %(PYTHONLIB)s
731 WXP_USE_THREAD = %(WXP_USE_THREAD)s
732 GENCODEDIR = %(GENCODEDIR)s
733 WXPSRCDIR = %(WXPSRCDIR)s
734 HELPERLIB = %(HELPERLIB)s
735 HELPERLIBDIR = %(HELPERLIBDIR)s
736 WXCONFIG=%(WXCONFIG)s
738 WXPYDIR = %(WXPYDIR)s
739 BUILDDIR = $(WXPYDIR)/wxPython
740 TARGETDIR = %(TARGETDIR)s
748 LDSHARED = %(LDSHARED)s
749 CCSHARED = %(CCSHARED)s
752 OBJECTS = %(OBJECTS)s
753 PYMODULES = %(PYMODULES)s
754 BLDPYMODULES = %(BLDPYMODULES)s
758 ifeq ($(WXP_USE_THREAD), 1)
759 THREAD=-DWXP_USE_THREAD
762 USE_SONAME = %(USE_SONAME)s
763 ifeq ($(USE_SONAME), 1)
764 LIBS = -l$(HELPERLIB) %(OTHERLIBS)s
766 LIBS = $(WXPSRCDIR)/lib$(HELPERLIB)$(SO) %(OTHERLIBS)s
769 #----------------------------------------------------------------------
771 %(DEFAULTRULE)s %(OTHERTARGETS)s
773 install: default $(TARGETDIR) $(TARGETDIR)/$(TARGET) pycfiles %(OTHERINSTALLTARGETS)s
776 -rm -f *.o *$(SO) *$(SO).* *~
778 -rm -f $(BUILDDIR)/$(TARGET)
781 uninstall: %(OTHERUNINSTALLTARGETS)s
782 -rm -f $(TARGETDIR)/$(TARGET)
786 #----------------------------------------------------------------------
789 $(CCC) $(CCSHARED) $(CFLAGS) $(OTHERCFLAGS) -c $<
791 %%.o : $(GENCODEDIR)/%%.cpp
792 $(CCC) $(CCSHARED) $(CFLAGS) $(OTHERCFLAGS) -c $<
795 $(CC) $(CCSHARED) $(CFLAGS) $(OTHERCFLAGS) -c $<
797 %%.o : $(GENCODEDIR)/%%.c
798 $(CC) $(CCSHARED) $(CFLAGS) $(OTHERCFLAGS) -c $<
801 $(GENCODEDIR)/%%.cpp : %%.i
802 swig $(SWIGFLAGS) -c -o $@ $<
804 $(GENCODEDIR)/%%.py : %%.i
805 swig $(SWIGFLAGS) -c -o $(GENCODEDIR)/tmp_wrap.cpp $<
806 rm $(GENCODEDIR)/tmp_wrap.cpp
813 $(TARGETDIR)/%% : $(GENCODEDIR)/%%
819 $(BUILDDIR)/%% : $(GENCODEDIR)/%%
822 #----------------------------------------------------------------------
826 #----------------------------------------------------------------------
828 $(TARGET) : $(OBJECTS)
829 $(LDSHARED) $(OBJECTS) $(LFLAGS) $(LIBS) $(OTHERLIBS) -o $(TARGET)
832 pycfiles : $(PYMODULES)
833 $(EXECPREFIX)/bin/python $(PYLIB)/compileall.py -l $(TARGETDIR)
834 $(EXECPREFIX)/bin/python -O $(PYLIB)/compileall.py -l $(TARGETDIR)
836 bldpycfiles : $(BLDPYMODULES)
840 mkdir -p $(TARGETDIR)
845 #----------------------------------------------------------------------
854 #----------------------------------------------------------------------------
856 if __name__
== '__main__':
860 #----------------------------------------------------------------------------