Makefile: Simplify generation of prosody.version using magic Make magic
authorKim Alvefur <zash@zash.se>
Sat, 26 Sep 2015 22:14:18 +0000 (00:14 +0200)
committerKim Alvefur <zash@zash.se>
Sat, 26 Sep 2015 22:14:18 +0000 (00:14 +0200)
Makefile

index e7a36ffe8cc1c1e7d201a4b7b044f0fcaafae6df..403bf842749377d4eabcc1f0300ae25838e701bb 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -65,8 +65,13 @@ util/%.so:
 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 > $@
+
+