build: Added a `scons archive` command

This will create an ocarina tarball for the current release.
This commit is contained in:
Bryan Schumaker 2011-11-09 23:01:18 -05:00
parent 42d4fd4bd1
commit 624d9a9e74
1 changed files with 14 additions and 0 deletions

View File

@ -39,6 +39,7 @@ def list_dirs(directory):
return [Glob(dir + "/*.cpp") for dir in dirs]
ocarina=env.Program('ocarina.bin', list_dirs('libsaria') + list_dirs('ocarina'))
Default(ocarina)
# Install Ocarina
lib = PREFIX + "/lib/ocarina"
@ -57,3 +58,16 @@ env.Command(bin, None, [ocarina_sh, Move(bin, "ocarina.sh"), Chmod(bin, 0755)])
# Clean up the build directory
Clean(ocarina, ["include/version.h"])
# Create a tarball
def git_archive(target, source, env):
import os
version = "%s.%s" % (MAJOR, MINOR)
if BUG != 0:
version += ".%s" % BUG
if EXTRA != "":
version += "-%s" % EXTRA
if DEBUG == True:
version += "-debug"
os.popen("git archive --prefix=ocarina/ -o ocarina-%s.tar.gz HEAD" % (version))
env.Command("archive", None, [git_archive])