From 2ad2b66db3473b0eccfad86a018533eea15f7dd9 Mon Sep 17 00:00:00 2001 From: Jan Vidar Krey Date: Tue, 23 Jun 2009 16:11:30 +0200 Subject: [PATCH] Add a git revision to all debug builds... --- GNUmakefile | 6 ++++++ version.h | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/GNUmakefile b/GNUmakefile index 3715a8c..da9e35e 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -69,8 +69,10 @@ LDFLAGS += -L/source/libevent -include release_setup.mk ifeq ($(RELEASE),YES) CFLAGS += -Os -DNDEBUG +GIT_REVISION ?= NO else CFLAGS += -g -DDEBUG +GIT_REVISION ?= YES endif ifeq ($(STACK_PROTECT),YES) @@ -127,6 +129,10 @@ CFLAGS += -I$(LIBEVENT_PATH) LDFLAGS += -L$(LIBEVENT_PATH) endif +ifeq ($(GIT_REVISION),YES) +CFLAGS += -DGIT_REVISION=\"-git:$(shell git show --oneline | head -n 1 | cut -f 1 -d " ")\" +endif + # Sources libuhub_SOURCES := \ src/auth.c \ diff --git a/version.h b/version.h index 836e09c..dd38934 100644 --- a/version.h +++ b/version.h @@ -6,8 +6,12 @@ #define PRODUCT_TITLE "(micro-Hub)" #endif +#ifndef GIT_REVISION +#define GIT_REVISION "" +#endif + #ifndef VERSION -#define VERSION "0.3.0-rc0" +#define VERSION "0.3.0-rc0" GIT_REVISION #endif #ifndef COPYRIGHT