summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2010-01-07 12:51:41 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2010-01-07 12:51:41 +0000
commit84f817704ce4a111e0a128543036d1d828f9d781 (patch)
tree9a522d50e8e874e7d734834dd359c8563cfd91ac
parentfad2796977c093521e6a75e70356f0a2daa6c532 (diff)
downloadlua-openrc-0.1.tar.bz2
lua-openrc-0.1.tar.xz
use git tag in versionv0.1
-rw-r--r--Makefile11
1 files changed, 10 insertions, 1 deletions
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