From 1f9f814770fb61f41122e5408bf62b47f718e6a1 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Wed, 14 Mar 2012 10:56:23 +0100 Subject: build: use git version tag for version info if available --- Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 3e7f2b0..7bd4315 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,12 @@ SBIN_TARGETS = pingu pinguctl LUA_TARGETS = client.so TARGETS = $(BIN_TARGETS) $(SBIN_TARGETS) $(LUA_TARGETS) VERSION = 1.0 +PINGU_VERSION := $(shell \ + if [ -d .git ]; then \ + git describe --long; \ + else \ + echo $(VERSION); \ + fi) prefix = /usr localstatedir = /var @@ -24,7 +30,7 @@ PKG_CONFIG ?= pkg-config SUBDIRS := man CFLAGS ?= -g -CFLAGS += -DPINGU_VERSION=\"$(VERSION)\" +CFLAGS += -DPINGU_VERSION=\"$(PINGU_VERSION)\" CFLAGS += -Wall -Wstrict-prototypes -D_GNU_SOURCE -std=gnu99 CFLAGS += -DDEFAULT_PIDFILE=\"$(pingustatedir)/pingu.pid\" CFLAGS += -DDEFAULT_ADM_client=\"$(pingustatedir)/pingu.ctl\" -- cgit v1.2.3