File: version2code.py

package info (click to toggle)
openmsx-debugger 0.1~git20160326-2
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 2,036 kB
  • ctags: 1,708
  • sloc: cpp: 11,862; python: 518; sh: 45; makefile: 13
file content (22 lines) | stat: -rw-r--r-- 682 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Generates version include file.

from outpututils import rewriteIfChanged
from version import extractRevisionString, packageVersion, releaseFlag

import sys

def iterVersionInclude():
	revision = extractRevisionString()

	yield '// Automatically generated by build process.'
	yield 'const bool Version::RELEASE = %s;' % str(releaseFlag).lower()
	yield 'const char* const Version::VERSION = "%s";' % packageVersion
	yield 'const char* const Version::REVISION = "%s";' % revision

if __name__ == '__main__':
	if len(sys.argv) == 2:
		rewriteIfChanged(sys.argv[1], iterVersionInclude())
	else:
		print >> sys.stderr, \
			'Usage: python version2code.py VERSION_HEADER'
		sys.exit(2)