diff --git a/Sconstruct b/Sconstruct index 63975cf2..a4b84a71 100644 --- a/Sconstruct +++ b/Sconstruct @@ -31,38 +31,16 @@ env.ParseConfig('pkg-config --cflags --libs gstreamer-0.10') env.ParseConfig('pkg-config --cflags --libs gstreamer-interfaces-0.10') env.ParseConfig('pkg-config --cflags --libs taglib') -def version_h(target, source, env): - f = open("include/version.h", "w") - for line in open("include/version.tmpl", "r"): - line = line.replace("__MAJOR__", str(MAJOR)) - line = line.replace("__MINOR__", str(MINOR)) - line = line.replace("__BUG__", str(BUG)) - line = line.replace("__EXTRA__", str(EXTRA)) - f.write(line) - f.close() +Export("env", "MAJOR", "MINOR", "BUG", "EXTRA", "DEBUG") def list_dirs(directory): import os dirs = [x[0] for x in os.walk(directory)] return [Glob(dir + "/*.cpp") for dir in dirs] -# Note: a version.h file is not created in this directory, -# so the command will always run. -version_h=env.Command("version.h", None, version_h) ocarina=env.Program('ocarina.bin', list_dirs('libsaria') + list_dirs('ocarina')) -Default([version_h, ocarina]) - -tests=os.listdir("tests/") -test_list = [] -for test in tests: - if test[0] == ".": - continue; - split = test.rsplit(".", 1); - src = "tests/" + test - dst = "test_" + split[0] - test_list.append(env.Program(dst, list_dirs('libsaria') + [src])) - -env.Alias("tests", [version_h] + [test_list]); +SConscript(['include/Sconscript']) +Default([ocarina]) # Install Ocarina scripts = os.listdir("scripts/") diff --git a/include/Sconscript b/include/Sconscript new file mode 100644 index 00000000..68322fe5 --- /dev/null +++ b/include/Sconscript @@ -0,0 +1,12 @@ +#!/usr/bin/python + +Import("MAJOR", "MINOR", "BUG", "EXTRA") + +f = open("version.h", "w") +for line in open("version.tmpl", "r"): + line = line.replace("__MAJOR__", str(MAJOR)) + line = line.replace("__MINOR__", str(MINOR)) + line = line.replace("__BUG__", str(BUG)) + line = line.replace("__EXTRA__", str(EXTRA)) + f.write(line) +f.close() diff --git a/tests/libsaria.cpp b/tests/libsaria.cpp deleted file mode 100644 index e40a5309..00000000 --- a/tests/libsaria.cpp +++ /dev/null @@ -1,9 +0,0 @@ -#include - -int main (int argc, char **argv) -{ - libsaria::init(argc, argv); - while (libsaria::idle::run_task() != 0); - libsaria::quit(); - return 0; -}