Richard W.M. Jones
2019-Aug-15 12:50 UTC
[Libguestfs] [PATCH libnbd] docs: Change docs/Makefile.inc back to a regular include, readd to git.
‘make clean && make’ was not rebuilding the docs/*.3 files. The reason is obscure: - docs/Makefile has rules: MANS = $(man_MANS) all: all-am all-am: Makefile $(MANS) - sinclude docs/Makefile.inc happened long after MANS is defined, so MANS held the earlier version of $(man_MANS) without the api-built man pages listed. This was confirmed by looking at the output of ‘make -d -C docs all-am’ and examining what happens when rebuilding all-am. The fix is to change docs/Makefile.inc back to a regular include, which also means we have to readd this generated file to git to allow cold clones to work. Partly reverts commit 15ca7acd6f46188d6f713af8785e35336b0b71f7. --- .gitignore | 1 - docs/Makefile.am | 8 +--- docs/Makefile.inc | 98 +++++++++++++++++++++++++++++++++++++++++++++ generator/generator | 2 +- 4 files changed, 100 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index ccbbc14..4109865 100644 --- a/.gitignore +++ b/.gitignore @@ -39,7 +39,6 @@ Makefile.in /depcomp /docs/*.3 /docs/*.pod -/docs/Makefile.inc !/docs/libnbd.pod !/docs/nbd_close.3 !/docs/nbd_create.pod diff --git a/docs/Makefile.am b/docs/Makefile.am index 30a972d..9a3f47b 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -16,13 +16,7 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA include $(top_srcdir)/subdir-rules.mk - -api_built- -# Our use of sinclude to bypass Automake is intentional; this file won't -# exist in a fresh git checkout until after the generator has run, but -# should already be present in any released tarball. -sinclude $(srcdir)/Makefile.inc +include $(srcdir)/Makefile.inc generator_built = \ Makefile.inc \ diff --git a/docs/Makefile.inc b/docs/Makefile.inc new file mode 100644 index 0000000..cd620b9 --- /dev/null +++ b/docs/Makefile.inc @@ -0,0 +1,98 @@ +# NBD client library in userspace +# WARNING: THIS FILE IS GENERATED FROM +# generator/generator +# ANY CHANGES YOU MAKE TO THIS FILE WILL BE LOST. +# +# Copyright (C) 2013-2019 Red Hat Inc. +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +api_built = \ + nbd_set_debug \ + nbd_get_debug \ + nbd_set_debug_callback \ + nbd_clear_debug_callback \ + nbd_set_handle_name \ + nbd_get_handle_name \ + nbd_set_export_name \ + nbd_get_export_name \ + nbd_set_tls \ + nbd_get_tls \ + nbd_set_tls_certificates \ + nbd_set_tls_verify_peer \ + nbd_get_tls_verify_peer \ + nbd_set_tls_username \ + nbd_get_tls_username \ + nbd_set_tls_psk_file \ + nbd_add_meta_context \ + nbd_connect_uri \ + nbd_connect_unix \ + nbd_connect_tcp \ + nbd_connect_command \ + nbd_is_read_only \ + nbd_can_flush \ + nbd_can_fua \ + nbd_is_rotational \ + nbd_can_trim \ + nbd_can_zero \ + nbd_can_df \ + nbd_can_multi_conn \ + nbd_can_cache \ + nbd_can_meta_context \ + nbd_get_size \ + nbd_pread \ + nbd_pread_structured \ + nbd_pwrite \ + nbd_shutdown \ + nbd_flush \ + nbd_trim \ + nbd_cache \ + nbd_zero \ + nbd_block_status \ + nbd_poll \ + nbd_aio_connect \ + nbd_aio_connect_uri \ + nbd_aio_connect_unix \ + nbd_aio_connect_tcp \ + nbd_aio_connect_command \ + nbd_aio_pread \ + nbd_aio_pread_structured \ + nbd_aio_pwrite \ + nbd_aio_disconnect \ + nbd_aio_flush \ + nbd_aio_trim \ + nbd_aio_cache \ + nbd_aio_zero \ + nbd_aio_block_status \ + nbd_aio_get_fd \ + nbd_aio_get_direction \ + nbd_aio_notify_read \ + nbd_aio_notify_write \ + nbd_aio_is_created \ + nbd_aio_is_connecting \ + nbd_aio_is_ready \ + nbd_aio_is_processing \ + nbd_aio_is_dead \ + nbd_aio_is_closed \ + nbd_aio_command_completed \ + nbd_aio_peek_command_completed \ + nbd_aio_in_flight \ + nbd_connection_state \ + nbd_get_package_name \ + nbd_get_version \ + nbd_kill_subprocess \ + nbd_supports_tls \ + nbd_supports_uri \ + $(NULL) diff --git a/generator/generator b/generator/generator index 6cc06cc..437f432 100755 --- a/generator/generator +++ b/generator/generator @@ -3766,7 +3766,7 @@ let generate_lib_api_c () let generate_docs_Makefile_inc () generate_header HashStyle; - pr "api_built += \\\n"; + pr "api_built = \\\n"; List.iter ( fun (name, _) -> pr "\tnbd_%s \\\n" name; -- 2.22.0
Eric Blake
2019-Aug-15 13:01 UTC
Re: [Libguestfs] [PATCH libnbd] docs: Change docs/Makefile.inc back to a regular include, readd to git.
On 8/15/19 7:50 AM, Richard W.M. Jones wrote:> ‘make clean && make’ was not rebuilding the docs/*.3 files. The > reason is obscure: > > - docs/Makefile has rules: > > MANS = $(man_MANS) > all: all-am > all-am: Makefile $(MANS) > > - sinclude docs/Makefile.inc happened long after MANS is defined, so > MANS held the earlier version of $(man_MANS) without the api-built > man pages listed. > > This was confirmed by looking at the output of ‘make -d -C docs all-am’ > and examining what happens when rebuilding all-am. > > The fix is to change docs/Makefile.inc back to a regular include, > which also means we have to readd this generated file to git to allow > cold clones to work. > > Partly reverts commit 15ca7acd6f46188d6f713af8785e35336b0b71f7. > --- > .gitignore | 1 - > docs/Makefile.am | 8 +--- > docs/Makefile.inc | 98 +++++++++++++++++++++++++++++++++++++++++++++ > generator/generator | 2 +- > 4 files changed, 100 insertions(+), 9 deletions(-)I'm still experimenting to see if we can avoid this with use of $(MAKECMDGOALS): Makefile.inc or similar. Hold off on this one for a bit longer. -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org