From 4d24241616d652a6c94ca698454ed764a72a0d46 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 27 Sep 2015 00:14:18 +0200 Subject: Makefile: Simplify generation of prosody.version using magic Make magic --- Makefile | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'Makefile') 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 > $@ + + -- cgit v1.2.3 From 8891876d7de90501961c187f9b2f210f9cafa74e Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 27 Sep 2015 00:15:57 +0200 Subject: Makefile: Support generating prosody.version from hg archive metadata file --- Makefile | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 403bf842..c508dc5f 100644 --- a/Makefile +++ b/Makefile @@ -68,6 +68,9 @@ prosody.cfg.lua.install: prosody.cfg.lua.dist %.version: %.release cp $^ $@ +%.version: .hg_archival.txt + sed -n 's/^node: \(............\).*/\1/p' $^ > $@ + %.version: .hg/dirstate hexdump -n6 -e'6/1 "%02x"' $^ > $@ -- cgit v1.2.3 From 787f6a522a3f655de889a0daa062e2a489eb49ea Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 27 Sep 2015 00:16:34 +0200 Subject: Makefile: Use hypen to tell Make when to ignore errors --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index c508dc5f..e2eca7f1 100644 --- a/Makefile +++ b/Makefile @@ -18,7 +18,7 @@ INSTALLEDDATA = $(DATADIR) all: prosody.install prosodyctl.install prosody.cfg.lua.install prosody.version $(MAKE) -C util-src install ifeq ($(EXCERTS),yes) - $(MAKE) -C certs localhost.crt example.com.crt || true + -$(MAKE) -C certs localhost.crt example.com.crt endif install: prosody.install prosodyctl.install prosody.cfg.lua.install util/encodings.so util/encodings.so util/pposix.so util/signal.so @@ -42,7 +42,7 @@ install: prosody.install prosodyctl.install prosody.cfg.lua.install util/encodin install -m644 certs/* $(CONFIG)/certs install -m644 man/prosodyctl.man $(MAN)/man1/prosodyctl.1 test -f $(CONFIG)/prosody.cfg.lua || install -m644 prosody.cfg.lua.install $(CONFIG)/prosody.cfg.lua - test -f prosody.version && install -m644 prosody.version $(SOURCE)/prosody.version || true + -test -f prosody.version && install -m644 prosody.version $(SOURCE)/prosody.version $(MAKE) install -C util-src clean: -- cgit v1.2.3