39 lines
799 B
Python
39 lines
799 B
Python
#!/usr/bin/python
|
|
import os, re
|
|
from config import *
|
|
|
|
bin = "../bin/%s"
|
|
lib = "../lib/" + application + "/%s"
|
|
|
|
LIBDIR="`dirname $0`/../lib/" + application
|
|
|
|
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", application)
|
|
line = line.replace("%LIB", LIBDIR)
|
|
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
|
|
|
|
dir = bin
|
|
if file == "functions":
|
|
dir = lib
|
|
dst = (dir % file).replace("%APP", application)
|
|
files.append(env.Command(dst, file, create_script))
|
|
|
|
Return('files')
|