X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=senfscons%2FSENFSCons.py;fp=senfscons%2FSENFSCons.py;h=0000000000000000000000000000000000000000;hb=d33cd468d4ece7c0c98270b4d1a9858e5a94510d;hp=ba49af59335b3c5232610f377f2c39eaf204710c;hpb=8a3a987daec0028a9e41abd09c187948c8cb393c;p=senf.git diff --git a/senfscons/SENFSCons.py b/senfscons/SENFSCons.py deleted file mode 100644 index ba49af5..0000000 --- a/senfscons/SENFSCons.py +++ /dev/null @@ -1,90 +0,0 @@ -import os.path, glob -import SCons.Options, SCons.Environment, SCons.Script.SConscript, SCons.Node.FS -import SCons.Defaults, SCons.Action -from SCons.Script import * - -def Glob(env, exclude=[], subdirs=[]): - testSources = glob.glob("*.test.cc") - sources = [ x for x in glob.glob("*.cc") if x not in testSources and x not in exclude ] - for subdir in subdirs: - testSources += glob.glob(os.path.join(subdir,"*.test.cc")) - sources += [ x for x in glob.glob(os.path.join(subdir,"*.cc")) - if x not in testSources and x not in exclude ] - includes = [] - for d in [ '.' ] + subdirs: - for f in os.listdir(d): - ext = '.' + f.split('.',1)[-1] - p = os.path.join(d,f) - if ext in env['CPP_INCLUDE_EXTENSIONS'] \ - and ext not in env['CPP_EXCLUDE_EXTENSIONS'] \ - and p not in exclude: - includes.append(p) - return ( sources, testSources, includes ) - -def Doxygen(env, doxyfile = "Doxyfile", extra_sources = []): - # There is one small problem we need to solve with this builder: The Doxygen builder reads - # the Doxyfile and thus depends on the environment variables set by doclib/doxygen.sh. We - # thus have to provide all necessary definitions here manually via DOXYENV ! - - if type(doxyfile) is type(""): - doxyfile = env.File(doxyfile) - - # Module name is derived from the doxyfile path - # Utils/Console/Doxyfile -> Utils_Console - module = doxyfile.dir.get_path(env.Dir('#')).replace('/','_') - if module == '.' : module = "Main" - - # Rule to generate tagfile - # (need to exclude the 'clean' case, otherwise we'll have duplicate nodes) - if not env.GetOption('clean'): - tagfile = env.Doxygen(doxyfile, - DOXYOPTS = [ '--tagfile-name', '"${MODULE}.tag"', - '--tagfile' ], - DOXYENV = { 'TOPDIR' : env.Dir('#').abspath, - 'output_dir' : 'doc', - 'html_dir' : 'html', - 'html' : 'NO', - 'generate_tagfile': 'doc/${MODULE}.tag' }, - MODULE = module ) - env.Append(ALL_TAGFILES = tagfile[0].abspath) - env.Depends(tagfile, env.File('#/doclib/doxygen.sh')) - - # Rule to generate HTML documentation - doc = env.Doxygen(doxyfile, - DOXYOPTS = [ '--tagfiles', '"$ALL_TAGFILES"', - '--tagfile-name', '"${MODULE}.tag"', - '--html' ], - MODULE = module, - DOXYENV = { 'TOPDIR' : env.Dir('#').abspath, - 'tagfiles' : '${ALL_TAGFILES}', - 'output_dir' : 'doc', - 'html_dir' : 'html', - 'html' : 'YES' } ) - env.Depends(doc, env.File('#/doclib/doxygen.sh')) - - # Copy the extra_sources (the images) into the documentation directory - # (need to exclude the 'clean' case otherwise there are multiple ways to clean the copies) - if not env.GetOption('clean'): - if extra_sources: - env.Depends(doc, env.CopyToDir(doc[0].dir, extra_sources)) - - # Install documentation into DOCINSTALLDIR - l = len(env.Dir('#').abspath) - env.Install(env.Dir('$DOCINSTALLDIR').Dir(doc[0].dir.get_path('#')), doc[0].dir) - - # Useful aliases - env.Alias('all_docs', doc) - env.Clean('all_docs', doc) - env.Clean('all', doc) - - return doc - -def AllIncludesHH(env, exclude=[]): - exclude = exclude[:] + ['all_includes.hh'] # Make a copy !! - headers = [ f for f in glob.glob("*.hh") - if f not in exclude and not f.endswith('.test.hh') ] - headers.sort() - target = env.File("all_includes.hh") - file(target.abspath,"w").write("".join([ '#include "%s"\n' % f - for f in headers ])) - env.Clean('all', target)