diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2012-03-14 10:56:23 +0100 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2012-03-14 10:56:23 +0100 |
commit | 1f9f814770fb61f41122e5408bf62b47f718e6a1 (patch) | |
tree | 94817878a7c542077d43732ccf82963b62ad856f | |
parent | 68e94a0780098e8b5e4772a270f91a60a370b8f6 (diff) | |
download | pingu-1f9f814770fb61f41122e5408bf62b47f718e6a1.tar.bz2 pingu-1f9f814770fb61f41122e5408bf62b47f718e6a1.tar.xz |
build: use git version tag for version info if available
-rw-r--r-- | Makefile | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -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\" |