From 8f3b08c826f1174019386c0bfe22627bb269123d Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Wed, 4 Jan 2012 00:31:46 -0700 Subject: Attempt to generate version.h from git. --- default.bld | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'default.bld') diff --git a/default.bld b/default.bld index 0c7f50c..5c3d9b1 100644 --- a/default.bld +++ b/default.bld @@ -1,4 +1,29 @@ +target "src/version.h" +{ + requires ".git"; + profile "build" + { + fh = open("src/version.h.tmp"); + fh.write( +"#ifndef VERSION_H\n" +"#define VERSION_H\n" +"\n" +"#define FULLVER \"$(git describe)\"\n" +"\n" +"#endif"); + fh.close(); + if "$(cmp src/version.h.tmp src/version.h)" == "" then + { + execute("rm src/version.h.tmp"); + } + else + { + execute("mv src/version.h.tmp src/version.h"); + } + } +} + CC="g++"; target "stage" { -- cgit v1.2.3