diff options
| author | Mike Buland <eichlan@xagasoft.com> | 2012-01-04 00:31:46 -0700 |
|---|---|---|
| committer | Mike Buland <eichlan@xagasoft.com> | 2012-01-04 00:31:46 -0700 |
| commit | 8f3b08c826f1174019386c0bfe22627bb269123d (patch) | |
| tree | 1c9b0bcb10f32a64b6b268316856762e6c6b6a0d /default.bld | |
| parent | d8f0276ec9d3b538a5ef8918a3072e3528a480d5 (diff) | |
| download | stage-8f3b08c826f1174019386c0bfe22627bb269123d.tar.gz stage-8f3b08c826f1174019386c0bfe22627bb269123d.tar.bz2 stage-8f3b08c826f1174019386c0bfe22627bb269123d.tar.xz stage-8f3b08c826f1174019386c0bfe22627bb269123d.zip | |
Attempt to generate version.h from git.
Diffstat (limited to '')
| -rw-r--r-- | default.bld | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/default.bld b/default.bld index 0c7f50c..5c3d9b1 100644 --- a/default.bld +++ b/default.bld | |||
| @@ -1,4 +1,29 @@ | |||
| 1 | 1 | ||
| 2 | target "src/version.h" | ||
| 3 | { | ||
| 4 | requires ".git"; | ||
| 5 | profile "build" | ||
| 6 | { | ||
| 7 | fh = open("src/version.h.tmp"); | ||
| 8 | fh.write( | ||
| 9 | "#ifndef VERSION_H\n" | ||
| 10 | "#define VERSION_H\n" | ||
| 11 | "\n" | ||
| 12 | "#define FULLVER \"$(git describe)\"\n" | ||
| 13 | "\n" | ||
| 14 | "#endif"); | ||
| 15 | fh.close(); | ||
| 16 | if "$(cmp src/version.h.tmp src/version.h)" == "" then | ||
| 17 | { | ||
| 18 | execute("rm src/version.h.tmp"); | ||
| 19 | } | ||
| 20 | else | ||
| 21 | { | ||
| 22 | execute("mv src/version.h.tmp src/version.h"); | ||
| 23 | } | ||
| 24 | } | ||
| 25 | } | ||
| 26 | |||
| 2 | CC="g++"; | 27 | CC="g++"; |
| 3 | target "stage" | 28 | target "stage" |
| 4 | { | 29 | { |
