2012-05-27 23:16:56 -04:00
|
|
|
#!/usr/bin/python
|
2012-05-27 23:25:14 -04:00
|
|
|
import os, re
|
2012-05-27 23:16:56 -04:00
|
|
|
|
|
|
|
Import( "env", "DEBUG" )
|
|
|
|
bin = os.path.abspath("../bin/%s")
|
|
|
|
|
|
|
|
def create_script(target, source, env):
|
|
|
|
dst = str(target[0].rfile())
|
|
|
|
src = str(source[0].rfile())
|
|
|
|
|
|
|
|
f = open(dst, "w");
|
|
|
|
for line in open(src):
|
|
|
|
line = line.replace("%APP", "ocarina")
|
|
|
|
line = line.replace("%DEBUG", str(DEBUG))
|
|
|
|
f.write(line)
|
|
|
|
f.close()
|
|
|
|
|
|
|
|
os.chmod(dst, 0755)
|
|
|
|
|
|
|
|
files = []
|
|
|
|
for file in os.listdir("."):
|
|
|
|
# SConscript swap files and stuff
|
|
|
|
if re.search("Sconscript", file):
|
|
|
|
continue
|
|
|
|
elif file[0] == ".":
|
|
|
|
continue
|
|
|
|
|
|
|
|
dst = (bin % file).replace("%APP", "ocarina")
|
|
|
|
files.append(env.Command(dst, file, create_script))
|
|
|
|
|
|
|
|
Return('files')
|