Makefile: Simplify generation of prosody.version using magic Make magic
authorKim Alvefur <zash@zash.se>
Sun, 27 Sep 2015 00:14:18 +0200
changeset 6886 954a8a8c46d6
parent 6885 e8d887ae659a
child 6887 e32275ed5632
Makefile: Simplify generation of prosody.version using magic Make magic
Makefile
--- a/Makefile	Sun Sep 27 00:12:07 2015 +0200
+++ b/Makefile	Sun Sep 27 00:14:18 2015 +0200
@@ -65,8 +65,13 @@
 prosody.cfg.lua.install: prosody.cfg.lua.dist
 	sed 's|certs/|$(INSTALLEDCONFIG)/certs/|' $^ > $@
 
-prosody.version: $(wildcard prosody.release .hg/dirstate)
-	test -f .hg/dirstate && \
-		hexdump -n6 -e'6/1 "%02x"' .hg/dirstate > $@ || true
-	test -f prosody.release && \
-		cp prosody.release $@ || true
+%.version: %.release
+	cp $^ $@
+
+%.version: .hg/dirstate
+	hexdump -n6 -e'6/1 "%02x"' $^ > $@
+
+%.version:
+	echo unknown > $@
+
+