build: Generate ocarina.sh during instatll

I was doing this whenever the Command() class was constructed, instead I
only want to do this when it's run.
This commit is contained in:
Bryan Schumaker 2011-11-09 08:34:08 -05:00
parent 026bf0c010
commit 6f96a1d135
1 changed files with 3 additions and 3 deletions

View File

@ -47,13 +47,13 @@ images = lib + "/images"
env.Install(lib, ocarina)
env.Alias("install", [lib, images, bin])
env.Command(images, "./images/", [Copy(images, "./images")])
def ocarina_sh():
def ocarina_sh(target, source, env):
f = open("ocarina.sh", "w")
f.write("#!/bin/bash\n")
f.write(PREFIX + "/lib/ocarina/ocarina.bin \"$*\"\n")
f.close()
return "./ocarina.sh"
env.Command(bin, ocarina_sh(), [Move(bin, "$SOURCE"), Chmod(bin, 0755)])
#return "./ocarina.sh"
env.Command(bin, None, [ocarina_sh, Move(bin, "ocarina.sh"), Chmod(bin, 0755)])
# Clean up the build directory
Clean(ocarina, ["include/version.h"])