34 lines
664 B
Plaintext
34 lines
664 B
Plaintext
|
#!/usr/bin/python
|
||
|
import os
|
||
|
import re
|
||
|
|
||
|
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")
|
||
|
print dst
|
||
|
files.append(env.Command(dst, file, create_script))
|
||
|
|
||
|
Return('files')
|