summaryrefslogtreecommitdiff
path: root/default.bld
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2012-01-04 01:04:02 -0700
committerMike Buland <eichlan@xagasoft.com>2012-01-04 01:04:02 -0700
commitf6bdcf2a92d78b5debc85eaf29747ac09e23c530 (patch)
tree0730581986cd8f9f9316d0d36057b01787437d38 /default.bld
parent8f3b08c826f1174019386c0bfe22627bb269123d (diff)
downloadstage-f6bdcf2a92d78b5debc85eaf29747ac09e23c530.tar.gz
stage-f6bdcf2a92d78b5debc85eaf29747ac09e23c530.tar.bz2
stage-f6bdcf2a92d78b5debc85eaf29747ac09e23c530.tar.xz
stage-f6bdcf2a92d78b5debc85eaf29747ac09e23c530.zip
Ok, it seems to work, it's tag based...
Diffstat (limited to 'default.bld')
-rw-r--r--default.bld15
1 files changed, 11 insertions, 4 deletions
diff --git a/default.bld b/default.bld
index 5c3d9b1..572e992 100644
--- a/default.bld
+++ b/default.bld
@@ -1,19 +1,26 @@
1 1
2action "default"
3{
4 build: ["src/version.h", "stage"];
5}
6
2target "src/version.h" 7target "src/version.h"
3{ 8{
4 requires ".git"; 9 input ".git";
5 profile "build" 10 profile "build"
6 { 11 {
7 fh = open("src/version.h.tmp"); 12 fh = open("src/version.h.tmp", "w");
8 fh.write( 13 fh.write(
9"#ifndef VERSION_H\n" 14"#ifndef VERSION_H\n"
10"#define VERSION_H\n" 15"#define VERSION_H\n"
11"\n" 16"\n"
17"#define VERSION \"$(git describe --abbrev=0)\"\n"
12"#define FULLVER \"$(git describe)\"\n" 18"#define FULLVER \"$(git describe)\"\n"
19"#define SHAVER \"$(git log -n1 --pretty=format:%H)\"\n"
13"\n" 20"\n"
14"#endif"); 21"#endif");
15 fh.close(); 22 fh.close();
16 if "$(cmp src/version.h.tmp src/version.h)" == "" then 23 if "$(cmp src/version.h.tmp src/version.h 2>&1)" == "" then
17 { 24 {
18 execute("rm src/version.h.tmp"); 25 execute("rm src/version.h.tmp");
19 } 26 }
@@ -28,7 +35,7 @@ CC="g++";
28target "stage" 35target "stage"
29{ 36{
30 rule "exe"; 37 rule "exe";
31 input files("src/*.y", "src/*.l", "src/*.cpp"); 38 input files("src/*.y", "src/*.l", "src/*.cpp", "src/version.h");
32 39
33 CXXFLAGS="-ggdb"; 40 CXXFLAGS="-ggdb";
34 CFLAGS="-ggdb"; 41 CFLAGS="-ggdb";