3 import sys, glob, os.path, datetime, pwd, time
4 sys.path.append('senfscons')
7 ###########################################################################
9 # Load utilities and setup libraries
11 SENFSCons.UseSTLPort()
12 env = SENFSCons.MakeEnvironment()
17 LIBS = [ 'iberty', '$BOOSTREGEXLIB' ],
18 DOXY_XREF_TYPES = [ 'bug', 'fixme', 'todo', 'idea' ],
19 DOXY_HTML_XSL = '#/doclib/html-munge.xsl',
20 ENV = { 'TODAY' : str(datetime.date.today()),
21 'REVISION' : os.popen("svnversion").read().strip(),
22 'LOGNAME' : os.environ['LOGNAME']
28 # Build modules (that is, instruct to build ... the build happens later)
29 SConscript(glob.glob("*/SConscript"))
31 SENFSCons.StandardTargets(env)
32 SENFSCons.GlobalTargets(env)
33 SENFSCons.Doxygen(env)
35 SENFSCons.DoxyXRef(env,
36 HTML_HEADER = '#/doclib/doxy-header-overview.html',
37 HTML_FOOTER = '#/doclib/doxy-footer.html')
39 def updateRevision(target, source, env):
40 rev = env['ENV']['REVISION']
43 print "Working copy not clean. Run 'svn update'"
48 print "Working copy contains local changes. Commit first"
51 if 'S' in rev or 'M' in rev:
53 changelog = file('debian/changelog.template').read() % {
55 'user': pwd.getpwuid(os.getuid()).pw_gecos.split(',')[0].strip(),
56 'date': time.strftime("%a, %d %b %Y %H:%M:%S +0000", time.gmtime()) }
57 file('debian/changelog','w').write(changelog)
60 env.Alias('deb', [], [ updateRevision,
61 "dpkg-buildpackage -us -uc -rfakeroot" ]))
63 # Create Doxyfile.local if not cleaning and the file does not exist
64 # otherwise doxygen will barf on this non-existent file
65 if not env.GetOption('clean') and not os.path.exists("Doxyfile.local"):
66 Execute(Touch("Doxyfile.local"))