build: Added a `scons archive` command
This will create an ocarina tarball for the current release.
This commit is contained in:
parent
42d4fd4bd1
commit
624d9a9e74
14
Sconstruct
14
Sconstruct
|
@ -39,6 +39,7 @@ def list_dirs(directory):
|
||||||
return [Glob(dir + "/*.cpp") for dir in dirs]
|
return [Glob(dir + "/*.cpp") for dir in dirs]
|
||||||
|
|
||||||
ocarina=env.Program('ocarina.bin', list_dirs('libsaria') + list_dirs('ocarina'))
|
ocarina=env.Program('ocarina.bin', list_dirs('libsaria') + list_dirs('ocarina'))
|
||||||
|
Default(ocarina)
|
||||||
|
|
||||||
# Install Ocarina
|
# Install Ocarina
|
||||||
lib = PREFIX + "/lib/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 up the build directory
|
||||||
Clean(ocarina, ["include/version.h"])
|
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])
|
||||||
|
|
Loading…
Reference in New Issue