Add a git revision to all debug builds...

This commit is contained in:
Jan Vidar Krey 2009-06-23 16:11:30 +02:00
parent ca33461851
commit 2ad2b66db3
2 changed files with 11 additions and 1 deletions

View File

@ -69,8 +69,10 @@ LDFLAGS += -L/source/libevent
-include release_setup.mk -include release_setup.mk
ifeq ($(RELEASE),YES) ifeq ($(RELEASE),YES)
CFLAGS += -Os -DNDEBUG CFLAGS += -Os -DNDEBUG
GIT_REVISION ?= NO
else else
CFLAGS += -g -DDEBUG CFLAGS += -g -DDEBUG
GIT_REVISION ?= YES
endif endif
ifeq ($(STACK_PROTECT),YES) ifeq ($(STACK_PROTECT),YES)
@ -127,6 +129,10 @@ CFLAGS += -I$(LIBEVENT_PATH)
LDFLAGS += -L$(LIBEVENT_PATH) LDFLAGS += -L$(LIBEVENT_PATH)
endif endif
ifeq ($(GIT_REVISION),YES)
CFLAGS += -DGIT_REVISION=\"-git:$(shell git show --oneline | head -n 1 | cut -f 1 -d " ")\"
endif
# Sources # Sources
libuhub_SOURCES := \ libuhub_SOURCES := \
src/auth.c \ src/auth.c \

View File

@ -6,8 +6,12 @@
#define PRODUCT_TITLE "(micro-Hub)" #define PRODUCT_TITLE "(micro-Hub)"
#endif #endif
#ifndef GIT_REVISION
#define GIT_REVISION ""
#endif
#ifndef VERSION #ifndef VERSION
#define VERSION "0.3.0-rc0" #define VERSION "0.3.0-rc0" GIT_REVISION
#endif #endif
#ifndef COPYRIGHT #ifndef COPYRIGHT