build: avoid parallel build failures
authorJim Meyering <meyering@redhat.com>
Wed, 11 Apr 2012 19:25:48 +0000 (21:25 +0200)
committerJim Meyering <meyering@redhat.com>
Thu, 12 Apr 2012 16:49:24 +0000 (18:49 +0200)
commit15d4a60bec70bee6c4ddd4020dc74e669f4d3174
tree2f19621affbd445733386b1119398993da75a3f0
parent47962000102e426ff0f77b34cc8eff98283411c4
build: avoid parallel build failures

A parallel build would fail when two concurrent sub-make processes
tried to build lib/Automake/Config.pm.  The loser would complain that
  grep: lib/Automake/Config.pm-t: No such file or directory
  chmod: cannot access `lib/Automake/Config.pm-t': No such file or\
    directory
  make[1]: *** [lib/Automake/Config.pm] Error 1
* Makefile.am (update_mans): Don't build lib/Automake/Config.pm here.
Instead, depend on it from the two rules that use it:
($(srcdir)/doc/aclocal-$(APIVERSION).1): Depend on it.
($(srcdir)/doc/automake-$(APIVERSION).1): Likewise.

[ Note that technically, the above is incorrect, since it makes those
  distributed doc/*.1 files depend on generated aclocal and automake.
  That problem is addressed by the following commit. ]

However, that was not enough, since even then, a parallel build
would still fail, now with this:

  help2man: can't get `--help' info from automake-1.11a
  Try `--no-discard-stderr' if option outputs to stderr
  make: *** [doc/automake-1.11a.1] Error 1

a subsequent "make -j3" would create the missing file.
That was because help2man would invoke t/wrap/aclocal.in and
t/wrap/automake.in, each of which would require aclocal and
automake, yet those two files weren't guaranteed to be created.
Add explicit dependencies:
($(srcdir)/doc/aclocal-$(APIVERSION).1): Depend on aclocal.
($(srcdir)/doc/automake-$(APIVERSION).1): Depend on automake.
Makefile.am