# HG changeset patch # User Rik # Date 1669694049 28800 # Node ID 24b71381cbfa933ea1062d29dfcb80bc4e3f51a3 # Parent 017ec2d748f76e1fdeeb50819e313fcae819f95d doc: Use Makefile rules to auto-generate EDITION Texinfo variable for octave.texi * octave.texi: Use @include to include new "octave-doc-version.texi" file with EDITION variable. Use @value{EDITION} in @subtitle macro to avoid having to manually change text for every release. * doc/interpreter/module.mk: New rule to build "octave-doc-version.texi" which depends on "version-octave.texi" that is created by Automake. Change documentation target rules for .info, .dvi, .pdf, .html to depend on "octave-doc-version.texi". Add new file to doc_EXTRA_DIST and doc_MAINTAINERCLEANFILES to distribute it in tarball and to clean it up. diff -r 017ec2d748f7 -r 24b71381cbfa doc/interpreter/module.mk --- a/doc/interpreter/module.mk Mon Nov 28 18:00:27 2022 -0500 +++ b/doc/interpreter/module.mk Mon Nov 28 19:54:09 2022 -0800 @@ -271,7 +271,13 @@ endif -$(srcdir)/%reldir%/octave.info: %reldir%/octave.texi $(srcdir)/%reldir%/version-octave.texi +# Create a version file where EDITION variable only holds MAJOR number +$(srcdir)/%reldir%/octave-doc-version.texi: $(srcdir)/%reldir%/version-octave.texi + $(AM_V_GEN)rm -f $@-t $@ ; \ + $(SED) 's#\(@set EDITION [0-9]\+\)\..*$$#\1#' $(srcdir)/%reldir%/version-octave.texi > $@-t ; \ + mv $@-t $@ + +$(srcdir)/%reldir%/octave.info: %reldir%/octave.texi $(srcdir)/%reldir%/octave-doc-version.texi $(AM_V_MAKEINFO)restore=: && backupdir="$(am__leading_dot)am$$$$" && \ am__cwd=`pwd` && $(am__cd) $(srcdir) && \ rm -rf $$backupdir && mkdir $$backupdir && \ @@ -293,13 +299,13 @@ fi; \ rm -rf $$backupdir; exit $$rc -%reldir%/octave.dvi: %reldir%/octave.texi $(srcdir)/%reldir%/version-octave.texi | %reldir%/$(am__dirstamp) +%reldir%/octave.dvi: %reldir%/octave.texi $(srcdir)/%reldir%/octave-doc-version.texi | %reldir%/$(am__dirstamp) $(AM_V_TEXI2DVI)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I doc/interpreter -I $(srcdir)/doc/interpreter' \ $(TEXI2DVI) $(AM_V_texinfo) --build-dir=$(@:.dvi=.t2d) -o $@ $(AM_V_texidevnull) \ `test -f '%reldir%/octave.texi' || echo '$(abs_top_srcdir)/'`%reldir%/octave.texi -%reldir%/octave.pdf: %reldir%/octave.texi $(srcdir)/%reldir%/version-octave.texi | %reldir%/$(am__dirstamp) +%reldir%/octave.pdf: %reldir%/octave.texi $(srcdir)/%reldir%/octave-doc-version.texi | %reldir%/$(am__dirstamp) $(AM_V_TEXI2PDF)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I doc/interpreter -I $(abs_top_srcdir)/doc/interpreter' \ $(TEXI2PDF) $(AM_V_texinfo) --build-dir=$(@:.pdf=.t2p) -o $@ $(AM_V_texidevnull) \ @@ -307,7 +313,7 @@ %reldir%/octave.html: $(OCTAVE_HTML_STAMP) -$(OCTAVE_HTML_STAMP): %reldir%/octave.texi $(srcdir)/%reldir%/version-octave.texi | %reldir%/$(am__dirstamp) +$(OCTAVE_HTML_STAMP): %reldir%/octave.texi $(srcdir)/%reldir%/octave-doc-version.texi | %reldir%/$(am__dirstamp) $(AM_V_MAKEINFO)rm -rf $(OCTAVE_HTML_DIR) $(AM_V_at)if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) \ -I doc/interpreter -I $(abs_top_srcdir)/doc/interpreter \ @@ -420,6 +426,7 @@ %reldir%/mk-qthelp.pl \ %reldir%/mkcontrib.awk \ %reldir%/munge-texi.pl \ + %reldir%/octave-doc-version.texi \ $(DOC_IMAGES) \ $(DOC_IMAGES_SRC) \ $(LOGOS) \ @@ -427,6 +434,7 @@ doc_MAINTAINERCLEANFILES += \ AUTHORS \ + %reldir%/octave-doc-version.texi \ $(BUILT_DOC_IMAGES) \ $(BUILT_OCTAVE_TEXI_SRC) \ $(OCTAVE_QTHELP_FILES) diff -r 017ec2d748f7 -r 24b71381cbfa doc/interpreter/octave.texi --- a/doc/interpreter/octave.texi Mon Nov 28 18:00:27 2022 -0500 +++ b/doc/interpreter/octave.texi Mon Nov 28 19:54:09 2022 -0800 @@ -60,7 +60,9 @@ @c The version.texi file doesn't include a chapter, so it must not be included @c if you want to run the Emacs function texinfo-multiple-files-update. +@c MUST include "version-octave.texi" in order for Automake to create file @include version-octave.texi +@include octave-doc-version.texi @settitle GNU Octave (version @value{VERSION}) @@ -92,12 +94,7 @@ @titlepage @title GNU Octave @subtitle A high-level interactive language for numerical computations -@c FIXME: Would like to use @value{EDITION} but this variable is the -@c same as VERSION and contains MAJOR.MINOR.PATCH. The variable -@c is automatically generated by Automake in version-octave.texi. -@c Need to use sed to strip off MINOR.PATCH numbers and place -@c the results in a new file, and then @include that new file. -@subtitle Edition 8 for Octave version @value{VERSION} +@subtitle Edition @value{EDITION} for Octave version @value{VERSION} @subtitle @value{UPDATED-MONTH} @sp 2 @multitable @columnfractions 0.4 0.025 0.65