[Libguestfs] [PATCH nbdkit 1/5] src: Mark synopsis.c as BUILT_SOURCES.

Richard W.M. Jones rjones at redhat.com
Fri Dec 7 14:22:38 UTC 2018


On Fri, Dec 07, 2018 at 07:25:07AM -0600, Eric Blake wrote:
> On 12/6/18 3:50 PM, Richard W.M. Jones wrote:
> >---
> >  src/Makefile.am | 1 +
> >  1 file changed, 1 insertion(+)
> >
> >diff --git a/src/Makefile.am b/src/Makefile.am
> >index 3490c0f..65f9498 100644
> >--- a/src/Makefile.am
> >+++ b/src/Makefile.am
> >@@ -80,6 +80,7 @@ nbdkit_LDFLAGS = \
> >  # synopsis.c is generated from docs/synopsis.txt where it is also
> >  # used to generate the man page.  It is included in main.c.
> >+BUILT_SOURCES = synopsis.c
> >  EXTRA_DIST = synopsis.c
> >  nbdkit_DEPENDENCIES = synopsis.c
> >  CLEANFILES += synopsis.c
> 
> Did this make an actual difference during parallel 'make', given
> that you already have nbdkit_DEPENDENCIES to trigger normal make
> prerequisites? Automake's implementation of BUILT_SOURCES states
> that they will be rebuilt even when Makefile itself is out of date
> (because configure.ac or Makefile.am was touched, for example),
> which is really early in the process (and annoying when trying to
> use tab completion to learn what targets make supports, since
> BUILT_SOURCES are built prior to computing what output to present).
> But while it might be annoying, I'm not opposed to the patch,
> especially if you did hit a situation in this series where it
> mattered.

So I didn't hit any particular problem.

However if my reading of this part of the automake documentation is
right then it is necessary (because we #include "synopsis.c"):

  Moreover, all built sources do not necessarily have to be
  listed in ‘BUILT_SOURCES’.  For instance, a generated ‘.c’ file doesn’t
  need to appear in ‘BUILT_SOURCES’ (unless it is included by another
  source), because it’s a known dependency of the associated object.

However it's unclear if this is superceded by having the file listed
in *_DEPENDENCIES as you say above.

There's a later patch where I use BUILT_SOURCES for protostrings.c,
where according to that documentation it is _not_ necessary, but seems
like it does no harm either.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine.  Supports Linux and Windows.
http://people.redhat.com/~rjones/virt-df/




More information about the Libguestfs mailing list