Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Import('envService')
- Import('parentEnv')
- import os
- envService.validate_supported_platform('posix')
- env = parentEnv.Clone()
- libTgt = env.buildLibrary(envService, env.Glob('*.c*', exclude='*_test*'))
- srcDir = env.Dir('.').srcnode().path
- sourceFile = os.path.join('#', srcDir, '..', 'VERSION.txt')
- if env.GetOption('svnRev') != None:
- svn_version = env.GetOption('svnRev')
- else:
- svn_version = os.popen('svnversion -n ' + env['LOCALROOT']).read()
- env.Command(target = 'gwversion.h',
- source = sourceFile,
- action = ['echo creating $TARGET',
- 'echo "#define SVN_REVISION \\"' + svn_version + '\\" "> $TARGET',
- 'grep VERSION $SOURCE | awk -F"=" \'{printf ( "#define GW_VERSION \\"%s\\"\\n", $2)}\' >> $TARGET '
- ])
- Return('libTgt')
Advertisement
Add Comment
Please, Sign In to add comment