+2002-08-25 Alexandre Duret-Lutz <duret_g@epita.fr>
+
+ For PR automake/343:
+ * automake.in (scan_texinfo_file) <clean_suffixes>: Remove dvi, ps,
+ and pdf.
+ (output_texinfo_build_rules): Define %DIRSTAMP% when processing
+ texibuild.am. Return $dirstamp and a list of files to clean.
+ (handle_texinfo_helper): Process texi-vers.am after the call to
+ output_texinfo_build_rules and use $dirstamp to define %DIRSTAMP%.
+ * lib/am/texi-vers.am (%STAMPVTI%): Build %DIRSTAMP% if needed.
+ * lib/am/texibuild.am (%DEST_PREFIX%%DEST_SUFFIX%): Likewise.
+ (%DEST_PREFIX%.dvi, %DEST_PREFIX%.pdf): Depend on %DIRSTAMP%.
+ * tests/texinfo13.test: New file.
+ * tests/Makefile.am (TESTS): Add texinfo13.test.
+ * lib/am/texinfos.am (install-info-am, dist-info): Looks for
+ info files in build or source directory.
+ This completes the change from 2002-07-30 (for PR automake/168).
+
2002-08-24 Alexandre Duret-Lutz <duret_g@epita.fr>
* automake.in (CLEAN, MAINTAINER_CLEAN): New constants.
echo " rm -f $(DESTDIR)$(bindir)/$$f"; \
rm -f $(DESTDIR)$(bindir)/$$f; \
done
+
+.texi.info:
+ @rm -f $@ $@-[0-9] $@-[0-9][0-9]
+ $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \
+ `test -f '$<' || echo '$(srcdir)/'`$< -o $@
+
+.texi.dvi:
+ TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
+ MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \
+ $(TEXI2DVI) `test -f '$<' || echo '$(srcdir)/'`$< -o $@
+
+.texi.pdf:
+ TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
+ MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \
+ $(TEXI2PDF) `test -f '$<' || echo '$(srcdir)/'`$< -o $@
+automake.info: version.texi
+automake.dvi: version.texi
+automake.pdf: version.texi
version.texi: stamp-vti
stamp-vti: automake.texi $(top_srcdir)/configure.in
@(dir=.; test -f ./automake.texi || dir=$(srcdir); \
maintainer-clean-vti:
-rm -f stamp-vti version.texi
-
-.texi.info:
- @rm -f $@ $@-[0-9] $@-[0-9][0-9]
- $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \
- `test -f '$<' || echo '$(srcdir)/'`$< -o $@
-
-.texi.dvi:
- TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
- MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \
- $(TEXI2DVI) `test -f '$<' || echo '$(srcdir)/'`$< -o $@
-
-.texi.pdf:
- TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
- MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \
- $(TEXI2PDF) `test -f '$<' || echo '$(srcdir)/'`$< -o $@
-automake.info: version.texi
-automake.dvi: version.texi
-automake.pdf: version.texi
TEXI2DVI = texi2dvi
TEXI2PDF = $(TEXI2DVI) --pdf
dist-info: $(INFO_DEPS)
list='$(INFO_DEPS)'; \
for base in $$list; do \
- d=$(srcdir); \
+ if test -f $$base; then d=.; else d=$(srcdir); fi; \
for file in $$d/$$base*; do \
relfile=`expr "$$file" : "$$d/\(.*\)"`; \
test -f $(distdir)/$$relfile || \
mostlyclean-aminfo:
-rm -f automake.aux automake.cm automake.cp automake.cps automake.cv \
- automake.dvi automake.fn automake.ky automake.log automake.op \
- automake.ov automake.pdf automake.pg automake.ps automake.tmp \
- automake.toc automake.tp automake.tr automake.vr automake.vrs
+ automake.fn automake.ky automake.log automake.op automake.ov \
+ automake.pg automake.tmp automake.toc automake.tp automake.tr \
+ automake.vr automake.vrs automake.dvi automake.pdf \
+ automake.ps
maintainer-clean-aminfo:
- cd $(srcdir) && \
list='$(INFO_DEPS)'; for i in $$list; do \
rm -f $$i; \
if test "`echo $$i-[0-9]*`" != "$$i-[0-9]*"; then \
$(mkinstalldirs) $(DESTDIR)$(infodir)
@list='$(INFO_DEPS)'; \
for file in $$list; do \
- d=$(srcdir); \
+ if test -f $$file; then d=.; else d=$(srcdir); fi; \
for ifile in echo $$d/$$file $$d/$$file-[0-9] $$d/$$file-[0-9][0-9]; do \
if test -f $$ifile; then \
relfile=`expr "$$ifile" : "$$d/\(.*\)"`; \
when `make installcheck' is run. This is enabled by --gnits.
* Texinfo rules now support the `ps' and `pdf' targets.
* Info files are now created in the build directory, not the source directory.
+* info_TEXINFOS supports files in subdirectories.
* `make distcheck' will enforce DESTDIR support by attempting
a DESTDIR install.
* `+=' can be used in conditionals, even if the augmented variable
# These are always created, no matter whether indexes are used or not.
# (Actually tmp is only created if an @macro is used and a certain e-TeX
# feature is not available.)
- my @clean_suffixes = qw(aux dvi log pdf ps toc tmp
+ my @clean_suffixes = qw(aux log toc tmp
cp fn ky vr tp pg); # grep new.*index texinfo.tex
# There are predefined indexes which don't follow the regular rules.
return ($outfile, $vfile, (sort keys %clean_files));
}
+# ($DIRSTAMP, @CLEAN_FILES)
# output_texinfo_build_rules ($SOURCE, $DEST, @DEPENDENCIES)
# ----------------------------------------------------------
# SOURCE - the source Texinfo file
# make sure this directory will exist.
my $dirstamp = require_build_directory_maybe ($dest);
- # It is wrong to make $SOURCE dependent on $DIRSTAMP, because
- # $SOURCE is distributed and $DIRSTAMP is not. A generated file
- # should never be dependent upon a non-distributed built file.
- #
- # So don't do that:
- #
- # push @deps, $dirstamp;
- #
- # Instead we append all dirstamps to the $(am__texinfo_dirstamps)
- # variable and have this variable in the dependencies of
- # info, dvi, etc. (FIXME: this is not done yet -- support for
- # Texinfo files in subdirectories is not complete.)
- macro_define ('am__texinfo_dirstamps', VAR_AUTOMAKE, '+', 'TRUE',
- $dirstamp, 'internal');
-
$output_rules .= &file_contents ('texibuild',
GENERIC => $generic,
SOURCE_SUFFIX => $ssfx,
DEST_PREFIX => $dpfx,
DEST_SUFFIX => $dsfx,
MAKEINFOFLAGS => $makeinfoflags,
- DEPS => "@deps");
+ DEPS => "@deps",
+ DIRSTAMP => $dirstamp);
+ return ($dirstamp, "$dpfx.dvi", "$dpfx.pdf", "$dpfx.ps");
}
$outdir = "" if $outdir eq './';
$out_file = $outdir . $out_file;
+ # If user specified file_TEXINFOS, then use that as explicit
+ # dependency list.
+ @texi_deps = ();
+ push (@texi_deps, "$outdir$vtexi") if $vtexi;
+
+ my $canonical = &canonicalize ($infobase);
+ if (variable_defined ($canonical . "_TEXINFOS"))
+ {
+ push (@texi_deps, '$(' . $canonical . '_TEXINFOS)');
+ &push_dist_common ('$(' . $canonical . '_TEXINFOS)');
+ }
+
+ my ($dirstamp, @cfiles) =
+ output_texinfo_build_rules ($info_cursor, $out_file, @texi_deps);
+ push (@texi_cleans, @cfiles);
+
+ push (@info_deps_list, $out_file);
+ push (@dvis_list, $infobase . '.dvi');
+ push (@pdfs_list, $infobase . '.pdf');
+ push (@pss_list, $infobase . '.ps');
+
+ # If a vers*.texi file is needed, emit the rule.
if ($vtexi)
{
err_am ("`$vtexi', included in `$info_cursor', "
{
$conf_dir = '$(srcdir)/';
}
- $output_rules .= &file_contents ('texi-vers',
+ $output_rules .= &file_contents ('texi-vers',
TEXI => $info_cursor,
VTI => $vti,
STAMPVTI => "${outdir}stamp-$vti",
VTEXI => "$outdir$vtexi",
- MDDIR => $conf_dir);
- }
-
- # If user specified file_TEXINFOS, then use that as explicit
- # dependency list.
- @texi_deps = ();
- push (@texi_deps, "$outdir$vtexi") if $vtexi;
-
- my $canonical = &canonicalize ($infobase);
- if (variable_defined ($canonical . "_TEXINFOS"))
- {
- push (@texi_deps, '$(' . $canonical . '_TEXINFOS)');
- &push_dist_common ('$(' . $canonical . '_TEXINFOS)');
+ MDDIR => $conf_dir,
+ DIRSTAMP => $dirstamp);
}
-
- output_texinfo_build_rules ($info_cursor, $out_file,
- @texi_deps);
-
- push (@info_deps_list, $out_file);
- push (@dvis_list, $infobase . '.dvi');
- push (@pdfs_list, $infobase . '.pdf');
- push (@pss_list, $infobase . '.ps');
}
# Handle location of texinfo.tex.
## Depend on %CONFIGURE-AC% so that version number updates cause a
## rebuild.
%STAMPVTI%: %TEXI% $(top_srcdir)/%CONFIGURE-AC%
+## It is wrong to have %STAMPTVTI% dependent on %DIRSTAMP%, because
+## %STAMPVTI% is 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.
+?DIRSTAMP? test -f %DIRSTAMP% || $(MAKE) %DIRSTAMP%
@(dir=.; test -f ./%TEXI% || dir=$(srcdir); \
set `$(SHELL) %MDDIR%mdate-sh $$dir/%TEXI%`; \
echo "@set UPDATED $$1 $$2 $$3"; \
## using --no-split), you'll be left with some dead info files lying
## around -- dead files which will end up in the distribution.
@rm -f $@ $@-[0-9] $@-[0-9][0-9]
+## 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.
+?DIRSTAMP? @test -f %DIRSTAMP% || $(MAKE) %DIRSTAMP%
$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) %MAKEINFOFLAGS% \
`test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE% -o $@
?GENERIC?%SOURCE_SUFFIX%.dvi:
-?!GENERIC?%DEST_PREFIX%.dvi: %SOURCE% %DEPS%
+?!GENERIC?%DEST_PREFIX%.dvi: %SOURCE% %DEPS% %DIRSTAMP%
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 (-I $(srcdir) is set in %MAKEINFOFLAGS%).
$(TEXI2DVI) `test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE% -o $@
?GENERIC?%SOURCE_SUFFIX%.pdf:
-?!GENERIC?%DEST_PREFIX%.pdf: %SOURCE% %DEPS%
+?!GENERIC?%DEST_PREFIX%.pdf: %SOURCE% %DEPS% %DIRSTAMP%
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 (-I $(srcdir) is set in %MAKEINFOFLAGS%).
$(TEXI2PDF) `test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE% -o $@
## 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%
%DEST_PREFIX%%DEST_SUFFIX%: %DEPS%
%DEST_PREFIX%.dvi: %DEPS%
$(mkinstalldirs) $(DESTDIR)$(infodir)
@list='$(INFO_DEPS)'; \
for file in $$list; do \
-?CYGNUS? if test -f $$file; then d=.; else d=$(srcdir); fi; \
-?!CYGNUS? d=$(srcdir); \
+ if test -f $$file; then d=.; else d=$(srcdir); fi; \
for ifile in echo $$d/$$file $$d/$$file-[0-9] $$d/$$file-[0-9][0-9]; do \
if test -f $$ifile; then \
## Strip leading '$$d/'.
dist-info: $(INFO_DEPS)
list='$(INFO_DEPS)'; \
for base in $$list; do \
-## In Cygnus mode, allow info file to be in source or build dir. In
-## other modes, allow only source dir.
-?!CYGNUS? d=$(srcdir); \
-?CYGNUS? if test -f $$base; then d=.; else d=$(srcdir); fi; \
+ if test -f $$base; then d=.; else d=$(srcdir); fi; \
for file in $$d/$$base*; do \
## Strip leading '$$d/'.
relfile=`expr "$$file" : "$$d/\(.*\)"`; \
maintainer-clean-am: maintainer-clean-aminfo
maintainer-clean-aminfo:
## Eww. But how else can we find all the output files from makeinfo?
-?!CYGNUS? cd $(srcdir) && \
list='$(INFO_DEPS)'; for i in $$list; do \
rm -f $$i; \
if test "`echo $$i-[0-9]*`" != "$$i-[0-9]*"; then \
texinfo8.test \
texinfo9.test \
texinfo10.test \
+texinfo13.test \
texinfo16.test \
transform.test \
unused.test \
texinfo8.test \
texinfo9.test \
texinfo10.test \
+texinfo13.test \
texinfo16.test \
transform.test \
unused.test \
--- /dev/null
+#! /bin/sh
+
+# Check for subdir Texinfo.
+# PR/343
+
+required='GNUmake makeinfo'
+. $srcdir/defs || exit 1
+
+set -e
+
+echo AC_OUTPUT >> configure.in
+
+cat > Makefile.am << 'END'
+info_TEXINFOS = subdir/main.texi
+subdir_main_TEXINFOS = subdir/inc.texi
+END
+
+mkdir subdir
+
+cat > subdir/main.texi << 'END'
+\input texinfo
+@setfilename main.info
+@settitle main
+@node Top
+Hello walls.
+@include version.texi
+@include inc.texi
+@bye
+END
+
+cat > subdir/inc.texi << 'END'
+I'm included.
+END
+
+
+$ACLOCAL
+$AUTOMAKE --add-missing
+$AUTOCONF
+
+mkdir build
+cd build
+../configure
+$MAKE distcheck
+test -f subdir/main.info