scons: Create a ocarina-debug launcher
My Sconstruct now supports installing a debug build to /usr/lib/ocarina-debug and launching through ocarina-debug. This should allow me to test pipe related scripts
This commit is contained in:
parent
a1672b83c4
commit
152e7009d8
11
Sconstruct
11
Sconstruct
|
@ -8,6 +8,7 @@ EXTRA = ""
|
|||
DEBUG = True
|
||||
|
||||
PREFIX = "/usr"
|
||||
POSTFIX = ""
|
||||
DESTDIR = ""
|
||||
for argv in sys.argv:
|
||||
split = argv.split("=")
|
||||
|
@ -17,6 +18,7 @@ for argv in sys.argv:
|
|||
FLAGS = ["-O2"]
|
||||
if DEBUG == True:
|
||||
FLAGS = ["-Wall", "-Werror", "-g", "-DDEBUG"]
|
||||
POSTFIX = "-debug"
|
||||
|
||||
env = Environment(CCFLAGS = FLAGS)
|
||||
if ARGUMENTS.get('VERBOSE') != "1":
|
||||
|
@ -51,16 +53,17 @@ ocarina=env.Program('ocarina.bin', list_dirs('libsaria') + list_dirs('ocarina'))
|
|||
Default(ocarina)
|
||||
|
||||
# Install Ocarina
|
||||
lib = DESTDIR + PREFIX + "/lib/ocarina"
|
||||
bin = DESTDIR + PREFIX + "/bin/ocarina"
|
||||
lib = DESTDIR + PREFIX + "/lib/ocarina" + POSTFIX
|
||||
bin = DESTDIR + PREFIX + "/bin/ocarina" + POSTFIX
|
||||
images = lib + "/images"
|
||||
env.Install(lib, ocarina)
|
||||
env.Alias("install", [lib, images, bin])
|
||||
env.Command(images, "./images/", [Copy(images, "./images")])
|
||||
def ocarina_sh(target, source, env):
|
||||
f = open("ocarina.sh", "w")
|
||||
f.write("#!/bin/bash\n")
|
||||
f.write(PREFIX + "/lib/ocarina/ocarina.bin \"$*\"\n")
|
||||
for line in open("scripts/ocarina.sh"):
|
||||
line = line.replace("%%BIN%%", lib + "/ocarina.bin")
|
||||
f.write(line)
|
||||
f.close()
|
||||
env.Command(bin, None, [ocarina_sh, Move(bin, "ocarina.sh"), Chmod(bin, 0755)])
|
||||
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
#!/bin/bash
|
||||
%%BIN%% "$*"
|
Loading…
Reference in New Issue