Eric Blake
2019-Aug-14 16:54 UTC
[Libguestfs] [libnbd PATCH 0/2] Drop generated file from git
Rich recently patched things to generate one man page per function rather than libnbd-api.3 (nice), but in doing so got stumped by a problem with a fresh git clone (automake fails for any 'include' directive that does not already exist). I've figured out how to hack around it, but the hack requires GNU make. We already use GNU make constructs elsewhere (such as $(wildcard)), but while existing uses are out of laziness and can probably be rewritten in portable make if someone complained, this patch series cements our dependency on GNU make (I don't know of any way to fix this problem for non-GNU make). Hence I'm posting this for review, even though I think it's good to go. Eric Blake (2): docs: Simplify generated docs/Makefile.inc docs: Drop docs/Makefile.inc from git docs/Makefile.am | 19 +- docs/Makefile.inc | 633 -------------------------------------------- generator/generator | 42 +-- .gitignore | 1 + 4 files changed, 25 insertions(+), 670 deletions(-) delete mode 100644 docs/Makefile.inc -- 2.20.1
Eric Blake
2019-Aug-14 16:54 UTC
[Libguestfs] [libnbd PATCH 1/2] docs: Simplify generated docs/Makefile.inc
Rather than using Automake conditionals and one rule per file, make the generated file merely contain a list of function names, and do the bulk of the work in the main Makefile.am using GNU make pattern substitutions. This is a prerequisite to figuring out how to remove dosc/Makefile.inc from git while still keeping automake happy and still working on the correct set of files. --- docs/Makefile.am | 16 +- docs/Makefile.inc | 687 +++++--------------------------------------- generator/generator | 35 +-- 3 files changed, 93 insertions(+), 645 deletions(-) diff --git a/docs/Makefile.am b/docs/Makefile.am index 7edc129..30d4603 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -17,8 +17,13 @@ include $(top_srcdir)/subdir-rules.mk +api_built+ +include $(srcdir)/Makefile.inc + generator_built = \ Makefile.inc \ + $(api_built:%=%.pod) \ $(NULL) EXTRA_DIST = \ @@ -38,12 +43,21 @@ man_MANS = \ nbd_close.3 \ nbd_get_error.3 \ nbd_get_errno.3 \ + $(api_built:%=%.3) \ $(NULL) CLEANFILES += \ libnbd.3 \ nbd_create.3 \ + $(api_built:%=%.3) \ $(NULL) +# Generic .pod -> .3 +nbd_%.3: nbd_%.pod $(top_builddir)/podwrapper.pl + $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ + --html $(top_builddir)/html/$@.html \ + $< + +# Specific .pod -> .3, overridden to forbid long lines libnbd.3: libnbd.pod $(top_builddir)/podwrapper.pl $(PODWRAPPER) --section=3 --man $@ \ --html $(top_builddir)/html/$@.html \ @@ -55,5 +69,3 @@ nbd_create.3: nbd_create.pod $(top_builddir)/podwrapper.pl $< endif HAVE_POD - -include $(srcdir)/Makefile.inc diff --git a/docs/Makefile.inc b/docs/Makefile.inc index 1ec6546..fb64b62 100644 --- a/docs/Makefile.inc +++ b/docs/Makefile.inc @@ -19,615 +19,80 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -generator_built += \ - nbd_set_debug.pod \ - nbd_get_debug.pod \ - nbd_set_debug_callback.pod \ - nbd_clear_debug_callback.pod \ - nbd_set_handle_name.pod \ - nbd_get_handle_name.pod \ - nbd_set_export_name.pod \ - nbd_get_export_name.pod \ - nbd_set_tls.pod \ - nbd_get_tls.pod \ - nbd_set_tls_certificates.pod \ - nbd_set_tls_verify_peer.pod \ - nbd_get_tls_verify_peer.pod \ - nbd_set_tls_username.pod \ - nbd_get_tls_username.pod \ - nbd_set_tls_psk_file.pod \ - nbd_add_meta_context.pod \ - nbd_connect_uri.pod \ - nbd_connect_unix.pod \ - nbd_connect_tcp.pod \ - nbd_connect_command.pod \ - nbd_is_read_only.pod \ - nbd_can_flush.pod \ - nbd_can_fua.pod \ - nbd_is_rotational.pod \ - nbd_can_trim.pod \ - nbd_can_zero.pod \ - nbd_can_df.pod \ - nbd_can_multi_conn.pod \ - nbd_can_cache.pod \ - nbd_can_meta_context.pod \ - nbd_get_size.pod \ - nbd_pread.pod \ - nbd_pread_structured.pod \ - nbd_pwrite.pod \ - nbd_shutdown.pod \ - nbd_flush.pod \ - nbd_trim.pod \ - nbd_cache.pod \ - nbd_zero.pod \ - nbd_block_status.pod \ - nbd_poll.pod \ - nbd_aio_connect.pod \ - nbd_aio_connect_uri.pod \ - nbd_aio_connect_unix.pod \ - nbd_aio_connect_tcp.pod \ - nbd_aio_connect_command.pod \ - nbd_aio_pread.pod \ - nbd_aio_pread_structured.pod \ - nbd_aio_pwrite.pod \ - nbd_aio_disconnect.pod \ - nbd_aio_flush.pod \ - nbd_aio_trim.pod \ - nbd_aio_cache.pod \ - nbd_aio_zero.pod \ - nbd_aio_block_status.pod \ - nbd_aio_get_fd.pod \ - nbd_aio_get_direction.pod \ - nbd_aio_notify_read.pod \ - nbd_aio_notify_write.pod \ - nbd_aio_is_created.pod \ - nbd_aio_is_connecting.pod \ - nbd_aio_is_ready.pod \ - nbd_aio_is_processing.pod \ - nbd_aio_is_dead.pod \ - nbd_aio_is_closed.pod \ - nbd_aio_command_completed.pod \ - nbd_aio_peek_command_completed.pod \ - nbd_aio_in_flight.pod \ - nbd_connection_state.pod \ - nbd_get_package_name.pod \ - nbd_get_version.pod \ - nbd_kill_command.pod \ - nbd_supports_tls.pod \ - nbd_supports_uri.pod \ +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_command \ + nbd_supports_tls \ + nbd_supports_uri \ $(NULL) - -CLEANFILES += \ - nbd_set_debug.3 \ - nbd_get_debug.3 \ - nbd_set_debug_callback.3 \ - nbd_clear_debug_callback.3 \ - nbd_set_handle_name.3 \ - nbd_get_handle_name.3 \ - nbd_set_export_name.3 \ - nbd_get_export_name.3 \ - nbd_set_tls.3 \ - nbd_get_tls.3 \ - nbd_set_tls_certificates.3 \ - nbd_set_tls_verify_peer.3 \ - nbd_get_tls_verify_peer.3 \ - nbd_set_tls_username.3 \ - nbd_get_tls_username.3 \ - nbd_set_tls_psk_file.3 \ - nbd_add_meta_context.3 \ - nbd_connect_uri.3 \ - nbd_connect_unix.3 \ - nbd_connect_tcp.3 \ - nbd_connect_command.3 \ - nbd_is_read_only.3 \ - nbd_can_flush.3 \ - nbd_can_fua.3 \ - nbd_is_rotational.3 \ - nbd_can_trim.3 \ - nbd_can_zero.3 \ - nbd_can_df.3 \ - nbd_can_multi_conn.3 \ - nbd_can_cache.3 \ - nbd_can_meta_context.3 \ - nbd_get_size.3 \ - nbd_pread.3 \ - nbd_pread_structured.3 \ - nbd_pwrite.3 \ - nbd_shutdown.3 \ - nbd_flush.3 \ - nbd_trim.3 \ - nbd_cache.3 \ - nbd_zero.3 \ - nbd_block_status.3 \ - nbd_poll.3 \ - nbd_aio_connect.3 \ - nbd_aio_connect_uri.3 \ - nbd_aio_connect_unix.3 \ - nbd_aio_connect_tcp.3 \ - nbd_aio_connect_command.3 \ - nbd_aio_pread.3 \ - nbd_aio_pread_structured.3 \ - nbd_aio_pwrite.3 \ - nbd_aio_disconnect.3 \ - nbd_aio_flush.3 \ - nbd_aio_trim.3 \ - nbd_aio_cache.3 \ - nbd_aio_zero.3 \ - nbd_aio_block_status.3 \ - nbd_aio_get_fd.3 \ - nbd_aio_get_direction.3 \ - nbd_aio_notify_read.3 \ - nbd_aio_notify_write.3 \ - nbd_aio_is_created.3 \ - nbd_aio_is_connecting.3 \ - nbd_aio_is_ready.3 \ - nbd_aio_is_processing.3 \ - nbd_aio_is_dead.3 \ - nbd_aio_is_closed.3 \ - nbd_aio_command_completed.3 \ - nbd_aio_peek_command_completed.3 \ - nbd_aio_in_flight.3 \ - nbd_connection_state.3 \ - nbd_get_package_name.3 \ - nbd_get_version.3 \ - nbd_kill_command.3 \ - nbd_supports_tls.3 \ - nbd_supports_uri.3 \ - $(NULL) - -if HAVE_POD - -man_MANS += \ - nbd_set_debug.3 \ - nbd_get_debug.3 \ - nbd_set_debug_callback.3 \ - nbd_clear_debug_callback.3 \ - nbd_set_handle_name.3 \ - nbd_get_handle_name.3 \ - nbd_set_export_name.3 \ - nbd_get_export_name.3 \ - nbd_set_tls.3 \ - nbd_get_tls.3 \ - nbd_set_tls_certificates.3 \ - nbd_set_tls_verify_peer.3 \ - nbd_get_tls_verify_peer.3 \ - nbd_set_tls_username.3 \ - nbd_get_tls_username.3 \ - nbd_set_tls_psk_file.3 \ - nbd_add_meta_context.3 \ - nbd_connect_uri.3 \ - nbd_connect_unix.3 \ - nbd_connect_tcp.3 \ - nbd_connect_command.3 \ - nbd_is_read_only.3 \ - nbd_can_flush.3 \ - nbd_can_fua.3 \ - nbd_is_rotational.3 \ - nbd_can_trim.3 \ - nbd_can_zero.3 \ - nbd_can_df.3 \ - nbd_can_multi_conn.3 \ - nbd_can_cache.3 \ - nbd_can_meta_context.3 \ - nbd_get_size.3 \ - nbd_pread.3 \ - nbd_pread_structured.3 \ - nbd_pwrite.3 \ - nbd_shutdown.3 \ - nbd_flush.3 \ - nbd_trim.3 \ - nbd_cache.3 \ - nbd_zero.3 \ - nbd_block_status.3 \ - nbd_poll.3 \ - nbd_aio_connect.3 \ - nbd_aio_connect_uri.3 \ - nbd_aio_connect_unix.3 \ - nbd_aio_connect_tcp.3 \ - nbd_aio_connect_command.3 \ - nbd_aio_pread.3 \ - nbd_aio_pread_structured.3 \ - nbd_aio_pwrite.3 \ - nbd_aio_disconnect.3 \ - nbd_aio_flush.3 \ - nbd_aio_trim.3 \ - nbd_aio_cache.3 \ - nbd_aio_zero.3 \ - nbd_aio_block_status.3 \ - nbd_aio_get_fd.3 \ - nbd_aio_get_direction.3 \ - nbd_aio_notify_read.3 \ - nbd_aio_notify_write.3 \ - nbd_aio_is_created.3 \ - nbd_aio_is_connecting.3 \ - nbd_aio_is_ready.3 \ - nbd_aio_is_processing.3 \ - nbd_aio_is_dead.3 \ - nbd_aio_is_closed.3 \ - nbd_aio_command_completed.3 \ - nbd_aio_peek_command_completed.3 \ - nbd_aio_in_flight.3 \ - nbd_connection_state.3 \ - nbd_get_package_name.3 \ - nbd_get_version.3 \ - nbd_kill_command.3 \ - nbd_supports_tls.3 \ - nbd_supports_uri.3 \ - $(NULL) - -nbd_set_debug.3: nbd_set_debug.pod $(top_builddir)/podwrapper.pl - $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ - --html $(top_builddir)/html/$@.html \ - $< - -nbd_get_debug.3: nbd_get_debug.pod $(top_builddir)/podwrapper.pl - $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ - --html $(top_builddir)/html/$@.html \ - $< - -nbd_set_debug_callback.3: nbd_set_debug_callback.pod $(top_builddir)/podwrapper.pl - $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ - --html $(top_builddir)/html/$@.html \ - $< - -nbd_clear_debug_callback.3: nbd_clear_debug_callback.pod $(top_builddir)/podwrapper.pl - $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ - --html $(top_builddir)/html/$@.html \ - $< - -nbd_set_handle_name.3: nbd_set_handle_name.pod $(top_builddir)/podwrapper.pl - $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ - --html $(top_builddir)/html/$@.html \ - $< - -nbd_get_handle_name.3: nbd_get_handle_name.pod $(top_builddir)/podwrapper.pl - $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ - --html $(top_builddir)/html/$@.html \ - $< - -nbd_set_export_name.3: nbd_set_export_name.pod $(top_builddir)/podwrapper.pl - $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ - --html $(top_builddir)/html/$@.html \ - $< - -nbd_get_export_name.3: nbd_get_export_name.pod $(top_builddir)/podwrapper.pl - $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ - --html $(top_builddir)/html/$@.html \ - $< - -nbd_set_tls.3: nbd_set_tls.pod $(top_builddir)/podwrapper.pl - $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ - --html $(top_builddir)/html/$@.html \ - $< - -nbd_get_tls.3: nbd_get_tls.pod $(top_builddir)/podwrapper.pl - $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ - --html $(top_builddir)/html/$@.html \ - $< - -nbd_set_tls_certificates.3: nbd_set_tls_certificates.pod $(top_builddir)/podwrapper.pl - $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ - --html $(top_builddir)/html/$@.html \ - $< - -nbd_set_tls_verify_peer.3: nbd_set_tls_verify_peer.pod $(top_builddir)/podwrapper.pl - $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ - --html $(top_builddir)/html/$@.html \ - $< - -nbd_get_tls_verify_peer.3: nbd_get_tls_verify_peer.pod $(top_builddir)/podwrapper.pl - $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ - --html $(top_builddir)/html/$@.html \ - $< - -nbd_set_tls_username.3: nbd_set_tls_username.pod $(top_builddir)/podwrapper.pl - $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ - --html $(top_builddir)/html/$@.html \ - $< - -nbd_get_tls_username.3: nbd_get_tls_username.pod $(top_builddir)/podwrapper.pl - $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ - --html $(top_builddir)/html/$@.html \ - $< - -nbd_set_tls_psk_file.3: nbd_set_tls_psk_file.pod $(top_builddir)/podwrapper.pl - $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ - --html $(top_builddir)/html/$@.html \ - $< - -nbd_add_meta_context.3: nbd_add_meta_context.pod $(top_builddir)/podwrapper.pl - $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ - --html $(top_builddir)/html/$@.html \ - $< - -nbd_connect_uri.3: nbd_connect_uri.pod $(top_builddir)/podwrapper.pl - $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ - --html $(top_builddir)/html/$@.html \ - $< - -nbd_connect_unix.3: nbd_connect_unix.pod $(top_builddir)/podwrapper.pl - $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ - --html $(top_builddir)/html/$@.html \ - $< - -nbd_connect_tcp.3: nbd_connect_tcp.pod $(top_builddir)/podwrapper.pl - $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ - --html $(top_builddir)/html/$@.html \ - $< - -nbd_connect_command.3: nbd_connect_command.pod $(top_builddir)/podwrapper.pl - $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ - --html $(top_builddir)/html/$@.html \ - $< - -nbd_is_read_only.3: nbd_is_read_only.pod $(top_builddir)/podwrapper.pl - $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ - --html $(top_builddir)/html/$@.html \ - $< - -nbd_can_flush.3: nbd_can_flush.pod $(top_builddir)/podwrapper.pl - $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ - --html $(top_builddir)/html/$@.html \ - $< - -nbd_can_fua.3: nbd_can_fua.pod $(top_builddir)/podwrapper.pl - $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ - --html $(top_builddir)/html/$@.html \ - $< - -nbd_is_rotational.3: nbd_is_rotational.pod $(top_builddir)/podwrapper.pl - $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ - --html $(top_builddir)/html/$@.html \ - $< - -nbd_can_trim.3: nbd_can_trim.pod $(top_builddir)/podwrapper.pl - $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ - --html $(top_builddir)/html/$@.html \ - $< - -nbd_can_zero.3: nbd_can_zero.pod $(top_builddir)/podwrapper.pl - $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ - --html $(top_builddir)/html/$@.html \ - $< - -nbd_can_df.3: nbd_can_df.pod $(top_builddir)/podwrapper.pl - $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ - --html $(top_builddir)/html/$@.html \ - $< - -nbd_can_multi_conn.3: nbd_can_multi_conn.pod $(top_builddir)/podwrapper.pl - $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ - --html $(top_builddir)/html/$@.html \ - $< - -nbd_can_cache.3: nbd_can_cache.pod $(top_builddir)/podwrapper.pl - $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ - --html $(top_builddir)/html/$@.html \ - $< - -nbd_can_meta_context.3: nbd_can_meta_context.pod $(top_builddir)/podwrapper.pl - $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ - --html $(top_builddir)/html/$@.html \ - $< - -nbd_get_size.3: nbd_get_size.pod $(top_builddir)/podwrapper.pl - $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ - --html $(top_builddir)/html/$@.html \ - $< - -nbd_pread.3: nbd_pread.pod $(top_builddir)/podwrapper.pl - $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ - --html $(top_builddir)/html/$@.html \ - $< - -nbd_pread_structured.3: nbd_pread_structured.pod $(top_builddir)/podwrapper.pl - $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ - --html $(top_builddir)/html/$@.html \ - $< - -nbd_pwrite.3: nbd_pwrite.pod $(top_builddir)/podwrapper.pl - $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ - --html $(top_builddir)/html/$@.html \ - $< - -nbd_shutdown.3: nbd_shutdown.pod $(top_builddir)/podwrapper.pl - $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ - --html $(top_builddir)/html/$@.html \ - $< - -nbd_flush.3: nbd_flush.pod $(top_builddir)/podwrapper.pl - $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ - --html $(top_builddir)/html/$@.html \ - $< - -nbd_trim.3: nbd_trim.pod $(top_builddir)/podwrapper.pl - $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ - --html $(top_builddir)/html/$@.html \ - $< - -nbd_cache.3: nbd_cache.pod $(top_builddir)/podwrapper.pl - $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ - --html $(top_builddir)/html/$@.html \ - $< - -nbd_zero.3: nbd_zero.pod $(top_builddir)/podwrapper.pl - $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ - --html $(top_builddir)/html/$@.html \ - $< - -nbd_block_status.3: nbd_block_status.pod $(top_builddir)/podwrapper.pl - $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ - --html $(top_builddir)/html/$@.html \ - $< - -nbd_poll.3: nbd_poll.pod $(top_builddir)/podwrapper.pl - $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ - --html $(top_builddir)/html/$@.html \ - $< - -nbd_aio_connect.3: nbd_aio_connect.pod $(top_builddir)/podwrapper.pl - $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ - --html $(top_builddir)/html/$@.html \ - $< - -nbd_aio_connect_uri.3: nbd_aio_connect_uri.pod $(top_builddir)/podwrapper.pl - $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ - --html $(top_builddir)/html/$@.html \ - $< - -nbd_aio_connect_unix.3: nbd_aio_connect_unix.pod $(top_builddir)/podwrapper.pl - $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ - --html $(top_builddir)/html/$@.html \ - $< - -nbd_aio_connect_tcp.3: nbd_aio_connect_tcp.pod $(top_builddir)/podwrapper.pl - $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ - --html $(top_builddir)/html/$@.html \ - $< - -nbd_aio_connect_command.3: nbd_aio_connect_command.pod $(top_builddir)/podwrapper.pl - $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ - --html $(top_builddir)/html/$@.html \ - $< - -nbd_aio_pread.3: nbd_aio_pread.pod $(top_builddir)/podwrapper.pl - $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ - --html $(top_builddir)/html/$@.html \ - $< - -nbd_aio_pread_structured.3: nbd_aio_pread_structured.pod $(top_builddir)/podwrapper.pl - $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ - --html $(top_builddir)/html/$@.html \ - $< - -nbd_aio_pwrite.3: nbd_aio_pwrite.pod $(top_builddir)/podwrapper.pl - $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ - --html $(top_builddir)/html/$@.html \ - $< - -nbd_aio_disconnect.3: nbd_aio_disconnect.pod $(top_builddir)/podwrapper.pl - $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ - --html $(top_builddir)/html/$@.html \ - $< - -nbd_aio_flush.3: nbd_aio_flush.pod $(top_builddir)/podwrapper.pl - $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ - --html $(top_builddir)/html/$@.html \ - $< - -nbd_aio_trim.3: nbd_aio_trim.pod $(top_builddir)/podwrapper.pl - $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ - --html $(top_builddir)/html/$@.html \ - $< - -nbd_aio_cache.3: nbd_aio_cache.pod $(top_builddir)/podwrapper.pl - $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ - --html $(top_builddir)/html/$@.html \ - $< - -nbd_aio_zero.3: nbd_aio_zero.pod $(top_builddir)/podwrapper.pl - $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ - --html $(top_builddir)/html/$@.html \ - $< - -nbd_aio_block_status.3: nbd_aio_block_status.pod $(top_builddir)/podwrapper.pl - $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ - --html $(top_builddir)/html/$@.html \ - $< - -nbd_aio_get_fd.3: nbd_aio_get_fd.pod $(top_builddir)/podwrapper.pl - $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ - --html $(top_builddir)/html/$@.html \ - $< - -nbd_aio_get_direction.3: nbd_aio_get_direction.pod $(top_builddir)/podwrapper.pl - $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ - --html $(top_builddir)/html/$@.html \ - $< - -nbd_aio_notify_read.3: nbd_aio_notify_read.pod $(top_builddir)/podwrapper.pl - $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ - --html $(top_builddir)/html/$@.html \ - $< - -nbd_aio_notify_write.3: nbd_aio_notify_write.pod $(top_builddir)/podwrapper.pl - $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ - --html $(top_builddir)/html/$@.html \ - $< - -nbd_aio_is_created.3: nbd_aio_is_created.pod $(top_builddir)/podwrapper.pl - $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ - --html $(top_builddir)/html/$@.html \ - $< - -nbd_aio_is_connecting.3: nbd_aio_is_connecting.pod $(top_builddir)/podwrapper.pl - $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ - --html $(top_builddir)/html/$@.html \ - $< - -nbd_aio_is_ready.3: nbd_aio_is_ready.pod $(top_builddir)/podwrapper.pl - $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ - --html $(top_builddir)/html/$@.html \ - $< - -nbd_aio_is_processing.3: nbd_aio_is_processing.pod $(top_builddir)/podwrapper.pl - $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ - --html $(top_builddir)/html/$@.html \ - $< - -nbd_aio_is_dead.3: nbd_aio_is_dead.pod $(top_builddir)/podwrapper.pl - $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ - --html $(top_builddir)/html/$@.html \ - $< - -nbd_aio_is_closed.3: nbd_aio_is_closed.pod $(top_builddir)/podwrapper.pl - $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ - --html $(top_builddir)/html/$@.html \ - $< - -nbd_aio_command_completed.3: nbd_aio_command_completed.pod $(top_builddir)/podwrapper.pl - $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ - --html $(top_builddir)/html/$@.html \ - $< - -nbd_aio_peek_command_completed.3: nbd_aio_peek_command_completed.pod $(top_builddir)/podwrapper.pl - $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ - --html $(top_builddir)/html/$@.html \ - $< - -nbd_aio_in_flight.3: nbd_aio_in_flight.pod $(top_builddir)/podwrapper.pl - $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ - --html $(top_builddir)/html/$@.html \ - $< - -nbd_connection_state.3: nbd_connection_state.pod $(top_builddir)/podwrapper.pl - $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ - --html $(top_builddir)/html/$@.html \ - $< - -nbd_get_package_name.3: nbd_get_package_name.pod $(top_builddir)/podwrapper.pl - $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ - --html $(top_builddir)/html/$@.html \ - $< - -nbd_get_version.3: nbd_get_version.pod $(top_builddir)/podwrapper.pl - $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ - --html $(top_builddir)/html/$@.html \ - $< - -nbd_kill_command.3: nbd_kill_command.pod $(top_builddir)/podwrapper.pl - $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ - --html $(top_builddir)/html/$@.html \ - $< - -nbd_supports_tls.3: nbd_supports_tls.pod $(top_builddir)/podwrapper.pl - $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ - --html $(top_builddir)/html/$@.html \ - $< - -nbd_supports_uri.3: nbd_supports_uri.pod $(top_builddir)/podwrapper.pl - $(PODWRAPPER) --allow-long-lines --section=3 --man $@ \ - --html $(top_builddir)/html/$@.html \ - $< - -endif HAVE_POD diff --git a/generator/generator b/generator/generator index 6187e9e..257303f 100755 --- a/generator/generator +++ b/generator/generator @@ -3740,41 +3740,12 @@ let generate_lib_api_c () let generate_docs_Makefile_inc () generate_header HashStyle; - pr "generator_built += \\\n"; + pr "api_built += \\\n"; List.iter ( fun (name, _) -> - pr "\tnbd_%s.pod \\\n" name; + pr "\tnbd_%s \\\n" name; ) handle_calls; - pr "\t$(NULL)\n"; - pr "\n"; - - pr "CLEANFILES += \\\n"; - List.iter ( - fun (name, _) -> - pr "\tnbd_%s.3 \\\n" name; - ) handle_calls; - pr "\t$(NULL)\n"; - pr "\n"; - - pr "if HAVE_POD\n"; - pr "\n"; - pr "man_MANS += \\\n"; - List.iter ( - fun (name, _) -> - pr "\tnbd_%s.3 \\\n" name; - ) handle_calls; - pr "\t$(NULL)\n"; - pr "\n"; - - List.iter ( - fun (name, _) -> - pr "nbd_%s.3: nbd_%s.pod $(top_builddir)/podwrapper.pl\n" name name; - pr "\t$(PODWRAPPER) --allow-long-lines --section=3 --man $@ \\\n"; - pr "\t --html $(top_builddir)/html/$@.html \\\n"; - pr "\t $<\n"; - pr "\n"; - ) handle_calls; - pr "endif HAVE_POD\n" + pr "\t$(NULL)\n" let generate_docs_nbd_pod name { args; optargs; ret; shortdesc; longdesc; -- 2.20.1
Eric Blake
2019-Aug-14 16:54 UTC
[Libguestfs] [libnbd PATCH 2/2] docs: Drop docs/Makefile.inc from git
Automake insists that any file present in a Makefile.am 'include' must be present, but it has no idea about the GNU make extension 'sinclude'. Use this to our advantage: as long as Makefile.inc has nothing other than variable modifications (done in the previous patch), and our rules properly generate it when needed (thanks to generator_built), then running 'make' will still build all the right man pages, and 'make dist' will still distribute all the right generated .pod files for the sake of someone building the tarball without OCaml, all without having to keep a generated file in git. Signed-off-by: Eric Blake <eblake@redhat.com> --- docs/Makefile.am | 5 ++- docs/Makefile.inc | 98 --------------------------------------------- generator/generator | 7 ++-- .gitignore | 1 + 4 files changed, 9 insertions(+), 102 deletions(-) delete mode 100644 docs/Makefile.inc diff --git a/docs/Makefile.am b/docs/Makefile.am index 30d4603..30a972d 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -19,7 +19,10 @@ include $(top_srcdir)/subdir-rules.mk api_built -include $(srcdir)/Makefile.inc +# 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 generator_built = \ Makefile.inc \ diff --git a/docs/Makefile.inc b/docs/Makefile.inc deleted file mode 100644 index fb64b62..0000000 --- a/docs/Makefile.inc +++ /dev/null @@ -1,98 +0,0 @@ -# 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_command \ - nbd_supports_tls \ - nbd_supports_uri \ - $(NULL) diff --git a/generator/generator b/generator/generator index 257303f..9fe98f5 100755 --- a/generator/generator +++ b/generator/generator @@ -3733,9 +3733,10 @@ let generate_lib_api_c () pr "\n"; List.iter print_wrapper handle_calls -(* We generate a fragment of Makefile.am containing rules for - * building the manual pages. Note this file is committed to - * git because otherwise you can't clone and run autoreconf. +(* We generate a fragment of Makefile.am containing the list + * of generated functions, used in rules for building the manual + * pages. We exploit GNU make's sinclude to use this file without + * upsetting automake. *) let generate_docs_Makefile_inc () generate_header HashStyle; diff --git a/.gitignore b/.gitignore index 4109865..ccbbc14 100644 --- a/.gitignore +++ b/.gitignore @@ -39,6 +39,7 @@ Makefile.in /depcomp /docs/*.3 /docs/*.pod +/docs/Makefile.inc !/docs/libnbd.pod !/docs/nbd_close.3 !/docs/nbd_create.pod -- 2.20.1
Richard W.M. Jones
2019-Aug-14 17:03 UTC
Re: [Libguestfs] [libnbd PATCH 2/2] docs: Drop docs/Makefile.inc from git
Looks fine, ACK series. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into KVM guests. http://libguestfs.org/virt-v2v
Reasonably Related Threads
- [libnbd PATCH 2/2] docs: Drop docs/Makefile.inc from git
- [PATCH libnbd] docs: Change docs/Makefile.inc back to a regular include, readd to git.
- Re: [PATCH 3/3] docs: don't perform lookup on absolute paths
- [PATCH 0/3] Fixing out-of-tree builds
- libguestfs-1.22.1 compilation error