Print git revision as version

This commit is contained in:
Erik Ekman 2014-01-29 20:25:45 +01:00
parent 0f7c3782b8
commit fb9e930fee
3 changed files with 4 additions and 8 deletions

View File

@ -6,10 +6,11 @@ SERVER = ../bin/iodined
OS = `echo $(TARGETOS) | tr "a-z" "A-Z"` OS = `echo $(TARGETOS) | tr "a-z" "A-Z"`
ARCH = `uname -m` ARCH = `uname -m`
HEAD_COMMIT = `git rev-parse --short HEAD`
LIBPATH = -L. LIBPATH = -L.
LDFLAGS += -lz `sh osflags $(TARGETOS) link` $(LIBPATH) LDFLAGS += -lz `sh osflags $(TARGETOS) link` $(LIBPATH)
CFLAGS += -c -g -Wall -D$(OS) -pedantic `sh osflags $(TARGETOS) cflags` CFLAGS += -c -g -Wall -D$(OS) -pedantic `sh osflags $(TARGETOS) cflags` -DGITREVISION=\"$(HEAD_COMMIT)\"
all: stateos $(CLIENT) $(SERVER) all: stateos $(CLIENT) $(SERVER)

View File

@ -101,12 +101,9 @@ help() {
static void static void
version() { version() {
char *svnver;
svnver = "$Rev$ from $Date$";
fprintf(stderr, "iodine IP over DNS tunneling client\n"); fprintf(stderr, "iodine IP over DNS tunneling client\n");
fprintf(stderr, "SVN version: %s\n", svnver); fprintf(stderr, "Git version: %s\n", GITREVISION);
exit(0); exit(0);
} }

View File

@ -2228,10 +2228,8 @@ help() {
static void static void
version() { version() {
char *svnver;
svnver = "$Rev$ from $Date$";
fprintf(stderr, "iodine IP over DNS tunneling server\n"); fprintf(stderr, "iodine IP over DNS tunneling server\n");
fprintf(stderr, "SVN version: %s\n", svnver); fprintf(stderr, "Git version: %s\n", GITREVISION);
exit(0); exit(0);
} }