From 766249ec2b1b113adc04dd97cc68857426b44b70 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Fri, 7 Oct 2016 13:57:57 +1030 Subject: [PATCH] Makefile: don't regenerate manpages unless they've really changed. This is terribly ugly :( Closes: #36 Reported-by: Glenn Willen Signed-off-by: Rusty Russell --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 383f4ca73..58d77afdf 100644 --- a/Makefile +++ b/Makefile @@ -188,8 +188,9 @@ $(PROGRAMS): CFLAGS+=-I. default: $(PROGRAMS) $(MANPAGES) daemon-all +# Git doesn't maintain timestamps, so we only regen if git says we should. $(MANPAGES): doc/%: doc/%.txt - a2x --format=manpage $< + if [ "`git log $@ | head -n1`" != "`git log $< | head -n1`" ] || [ "`git diff $<`" != "" ]; then a2x --format=manpage $<; else touch $@; fi # Everything depends on the CCAN headers. $(CCAN_OBJS) $(CDUMP_OBJS) $(HELPER_OBJS) $(BITCOIN_OBJS) $(TEST_PROGRAMS:=.o) ccan/ccan/cdump/tools/cdump-enumstr.o: $(CCAN_HEADERS)