From 84f817704ce4a111e0a128543036d1d828f9d781 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Thu, 7 Jan 2010 12:51:41 +0000 Subject: use git tag in version --- Makefile | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 5351774..5b44ec8 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,21 @@ VERSION = 0.1 +GIT_REV := $(shell test -d .git && git describe || echo exported) +ifneq ($(GIT_REV), exported) +FULL_VERSION := $(GIT_REV) +FULL_VERSION := $(patsubst v%,%,$(FULL_VERSION)) +else +FULL_VERSION := $(VERSION) +endif + + OBJS = rc.o LIBS = -lrc DEBUGFLAGS = -g -Wall -Werror CFLAGS += $(DEBUGFLAGS) -CFLAGS += -DVERSION=\"$(VERSION)\" +CFLAGS += -DVERSION=\"$(FULL_VERSION)\" LDFLAGS += -L/lib -- cgit v1.2.3