Description: ensure that Makefile builds texinfo index entries before PDF
 The arm-texi-index.el script rewrites the texinfo source, so it must
 be executed before any target reading it, not only texi2any --info.
 .
 Forwarded by mail on 2022/06/25.
Bug-Debian: https://bugs.debian.org/1013600
Forwarded: yes
Author: Nicolas Boulenguez <nicolas@debian.org>

--- a/build/Makefile
+++ b/build/Makefile
@@ -90,6 +90,7 @@
 	cd $(SOURCE_DIR_$(y)); \
         $(CURDIR)/$$< $(MASTER_$(d)) info $(CHANGES) $(VERSION_$(y)) $(VERSION_$(y)) ./; \
         mv `sed -ne '/^@FilePrefix{\(.*\)}/{s//\L\1/p;q}' $(MASTER_$(d))`.texinfo $(CURDIR)/$$@
+	$(EMACS_EXE) -Q -batch -L ../progs -l arm-texi-index.el --eval '(progn(do-index "$$@")(kill-emacs))'
   clean::
 	rm -f $(d)$(y).texinfo
 
@@ -112,16 +113,9 @@
   clean::
 	rm -f -r $(d)$(y).txt
 
-# ../progs/arm-texi-index.el adds texinfo index entries.
-  $(d)$(y).texinfo-index: $(d)$(y).texinfo
-	$(EMACS_EXE) -Q -batch -L ../progs -l arm-texi-index.el --eval '(progn(do-index "$$<")(kill-emacs))'
-	touch $$@
-  clean::
-	rm -f $(d)$(y).texinfo-index
-
 # texi2any is from texinfo 5
-  $(d)$(y).info: $(d)$(y).texinfo-index
-	texi2any --info $(TEXI_INFO_OPTS) $(d)$(y).texinfo -o $$@
+  $(d)$(y).info: $(d)$(y).texinfo
+	texi2any --info $(TEXI_INFO_OPTS) $$< -o $$@
   clean::
 	rm -f $(d)$(y).info
 
