aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2015-09-27 00:14:18 +0200
committerKim Alvefur <zash@zash.se>2015-09-27 00:14:18 +0200
commit4d24241616d652a6c94ca698454ed764a72a0d46 (patch)
tree783e3f2ba4f63ab10ecb009a27a469bda0da4478
parent945a98ba5bc025c4140035c94327e4c0dc64576e (diff)
downloadprosody-4d24241616d652a6c94ca698454ed764a72a0d46.tar.gz
prosody-4d24241616d652a6c94ca698454ed764a72a0d46.zip
Makefile: Simplify generation of prosody.version using magic Make magic
-rw-r--r--Makefile15
1 files changed, 10 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index e7a36ffe..403bf842 100644
--- 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 > $@
+
+