26 lines
460 B
Python
26 lines
460 B
Python
#!/usr/bin/python
|
|
Import("VERSION", "DEBUG")
|
|
|
|
vers = str(VERSION)
|
|
if DEBUG == True:
|
|
vers += "-debug"
|
|
|
|
text = [ "/*",
|
|
" * Automatically generated by include/Sconscript",
|
|
" */",
|
|
"",
|
|
"#ifndef OCARINA_VERSION_H",
|
|
"#define OCARINA_VERSION_H",
|
|
"",
|
|
"static inline const char *get_version() {",
|
|
" return \"%s\";" % vers,
|
|
"}",
|
|
"",
|
|
"#endif /* OCARINA_VERSION_H */"
|
|
]
|
|
|
|
f = open("version.h", 'w')
|
|
for line in text:
|
|
f.write("%s\n" % line)
|
|
f.close()
|