[PATCH v2] build: Build synopsis.c before main.c
How about this variation of your patch? It fixes the problem from a fresh git checkout for me. Rich.
From: Nir Soffer <nirsof@gmail.com> 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 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Makefile.am b/src/Makefile.am index 5c67bf8..6b9e0a9 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -77,10 +77,11 @@ nbdkit_LDFLAGS = \ -rdynamic # synopsis.c is generated from docs/synopsis.txt where it is also -# used to generate the man page. +# used to generate the man page. It is included in main.c. 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.18.0
On Sun, Aug 19, 2018 at 12:43 AM Richard W.M. Jones <rjones@redhat.com> wrote:
From: Nir Soffer <nirsof@gmail.com>
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 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/Makefile.am b/src/Makefile.am index 5c67bf8..6b9e0a9 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -77,10 +77,11 @@ nbdkit_LDFLAGS = \ -rdynamic
# synopsis.c is generated from docs/synopsis.txt where it is also -# used to generate the man page. +# used to generate the man page. It is included in main.c.
Looks good, but now we have 2 place to edit if we include this in another source. 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.18.0
On Sun, Aug 19, 2018 at 12:47:52AM +0300, Nir Soffer wrote:
On Sun, Aug 19, 2018 at 12:43 AM Richard W.M. Jones <rjones@redhat.com> wrote:
From: Nir Soffer <nirsof@gmail.com>
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 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/Makefile.am b/src/Makefile.am index 5c67bf8..6b9e0a9 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -77,10 +77,11 @@ nbdkit_LDFLAGS = \ -rdynamic
# synopsis.c is generated from docs/synopsis.txt where it is also -# used to generate the man page. +# used to generate the man page. It is included in main.c.
Looks good, but now we have 2 place to edit if we include this in another source.
I guess we'll worry about that if it happens. Thanks, I have pushed it. 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/
participants (2)
-
Nir Soffer -
Richard W.M. Jones