| # Makefile.am for texinfo/man. |
| # |
| # Copyright 2002-2026 Free Software Foundation, Inc. |
| # |
| # This file is free software; as a special exception the author gives |
| # unlimited permission to copy and/or distribute it, with or without |
| # modifications, as long as this notice is preserved. |
| # |
| # This program is distributed in the hope that it will be useful, but |
| # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the |
| # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| |
| # These are hand-written. |
| man_MANS = info.5 texinfo.5 |
| |
| # These are just .so's to the common program. |
| man_MANS += texi2any.1 texi2pdf.1 pdftexi2dvi.1 |
| |
| # These are generated using help2man. |
| generated_mans = install-info.1 makeinfo.1 texindex.1 texi2dvi.1 |
| |
| # These require the build in info/, thus can't do if we failed to find a |
| # terminal library. |
| if HAVE_TERMLIBS |
| generated_mans += info.1 |
| endif |
| |
| generated_mans += pod2texi.1 |
| |
| $(srcdir)/pod2texi.1: $(top_srcdir)/Pod-Simple-Texinfo/pod2texi.pl |
| $(POD2MAN) -r perl $(top_srcdir)/Pod-Simple-Texinfo/pod2texi.pl \ |
| | sed 's/\(Automatically generated by Pod::Man \).* \((Pod::Simple\) .*)/\1\2)/' >"$@" |
| |
| |
| man_MANS += $(generated_mans) |
| |
| EXTRA_DIST = $(man_MANS) ginfo.h2m |
| |
| # Maintainers should be able to regenerate. |
| MAINTAINERCLEANFILES = $(generated_mans) |
| |
| # |
| # Use the programs built in our distribution, taking account of possible |
| # cross-compiling. makeinfo needs a bunch of our included modules. |
| t2a_srcdir = $(top_srcdir)/tta |
| MAKEINFO_ENVIRONMENT = TEXINFO_DEV_SOURCE=1 ; export TEXINFO_DEV_SOURCE ; \ |
| t2a_srcdir="$(top_srcdir)/tta" ; export t2a_srcdir ; \ |
| t2a_builddir="$(top_builddir)/tta" ; export t2a_builddir ; |
| |
| mi_env = \ |
| TEXINFO_DEV_SOURCE=1; export TEXINFO_DEV_SOURCE; ${MAKEINFO_ENVIRONMENT} |
| |
| # Set up the variables. makeinfo, texindex are no longer a .exe(cutable). |
| man_rule_0 = \ |
| exe_ext="$(EXEEXT)" \ |
| && program=`expr '/$@' : '.*/\(.*\)\.1'` \ |
| && case $$program in \ |
| makeinfo) dir=tta/perl; $(mi_env) exe_ext="";; \ |
| info*) dir=info; test $$program != info || program=g$$program;; \ |
| *install-info) dir=install-info; program=g$$program;; \ |
| *texindex) dir=texindex; exe_ext="";; \ |
| *) dir=util;; esac \ |
| && dir="$(top_builddir)/$(native_tools)/$$dir" \ |
| && h2m="$(srcdir)/$$program.h2m" |
| |
| # Update the man page for a binary program; set up the variables, |
| # make sure the binary is up-to-date and then generate the man page. |
| man_rule_bin = echo "Updating man page $@" \ |
| && $(man_rule_0) \ |
| && echo cd "$$dir" '&&' $(MAKE) $(AM_MAKEFLAGS) $$program$$exe_ext \ |
| && (cd "$$dir" && $(MAKE) $(AM_MAKEFLAGS) $$program$$exe_ext) \ |
| && echo $(HELP2MAN) --name=\""$$name"\" -I "$$h2m" "$$dir/$$program" -o '$@'\ |
| && $(HELP2MAN) --name="$$name" -I "$$h2m" "$$dir/$$program" -o '$@' |
| |
| |
| # Using help2man depends on the package version number. |
| common_mandeps = $(top_srcdir)/configure.ac |
| |
| # for Info, we have an additional help2man file since the standard |
| # SEE ALSO text from help2man does not fit. |
| $(srcdir)/info.1: $(top_srcdir)/info/info.c $(srcdir)/ginfo.h2m \ |
| $(common_mandeps) |
| @name="read Info documents" && $(man_rule_bin) |
| |
| $(srcdir)/install-info.1: $(top_srcdir)/install-info/install-info.c \ |
| $(common_mandeps) |
| @name="update info/dir entries" && $(man_rule_bin) |
| |
| # Here we need some postprocessing to avoid man misformatting. |
| $(srcdir)/makeinfo.1: $(t2a_srcdir)/perl/texi2any.pl $(common_mandeps) |
| @name="translate Texinfo documents" && $(man_rule_bin) |
| mv $@ $@.tmp |
| sed '/^\.IP$$/N;/\nAlso/s/I//;/\nThe/s/I//' $@.tmp >$@ |
| rm $@.tmp |
| |
| $(srcdir)/texindex.1: $(top_srcdir)/texindex/ti.twjr $(common_mandeps) |
| @name="sort Texinfo index files" \ |
| && TEXINDEX_SCRIPT=$(top_srcdir)/texindex/texindex.awk \ |
| && export TEXINDEX_SCRIPT \ |
| && $(man_rule_bin) |
| |
| # |
| # For texi2dvi, do not depend on the current user's settings. |
| texi2dvi_envvars = unset TEXI2DVI_BUILD_MODE; unset TEXI2DVI_BUILD_DIRECTORY |
| |
| $(srcdir)/texi2dvi.1: $(top_srcdir)/util/texi2dvi $(common_mandeps) |
| $(texi2dvi_envvars); $(HELP2MAN) \ |
| --name="convert Texinfo documents to DVI or PDF" \ |
| $(top_srcdir)/util/texi2dvi >$@ |