2004-07-17 Alexandre Duret-Lutz <adl@gnu.org>
+ * lib/am/texibuild.am (?GENERIC?%SOURCE_SUFFIX%.html,
+ ?!GENERIC?%DEST_PREFIX%.html): Output .htp, and then rename to .html
+ on success. In case the target is a directory, this ensures its
+ time stamp is updated and the no files are left over inside.
+ * tests/txinfo21.test: Augment to test missing timestamp update
+ reported by Akim Demaille.
+
* doc/automake.texi (Top level): Rename as ...
(Directories): ... this, and split into ...
(Subdirectories, Conditional Subdirectories): ... these.
+ (Subdirectories): Illustrate the use of `.'.
(Conditional Subdirectories): Describe SUBDIRS and DIST_SUBDIRS
before the example. Append a discussion about non-configured
conditional directories.
?GENERIC?%SOURCE_SUFFIX%.html:
?!GENERIC?%DEST_PREFIX%.html: %SOURCE% %DEPS% %DIRSTAMP%
- $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) %MAKEINFOFLAGS% \
-?GENERIC? -o $@ %SOURCE%
-?!GENERIC? -o $@ `test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE%
+## When --split (the default) is used, makeinfo will output a
+## directory. However it will not update the time stamp of a
+## previously existing directory, and when the names of the nodes
+## in the manual change, it may leave unused pages. Our fix
+## is to build under a temporary name, and replace the target on
+## success.
+ rm -rf ${@:.html=.htp}
+ if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) %MAKEINFOFLAGS% \
+?GENERIC? -o ${@:.html=.htp} %SOURCE%; \
+?!GENERIC? -o ${@:.html=.htp} `test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE%; \
+ then \
+ rm -rf $@; \
## Work around a bug in Texinfo 4.1 (-o foo.html outputs files in foo/
## instead of foo.html/).
- if test ! -d $@ && test -d $(@:.html=); then \
- mv $(@:.html=) $@; else :; fi
+ if test ! -d ${@:.html=.htp} && test -d $(@:.html=); then \
+ mv $(@:.html=) $@; else mv $(@:.html=.htp) $@; fi; \
+ else \
+ if test ! -d ${@:.html=.htp} && test -d $(@:.html=); then \
+ rm -rf $(@:.html=); else rm -Rf $(@:.html=.htp) $@; fi; \
+ exit 1; \
+ fi
## If we are using the generic rules, we need separate dependencies.
## (Don't wonder about %DIRSTAMP% here, this is used only by non-generic
#! /bin/sh
-# Copyright (C) 2003 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2004 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
$MAKE
+$sleep
# Test production of split-per-node HTML.
$MAKE html
test -d main.html
test -d sub/main.html
test -d rec/main.html
+
+# Rebuilding main.html should cause its timestamp to be updated.
+test `ls -1td main.texi main.html | sed 1q` = main.html
+$sleep
+touch main.texi
+$MAKE html
+test `ls -1td main.texi main.html | sed 1q` = main.html
+
$MAKE clean
test ! -d main.html
test ! -d sub/main.html