}
my $infobase = basename ($filename);
- $infobase =~ s/\.te?xi(nfo)?$//;
+ $infobase =~ s/\.texi$//;
- return ($outfile, $vfile,
- map { "$infobase.$_" } (sort keys %clean_suffixes));
+ return ($outfile, $vfile);
}
-
-# ($DIRSTAMP, @CLEAN_FILES)
-# output_texinfo_build_rules ($SOURCE, $DEST, $INSRC, @DEPENDENCIES)
-# ------------------------------------------------------------------
-# SOURCE - the source Texinfo file
-# DEST - the destination Info file
-# INSRC - whether DEST should be built in the source tree
-# DEPENDENCIES - known dependencies
-sub output_texinfo_build_rules ($$$@)
-{
- my ($source, $dest, $insrc, @deps) = @_;
-
- # Split 'a.texi' into 'a' and '.texi'.
- my ($spfx, $ssfx) = ($source =~ /^(.*?)(\.[^.]*)?$/);
- my ($dpfx, $dsfx) = ($dest =~ /^(.*?)(\.[^.]*)?$/);
-
- $ssfx ||= "";
- $dsfx ||= "";
-
- # We can output two kinds of rules: the "generic" rules use Make
- # suffix rules and are appropriate when $source and $dest do not lie
- # in a sub-directory; the "specific" rules are needed in the other
- # case.
- #
- # The former are output only once (this is not really apparent here,
- # but just remember that some logic deeper in Automake will not
- # output the same rule twice); while the later need to be output for
- # each Texinfo source.
- my $generic;
- my $makeinfoflags;
- my $sdir = dirname $source;
- if ($sdir eq '.' && dirname ($dest) eq '.')
- {
- $generic = 1;
- $makeinfoflags = '-I $(srcdir)';
- }
- else
- {
- $generic = 0;
- $makeinfoflags = "-I $sdir -I \$(srcdir)/$sdir";
- }
-
- # A directory can contain two kinds of info files: some built in the
- # source tree, and some built in the build tree. The rules are
- # different in each case. However we cannot output two different
- # set of generic rules. Because in-source builds are more usual, we
- # use generic rules in this case and fall back to "specific" rules
- # for build-dir builds. (It should not be a problem to invert this
- # if needed.)
- $generic = 0 unless $insrc;
-
- # We cannot use a suffix rule to build info files with an empty
- # extension. Otherwise we would output a single suffix inference
- # rule, with separate dependencies, as in
- #
- # .texi:
- # $(MAKEINFO) ...
- # foo.info: foo.texi
- #
- # which confuse Solaris make. (See the Autoconf manual for
- # details.) Therefore we use a specific rule in this case. This
- # applies to info files only (dvi and pdf files always have an
- # extension).
- my $generic_info = ($generic && $dsfx) ? 1 : 0;
-
- # If the resulting file lie into a subdirectory,
- # make sure this directory will exist.
- my $dirstamp = require_build_directory_maybe ($dest);
-
- my $dipfx = ($insrc ? '$(srcdir)/' : '') . $dpfx;
-
- $output_rules .= file_contents ('texibuild',
- new Automake::Location,
- AM_V_MAKEINFO => verbose_flag('MAKEINFO'),
- AM_V_TEXI2DVI => verbose_flag('TEXI2DVI'),
- AM_V_TEXI2PDF => verbose_flag('TEXI2PDF'),
- DEPS => "@deps",
- DEST_PREFIX => $dpfx,
- DEST_INFO_PREFIX => $dipfx,
- DEST_SUFFIX => $dsfx,
- DIRSTAMP => $dirstamp,
- GENERIC => $generic,
- GENERIC_INFO => $generic_info,
- INSRC => $insrc,
- MAKEINFOFLAGS => $makeinfoflags,
- SILENT => silent_flag(),
- SOURCE => ($generic
- ? '$<' : $source),
- SOURCE_INFO => ($generic_info
- ? '$<' : $source),
- SOURCE_REAL => $source,
- SOURCE_SUFFIX => $ssfx,
- TEXIQUIET => verbose_flag('texinfo'),
- TEXIDEVNULL => verbose_flag('texidevnull'),
- );
- return ($dirstamp, "$dpfx.dvi", "$dpfx.pdf", "$dpfx.ps", "$dpfx.html");
-}
-
-
# ($MOSTLYCLEAN, $TEXICLEAN, $MAINTCLEAN)
# handle_texinfo_helper ($info_texinfos)
# --------------------------------------
(@pxref{Java}) use @code{JAVACFLAGS} and @code{AM_JAVACFLAGS}. None
of these rules support per-target flags (yet).
- However you should not think that all variables ending with
- @code{FLAGS} follow this convention. For instance,
- @code{DISTCHECK_CONFIGURE_FLAGS} (@pxref{Checking the Distribution}) and
- @code{ACLOCAL_AMFLAGS} (see @ref{Rebuilding} and @ref{Local Macros}),
- are two variables that are only useful to the maintainer and have no
- user counterpart.
-To some extent, even @code{AM_MAKEFLAGS} (@pxref{Subdirectories})
-obeys this naming scheme. The slight difference is that
-@code{MAKEFLAGS} is passed to sub-@command{make}s implicitly by
-@command{make} itself.
-
+ However you should not think that all variables ending with @code{FLAGS}
+ follow this convention. For instance, @code{ACLOCAL_AMFLAGS} (see
+ @ref{Rebuilding} and @ref{Local Macros}) is a variable that is only
+ useful to the maintainer and has no user counterpart.
@code{ARFLAGS} (@pxref{A Library}) is usually defined by Automake and
has neither @code{AM_} nor per-target cousin.
## You should have received a copy of the GNU General Public License
## along with this program. If not, see <http://www.gnu.org/licenses/>.
+TEXI2DVI = texi2dvi
+TEXI2PDF = $(TEXI2DVI) --pdf --batch
+DVIPS = dvips
+MAKEINFOHTML = $(MAKEINFO) --html
+AM_MAKEINFOHTMLFLAGS ?= $(AM_MAKEINFOFLAGS)
-?GENERIC_INFO?%SOURCE_SUFFIX%%DEST_SUFFIX%:
-?!GENERIC_INFO?%DEST_INFO_PREFIX%%DEST_SUFFIX%: %SOURCE_INFO% %DEPS%
-## It is wrong to have 'info' files dependent on %DIRSTAMP%, because
-## 'info' files are distributed and %DIRSTAMP% isn't: a distributed file
-## should never be dependent upon a non-distributed built file.
-## Therefore we ensure that %DIRSTAMP% exists in the rule.
-?!INSRC??DIRSTAMP? @test -f %DIRSTAMP% || $(MAKE) $(AM_MAKEFLAGS) %DIRSTAMP%
+define am__texibuild_dvi_or_pdf
+ $1$(am__ensure_target_dir_exists) && \
+ TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
+## Must set MAKEINFO like this so that version.texi will be found even
+## if it is in srcdir.
+ MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) \
+ -I $(@D) -I $(srcdir)/$(@D)' \
- ## texi2dvi and texi2pdf don't silence everything with -q, redirect to
- ## /dev/null instead.
- ## We still want -q ($(AM_V_TEXI_QUIETOPTS)) because it turns on batch
- ## mode. Use '--clean' to avoid leaving auxiliary files behind cluttering
- ## the build directory (see automake bug#11146). We should start using
- ## '--tidy' when we can assume Texinf 4.9 or later.
- $2 $(AM_V_TEXI_QUIETOPTS) --clean -o $@ $< $(AM_V_TEXI_DEVNULL_REDIRECT)
++
++## texi2dvi and texi2pdf don't silence everything with -q, redirect
++## to /dev/null instead. We still want -q (%TEXIQUIET%) because it
++## turns on batch mode.
++## Use '--build-dir' so that TeX and Texinfo auxiliary files and build
++## by-products are left in there, instead of cluttering the current
++## directory (see automake bug#11146). Use a different build-dir for
++## each file (as well as distinct build-dirs for PDF and DVI files) to
++## avoid hitting a Texinfo bug that could cause a low-probability racy
++## failure when doing parallel builds; see:
++## http://lists.gnu.org/archive/html/automake-patches/2012-06/msg00073.html
++ $2 $(AM_V_TEXI_QUIETOPTS) --build-dir=$3 \
++ -o $@ $< $(AM_V_TEXI_DEVNULL_REDIRECT)
+endef
+
+define am__texibuild_info
+ $(if $1,,@$(am__ensure_target_dir_exists))
## Back up the info files before running makeinfo. This is the cheapest
## way to ensure that
## 1) If the texinfo file shrinks (or if you start using --no-split),
rm -rf $(@:.html=); else rm -Rf $(@:.html=.htp) $@; fi; \
exit 1; \
fi
- $(call am__texibuild_dvi_or_pdf,$(AM_V_TEXI2DVI),$(TEXI2DVI))
+endef
+
+%.info: %.texi
+ $(call am__texibuild_info,$(am__info_insrc))
+%.dvi: %.texi
- $(call am__texibuild_dvi_or_pdf,$(AM_V_TEXI2PDF),$(TEXI2PDF))
++ $(call am__texibuild_dvi_or_pdf,$(AM_V_TEXI2DVI),$(TEXI2DVI),$(@:.dvi=.t2d))
+%.pdf: %.texi
++ $(call am__texibuild_dvi_or_pdf,$(AM_V_TEXI2PDF),$(TEXI2PDF),$(@:.pdf=.t2p))
+%.html: %.texi
+ $(call am__texibuild_html)
-## If we are using the generic rules, we need separate dependencies.
-## (Don't wonder about %DIRSTAMP% here, this is used only by non-generic
-## rules.)
-if %?GENERIC_INFO%
-%DEST_INFO_PREFIX%%DEST_SUFFIX%: %SOURCE_REAL% %DEPS%
-endif %?GENERIC_INFO%
-if %?GENERIC%
-%DEST_PREFIX%.dvi: %SOURCE_REAL% %DEPS%
-%DEST_PREFIX%.pdf: %SOURCE_REAL% %DEPS%
-%DEST_PREFIX%.html: %SOURCE_REAL% %DEPS%
-endif %?GENERIC%
+## The way to make PostScript, for those who want it.
+%.ps: %.dvi
+ $(AM_V_DVIPS)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
+ $(DVIPS) $(AM_V_TEXI_QUIETOPTS) -o $@ $<
.PHONY maintainer-clean-am: maintainer-clean-aminfo
maintainer-clean-aminfo:
@list='$(INFO_DEPS)'; for i in $$list; do \
-## .iNN files are DJGPP-style info files.
- i_i=`echo "$$i" | sed 's|\.info$$||;s|$$|.i|'`; \
- echo " rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]"; \
- rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]; \
+ echo " rm -f $$i $$i-[0-9] $$i-[0-9][0-9]"; \
+ rm -f $$i $$i-[0-9] $$i-[0-9][0-9]; \
done
- ## Use '-rf', not just '-f', because the %*CLEAN% substitutions can also
- ## contain any directory created by "makeinfo --html".
+ ## Use '-rf', not just '-f'; see comments in 'mostlyclean-aminfo'
+ ## above for details.
?MAINTCLEAN? -test -z "%MAINTCLEAN%" \
?MAINTCLEAN? || rm -rf %MAINTCLEAN%
sc_perl_at_uscore_in_scalar_context \
sc_perl_local \
sc_AMDEP_TRUE_in_automake_in \
-sc_tests_make_without_am_makeflags \
+sc_tests_no_gmake_requirement \
+sc_tests_no_gmake_checking \
+sc_tests_make_can_chain_suffix_rules \
+sc_tests_make_dont_do_useless_vpath_rebuilds \
+sc_no_dotmake_target \
+sc_no_am_makeflags \
+ $(sc_obsolete_requirements_rules) \
+$(sc_renamed_variables_rules) \
+sc_no_RECHECK_LOGS \
+sc_tests_no_make_e \
+sc_docs_no_make_e \
+sc_make_simple_include \
+sc_tests_make_simple_include \
sc_tests_obsolete_variables \
sc_tests_here_document_format \
sc_tests_Exit_not_exit \
--- /dev/null
- required='makeinfo-html tex texi2dvi-o dvips'
+#!/bin/sh
+# Copyright (C) 2009-2012 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Check texinfo rules in silent-rules mode.
+
++required='makeinfo tex texi2dvi dvips'
+. ./defs || Exit 1
+
+echo AC_OUTPUT >> configure.ac
+
+cat > Makefile.am <<'EOF'
+info_TEXINFOS = foo.texi sub/zardoz.texi
+EOF
+
+cat > foo.texi <<'EOF'
+\input texinfo
+@setfilename foo.info
+@settitle foo manual
+@bye
+EOF
+
+mkdir sub
+cat > sub/zardoz.texi <<'EOF'
+\input texinfo
+@setfilename zardoz.info
+@settitle zardoz manual
+@bye
+EOF
+
+$ACLOCAL
+$AUTOMAKE --add-missing
+$AUTOCONF
+
+./configure --disable-silent-rules
+
+# Silent mode output.
+st=0
+$MAKE V=0 dvi html info ps pdf >stdout 2>stderr || st=$?
+cat stdout
+cat stderr >&2
+test $st -eq 0
+grep '^ DVIPS foo\.ps$' stdout
+grep '^ MAKEINFO foo\.html$' stdout
+grep '^ MAKEINFO foo\.info$' stdout
+grep '^ TEXI2DVI foo\.dvi$' stdout
+grep '^ TEXI2PDF foo\.pdf$' stdout
+grep '^ DVIPS sub/zardoz.ps$' stdout
+grep '^ MAKEINFO sub/zardoz.html$' stdout
+grep '^ MAKEINFO sub/zardoz.info$' stdout
+grep '^ TEXI2DVI sub/zardoz.dvi$' stdout
+grep '^ TEXI2PDF sub/zardoz.pdf$' stdout
+# No make recipe is displayed before being executed.
+$EGREP 'texi2(dvi|pdf)|dvips|makeinfo|(rm|mv) ' \
+ stdout stderr && Exit 1
+# No verbose output from TeX nor dvips.
+$EGREP '(zardoz|foo)\.log|3\.14|Copyright|This is|[Oo]utput ' \
+ stdout stderr && Exit 1
+
+# Verbose mode output.
+$MAKE clean || Exit 1
+$MAKE V=1 dvi html info ps pdf >output 2>&1 || { cat output; Exit 1; }
+cat output
+$EGREP '(DVIPS|MAKEINFO|TEXI2(PDF|DVI)) ' output && Exit 1
+# Verbose output from TeX.
+grep '[Oo]utput .*foo\.pdf' output
+grep '[Oo]utput .*zardoz\.pdf' output
+$FGREP 'foo.log' output
+$FGREP 'zardoz.log' output
+# Verbose output from dvips.
+$FGREP ' dvips' output
+
+:
--- /dev/null
- # FIXME: convert this test and the sister test 'txinfo21b.sh' to
+#! /bin/sh
+# Copyright (C) 2003-2012 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Test support for building HTML documentation, and the many
+# install-DOC flavors, in VPATH builds.
+# Keep in sync with sister test 'txinfo21.sh'.
+# FIXME: in the long term, the best thing to do is probably to
- required='makeinfo-html tex texi2dvi'
++# FIXME: convert this test and the sister test 'txinfo21.sh' to
+# FIXME: TAP, and merge them.
+
++required='makeinfo tex texi2dvi'
+. ./defs || Exit 1
+
+cat >>configure.ac <<\EOF
+AC_CONFIG_FILES([rec/Makefile])
+
+# At the time of writing, Autoconf does not supplies any of these
+# definitions (and those below are purposely not those of the standard).
+AC_SUBST([dvidir], ['${datadir}/${PACKAGE}/dvi'])
+AC_SUBST([htmldir], ['${datadir}/${PACKAGE}/html'])
+AC_SUBST([pdfdir], ['${datadir}/${PACKAGE}/pdf'])
+AC_SUBST([psdir], ['${datadir}/${PACKAGE}/ps'])
+
+AC_OUTPUT
+EOF
+
+cat > Makefile.am << 'END'
+SUBDIRS = rec
+info_TEXINFOS = main.texi sub/main2.texi
+END
+
+cat > main.texi << 'END'
+\input texinfo
+@setfilename main.info
+@settitle main
+@node Top
+Hello walls.
+@bye
+END
+
+mkdir sub
+cat > sub/main2.texi << 'END'
+\input texinfo
+@setfilename main2.info
+@settitle main2
+@node Top
+Hello walls.
+@bye
+END
+
+mkdir rec
+cat > rec/main3.texi << 'END'
+\input texinfo
+@setfilename main3.info
+@settitle main3
+@node Top
+Hello walls.
+@bye
+END
+
+cat > rec/Makefile.am << 'END'
+info_TEXINFOS = main3.texi
+
+install-pdf-local:
+ @$(MKDIR_P) "$(pdfdir)"
+ :> "$(pdfdir)/hello"
+uninstall-local:
+ rm -f "$(pdfdir)/hello"
+END
+
+$ACLOCAL
+$AUTOMAKE --add-missing
+$AUTOCONF
+
+mkdir build
+cd build
+../configure
+
+$MAKE
+
+$sleep
+# Test production of split-per-node HTML.
+$MAKE html
+test -d main.html
+test -d sub/main2.html
+test -d rec/main3.html
+
+# Rebuilding main.html should cause its timestamp to be updated.
+is_newest main.html ../main.texi
+$sleep
+touch ../main.texi
+$MAKE html
+is_newest main.html ../main.texi
+
+$MAKE clean
+test ! -d main.html
+test ! -d sub/main2.html
+test ! -d rec/main3.html
+
+# Test production of a single HTML file.
+$MAKE MAKEINFOFLAGS=--no-split html
+test -f main.html
+test -f sub/main2.html
+test -f rec/main3.html
+$MAKE clean
+test ! -f main.html
+test ! -f sub/main2.html
+test ! -f rec/main3.html
+
+# Make sure AM_MAKEINFOHTMLFLAGS is supported, and override AM_MAKEINFO.
+cat >> ../Makefile.am <<\EOF
+AM_MAKEINFOHTMLFLAGS = --no-headers --no-split
+AM_MAKEINFOFLAGS = --unsupported-option
+EOF
+../configure --prefix "`pwd`"
+$MAKE html
+test -f main.html
+test -f sub/main2.html
+test -d rec/main3.html
+$MAKE clean
+test ! -f main.html
+test ! -f sub/main2.html
+test ! -d rec/main3.html
+
+$MAKE install-html
+test -f share/$me/html/main.html
+test -f share/$me/html/main2.html
+test -d share/$me/html/main3.html
+$MAKE uninstall
+test ! -f share/$me/html/main.html
+test ! -f share/$me/html/main2.html
+test ! -d share/$me/html/main3.html
+
+$MAKE install-dvi
+test -f share/$me/dvi/main.dvi
+test -f share/$me/dvi/main2.dvi
+test -f share/$me/dvi/main3.dvi
+$MAKE uninstall
+test ! -f share/$me/dvi/main.dvi
+test ! -f share/$me/dvi/main2.dvi
+test ! -f share/$me/dvi/main3.dvi
+
+dvips --help || skip_ "dvips is missing"
+
+$MAKE install-ps
+test -f share/$me/ps/main.ps
+test -f share/$me/ps/main2.ps
+test -f share/$me/ps/main3.ps
+$MAKE uninstall
+test ! -f share/$me/ps/main.ps
+test ! -f share/$me/ps/main2.ps
+test ! -f share/$me/ps/main3.ps
+
+pdfetex --help || pdftex --help \
+ || skip_ "pdftex and pdfetex are both missing"
+
+$MAKE install-pdf
+test -f share/$me/pdf/main.pdf
+test -f share/$me/pdf/main2.pdf
+test -f share/$me/pdf/main3.pdf
+test -f share/$me/pdf/hello
+$MAKE uninstall
+test ! -f share/$me/pdf/main.pdf
+test ! -f share/$me/pdf/main2.pdf
+test ! -f share/$me/pdf/main3.pdf
+test ! -f share/$me/pdf/hello
+
+: