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:55:46 +0200
Newsgroups gmane.comp.lib.gnulib.bugs,gmane.comp.printing.groff.general
Message-ID <4483991.Sgy9Pd6rRy@cagnes>
G. Branden Robinson wrote:
> > So, maybe changes lines like this:
> > 
> > src/libs/libgroff/libgroff_a-relocate.$(OBJEXT): defs.h
> > 
> > to lines like this:
> > 
> > src/libs/libgroff/libgroff_a-relocate.$(OBJEXT): $(BUILT_SOURCES)
> > 
> > and add a similar rule for src/libs/libgroff/libgroff_a-font.$(OBJEXT).
> 
> Hmm!  Okay, I'll think about the implications here.

Another possibility is to add these lines to Makefile.am:

  # This is implicit in "make all", but is needed explicitly before other target
  # invocations.
  built-sources: $(BUILT_SOURCES)

Then people like Richard can run
  $ make built-sources specific-target
instead of
  $ make specific-target
and thus get a certain target built without the need to do "make all".

It is particularly useful for the 'make dist' target, which is required
to work _without_ preceding 'make all'. [1]

Bruno

[1] https://www.gnu.org/prep/standards/html_node/Standard-Targets.html