Nir Soffer
2018-Aug-18 21:17 UTC
[Libguestfs] [PATCH] build: Build synopsis.c before main.c
synopsis.c was defined as dependency of the nbdkit program, but it should be define as dependency of main.c. Otherwise "make" fail with: main.c:180:10: fatal error: synopsis.c: No such file or directory #include "synopsis.c" ^~~~~~~~~~~~ Fixes commit 445e18f3dbb2 (src, docs: Generate the nbdkit command synopsis from a single source). --- src/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Makefile.am b/src/Makefile.am index 5c67bf8..046bdc3 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -80,7 +80,7 @@ nbdkit_LDFLAGS = \ # used to generate the man page. EXTRA_DIST = synopsis.c -nbdkit_DEPENDENCIES = synopsis.c +main.c: synopsis.c synopsis.c: $(top_srcdir)/docs/synopsis.txt rm -f $@ $@-t $(SED) -e 's/\(.*\)/"\1\\n"/g' $< > $@-t -- 2.17.1
Richard W.M. Jones
2018-Aug-18 21:29 UTC
Re: [Libguestfs] [PATCH] build: Build synopsis.c before main.c
On Sun, Aug 19, 2018 at 12:17:17AM +0300, Nir Soffer wrote:> synopsis.c was defined as dependency of the nbdkit program, but it > should be define as dependency of main.c. Otherwise "make" fail with: > > main.c:180:10: fatal error: synopsis.c: No such file or directory > #include "synopsis.c" > ^~~~~~~~~~~~ > > Fixes commit 445e18f3dbb2 (src, docs: Generate the nbdkit command > synopsis from a single source). > --- > src/Makefile.am | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/Makefile.am b/src/Makefile.am > index 5c67bf8..046bdc3 100644 > --- a/src/Makefile.am > +++ b/src/Makefile.am > @@ -80,7 +80,7 @@ nbdkit_LDFLAGS = \ > # used to generate the man page. > > EXTRA_DIST = synopsis.c > -nbdkit_DEPENDENCIES = synopsis.c > +main.c: synopsis.c > synopsis.c: $(top_srcdir)/docs/synopsis.txt > rm -f $@ $@-t > $(SED) -e 's/\(.*\)/"\1\\n"/g' $< > $@-tInteresting - I don't have this build problem and nbdkit_DEPENDENCIES is supposed to enforce the ordering. (Of course automake is a mystery wrapped in an enigma, so who knows). Does this happen from a git checkout? Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-builder quickly builds VMs from scratch http://libguestfs.org/virt-builder.1.html
Richard W.M. Jones
2018-Aug-18 21:31 UTC
Re: [Libguestfs] [PATCH] build: Build synopsis.c before main.c
On Sun, Aug 19, 2018 at 12:17:17AM +0300, Nir Soffer wrote:> synopsis.c was defined as dependency of the nbdkit program, but it > should be define as dependency of main.c. Otherwise "make" fail with: > > main.c:180:10: fatal error: synopsis.c: No such file or directory > #include "synopsis.c" > ^~~~~~~~~~~~ > > Fixes commit 445e18f3dbb2 (src, docs: Generate the nbdkit command > synopsis from a single source). > --- > src/Makefile.am | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/Makefile.am b/src/Makefile.am > index 5c67bf8..046bdc3 100644 > --- a/src/Makefile.am > +++ b/src/Makefile.am > @@ -80,7 +80,7 @@ nbdkit_LDFLAGS = \ > # used to generate the man page. > > EXTRA_DIST = synopsis.c > -nbdkit_DEPENDENCIES = synopsis.c > +main.c: synopsis.c > synopsis.c: $(top_srcdir)/docs/synopsis.txt > rm -f $@ $@-t > $(SED) -e 's/\(.*\)/"\1\\n"/g' $< > $@-tOK I CAN reproduce this from a git checkout ... Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 100 libraries supported. http://fedoraproject.org/wiki/MinGW
Reasonably Related Threads
- Re: [PATCH v2] build: Build synopsis.c before main.c
- [PATCH v2] build: Build synopsis.c before main.c
- Re: [PATCH nbdkit 1/5] src: Mark synopsis.c as BUILT_SOURCES.
- [PATCH v2] build: Build synopsis.c before main.c
- [PATCH nbdkit 1/5] src: Mark synopsis.c as BUILT_SOURCES.