summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Bernoulli <jonas@bernoul.li>2024-08-17 19:18:19 +0200
committerJonas Bernoulli <jonas@bernoul.li>2024-08-17 19:18:19 +0200
commit1380f7c4887e4f956a648baa33d4e05c419169ce (patch)
treef6691f22971fea316cc5dc7ecae2df16ecd56699
parent4fa6c31c8f8e3fb5536334bac9d62b652dfb5634 (diff)
make: Re-generate %.texi if HEAD changed since previous run
-rw-r--r--.gitignore1
-rw-r--r--default.mk1
-rw-r--r--docs/Makefile6
3 files changed, 7 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore
index d9f1c87..c2ac7de 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,6 +3,7 @@
/docs/*.info
/docs/*.pdf
/docs/*.texi
+/docs/.revdesc
/docs/dir
/docs/stats/
/lisp/*-autoloads.el
diff --git a/default.mk b/default.mk
index f152f45..0577715 100644
--- a/default.mk
+++ b/default.mk
@@ -12,6 +12,7 @@ DOMAIN ?= magit.vc
CFRONT_DIST ?= E2LUHBKU1FBV02
VERSION ?= $(shell test -e $(TOP).git && git describe --tags --abbrev=0 | cut -c2-)
+REVDESC := $(shell test -e $(TOP).git && git describe --tags)
EMACS ?= emacs
EMACS_ARGS ?=
diff --git a/docs/Makefile b/docs/Makefile
index 7a39da8..4285014 100644
--- a/docs/Makefile
+++ b/docs/Makefile
@@ -18,7 +18,11 @@ redo-docs:
@touch $(PKG).org
@make docs
-%.texi: %.org
+.revdesc: ;
+_ := $(shell test "$(REVDESC)" = "$$(cat .revdesc 2> /dev/null)" ||\
+ echo "$(REVDESC)" > .revdesc)
+
+%.texi: %.org .revdesc
@printf "Generating $@\n"
@$(EMACS) $(ORG_ARGS) $< $(ORG_EVAL)