From 30cd5880addf928908817f5e433ea993c83db912 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Thu, 14 Mar 2013 19:56:18 -0400 Subject: add version function, wire it up from the makefile --- Makefile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'Makefile') 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 -- cgit v1.2.3