From d922c89b4d2a978fd886f1cc1a19edc6a2571dfb Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Tue, 2 Jul 2024 11:32:07 +0930 Subject: [PATCH] doc: don't include exact version in manpages. This slows compilation somewhat when we make small changes (e.g. making the tree dirty). Instead, simply mark them as "pre-XXX" or "XXX". Signed-off-by: Rusty Russell --- doc/Makefile | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/doc/Makefile b/doc/Makefile index 4421946d9662..4471a1f71af6 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -185,8 +185,14 @@ else LOWDOWN := lowdown endif -$(MANPAGES): doc/%: doc/%.md tools/md2man.sh version_gen.h - @VERSION=$(VERSION) tools/md2man.sh $(LOWDOWN) $< > $@ +# For versions in documentation, we don't change with every git version, to +# save build time. We simply to pre-XXX and XXX. +doc/.doc_version: version_gen.h + @if [ "$(VERSION)" = "$(CLN_NEXT_VERSION)" ]; then DOC_VERSION="$(VERSION)"; else DOC_VERSION="pre-$(CLN_NEXT_VERSION)"; fi; echo $$DOC_VERSION > $@.new + @if cmp $@.new $@ >/dev/null 2>&1; then rm -f $@.new; else mv $@.new $@; $(ECHO) Documentation version updated to `cat doc/.doc_version`; fi + +$(MANPAGES): doc/%: doc/%.md tools/md2man.sh doc/.doc_version + @VERSION=`cat doc/.doc_version` tools/md2man.sh $(LOWDOWN) $< > $@ doc/protocol-%.svg: test/test_protocol test/test_protocol --svg < test/commits/$*.script > $@ @@ -231,7 +237,7 @@ check-config-docs: @for c in `grep -v '\[plugin ' doc/lightningd-config.5.md | sed -n 's/^ \*\*\([^*]*\)\*\*.*/\1/p' | grep -v '^\(help\|version\|mainnet\|testnet\|signet\|plugin\|important-plugin\|plugin-dir\|clear-plugins\)$$'`; do if ! grep -q '"'"$$c"'"' doc/schemas/lightning-listconfigs.json; then echo "$$c documented but not in schema!"; exit 1; fi; done doc-clean: - $(RM) $(MANPAGES) $(MARKDOWN_WITH_SCHEMA) + $(RM) $(MANPAGES) $(MARKDOWN_WITH_SCHEMA) doc/.doc_version $(RM) doc/deployable-lightning.{aux,bbl,blg,dvi,log,out,tex} doc/index.rst: $(MANPAGES:=.md)