Re: how to manage make(1) dependencies on gnulib-generated header files

Bruno Haible via Gnulib discussion list <[email protected]> Wed, 29 Jul 2026 00:07:12 +0200
Newsgroups gmane.comp.lib.gnulib.bugs,gmane.comp.printing.groff.general
Message-ID <11141360.VV5PYv0bhD@cagnes>
Paul Eggert wrote:
> The basic problem here, by the way, is that Automake automatically makes overall targets like 'all' depend on $(BUILT_SOURCES), but does not do the same for subsidiary targets like doc/groff-man-pages.pdf. If you don't want to mess with dependencies (quite understandable), your best answer might be "Don't do that." I.e., don't try to build individual targets until after you've done a plain "make".

Yes, exactly. Quoting the Automake documentation [1]:
  "To emphasize, BUILT_SOURCES is honored only by ‘make all’, ‘make check’,
   ‘make install’, and make install-exec (and ‘make dist’). This means you
   cannot build an arbitrary target (e.g., ‘make foo’) in a clean tree if
   it depends on a built source. However it will succeed if you have run
   ‘make all’ earlier, because accurate dependencies are already available."

[1] https://www.gnu.org/software/automake/manual/html_node/Sources.html