summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile10
1 files changed, 9 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index d49a3bf..8ecc858 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
# Makefile for mdns-repeater
-HGVERSION=$(shell hg id -i)
+HGVERSION=$(shell hg parents --template "{latesttag}.{latesttagdistance}")
CFLAGS=-Wall
@@ -17,9 +17,17 @@ CFLAGS+= -DHGVERSION="\"${HGVERSION}\""
all: mdns-repeater
+mdns-repeater.o: _hgversion
+
mdns-repeater: mdns-repeater.o
+# version checking rules
+.PHONY: dummy
+_hgversion: dummy
+ @echo $(HGVERSION) | cmp -s $@ - || echo $(HGVERSION) > $@
+
clean:
-$(RM) *.o
+ -$(RM) _hgversion
-$(RM) mdns-repeater