aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2014-07-03 14:45:12 +0200
committerGravatar Christian Hesse <mail@eworm.de>2014-07-03 14:45:12 +0200
commitf7e37804586beee663d63b504510fefb28a2953e (patch)
tree48025daa911ee3760000651d6824fbbd9db068ce /Makefile
parent0d6db7e0e2feed59d235e0a13cb0ea61afb63365 (diff)
downloadjournal-notify-f7e37804586beee663d63b504510fefb28a2953e.tar.gz
journal-notify-f7e37804586beee663d63b504510fefb28a2953e.tar.zst
add version and verbose output
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile7
1 files changed, 6 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 4601c7d..8b8b2e6 100644
--- a/Makefile
+++ b/Makefile
@@ -14,7 +14,12 @@ VERSION := 0.0.2
all: journal-notify README.html
-journal-notify: journal-notify.c
+version.h: $(wildcard .git/HEAD .git/index .git/refs/tags/*) Makefile
+ echo "#ifndef VERSION" > $@
+ echo "#define VERSION \"$(shell git describe --tags --long 2>/dev/null || echo ${VERSION})\"" >> $@
+ echo "#endif" >> $@
+
+journal-notify: journal-notify.c version.h
$(CC) $(CFLAGS) -o journal-notify journal-notify.c
README.html: README.md