# HG changeset patch # User Kim Alvefur # Date 1443305658 -7200 # Node ID 954a8a8c46d6b60e1563091494b700bb88ac9818 # Parent e8d887ae659a6ae41ec4c15c766c719b31e38e11 Makefile: Simplify generation of prosody.version using magic Make magic diff -r e8d887ae659a -r 954a8a8c46d6 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 > $@ + +