aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2013-03-14 19:56:18 -0400
committerDave Reisner <dreisner@archlinux.org>2013-04-10 10:12:43 -0400
commit30cd5880addf928908817f5e433ea993c83db912 (patch)
tree5587789d55132e41ee71f841b7cc8df824e41ad2 /Makefile
parent230a127bc8fdf638a0ecccecf43cfed425f30468 (diff)
downloadmirror-ponymix-30cd5880addf928908817f5e433ea993c83db912.tar.gz
mirror-ponymix-30cd5880addf928908817f5e433ea993c83db912.tar.bz2
mirror-ponymix-30cd5880addf928908817f5e433ea993c83db912.zip
add version function, wire it up from the makefile
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile10
1 files changed, 8 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index d2f6b09..3a93916 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,13 @@
+V=1
+VDEVEL=$(shell test -d .git && git describe 2>/dev/null)
+
+ifneq "$(VDEVEL)" ""
+V=$(VDEVEL)
+endif
+
CXX := $(CXX) -std=c++11
-base_CXXFLAGS = -Wall -Wextra -pedantic -O2 -g
+base_CXXFLAGS = -Wall -Wextra -pedantic -O2 -g -DPONYMIX_VERSION=\"$(V)\"
base_LIBS = -lm
libpulse_CXXFLAGS = $(shell pkg-config --cflags libpulse)
@@ -35,6 +42,5 @@ install: ponymix
clean:
$(RM) ponymix pulse.o
-V=$(shell if test -d .git; then git describe; fi)
dist:
git archive --format=tar --prefix=ponymix-$(V)/ HEAD | gzip -9 > ponymix-$(V).tar.gz