aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
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