From 5d1c6f3e24edaaf731f2543adea96a337442c5fd Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Mon, 22 Jul 2024 02:27:34 +0200 Subject: [PATCH] build: Fix failure of "./configure; make dist". * Makefile.in (srcdir, VPATH): New variables. (VERSION): Refer to src/version.cc in $(srcdir). (dist): Depend on doc/gperf.1. (doc/gperf.1): New rule. * doc/Makefile.in (DISTRIBUTED_BUILT_FILES): Remove wildcard patterns. (DISTRIBUTED_BUILT_FILES_EXTRA_PATTERNS): New variable. (distdir): Handle the files from DISTRIBUTED_BUILT_FILES_EXTRA_PATTERNS. --- ChangeLog | 11 +++++++++++ Makefile.in | 16 ++++++++++++++-- doc/Makefile.in | 8 +++++++- 3 files changed, 32 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5a4d19b..58e182d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2024-07-21 Bruno Haible + + build: Fix failure of "./configure; make dist". + * Makefile.in (srcdir, VPATH): New variables. + (VERSION): Refer to src/version.cc in $(srcdir). + (dist): Depend on doc/gperf.1. + (doc/gperf.1): New rule. + * doc/Makefile.in (DISTRIBUTED_BUILT_FILES): Remove wildcard patterns. + (DISTRIBUTED_BUILT_FILES_EXTRA_PATTERNS): New variable. + (distdir): Handle the files from DISTRIBUTED_BUILT_FILES_EXTRA_PATTERNS. + 2024-07-21 Bruno Haible build: Don't leave an empty gperf.1 on disk if help2man fails. diff --git a/Makefile.in b/Makefile.in index babf2fc..aad3e6b 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,6 +1,6 @@ # Makefile for gperf -# Copyright (C) 1989, 1992-1993, 1998, 2012, 2016, 2018, 2020, 2022 Free Software Foundation, Inc. +# Copyright (C) 1989, 1992-1993, 1998, 2012, 2016, 2018, 2020, 2022, 2024 Free Software Foundation, Inc. # Written by Douglas C. Schmidt # and Bruno Haible . # @@ -21,6 +21,9 @@ #### Start of system configuration section. #### +# Directories used by "make": +srcdir = @srcdir@ + # Programs used by "make": RM = rm -f @SET_MAKE@ @@ -29,6 +32,8 @@ RM = rm -f SHELL = /bin/sh +VPATH = $(srcdir) + all : force cd @subdir@; $(MAKE) all @@ -87,7 +92,7 @@ distdir : $(DISTFILES) # Creating a distribution tarball. PACKAGE = gperf -VERSION = `sed -n -e 's/.*version_string = "\(.*\)".*/\1/p' < src/version.cc` +VERSION = `sed -n -e 's/.*version_string = "\(.*\)".*/\1/p' < $(srcdir)/src/version.cc` TAR = tar GZIP = gzip @@ -101,5 +106,12 @@ dist : force && $(GZIP) -9 $$tmpdistdir.tar \ && rm -rf $$tmpdistdir +# Ensure that the manual page is up-to-date when "make dist" runs. +dist : doc/gperf.1 +doc/gperf.1: $(srcdir)/src/options.cc + (cd lib && $(MAKE)) \ + && (cd src && $(MAKE) gperf$(EXEEXT)) \ + && (cd doc && $(MAKE) gperf.1) + force : diff --git a/doc/Makefile.in b/doc/Makefile.in index 6aa2a1a..4e96005 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -182,8 +182,11 @@ DISTRIBUTED_BUILT_FILES = \ gperf.ps \ gperf.pdf \ gperf.html \ - gperf_toc.html gperf_[0-9].html gperf_[0-9][0-9].html \ + gperf_toc.html \ gperf.1 +# Other distributed files, generated together with $(DISTRIBUTED_BUILT_FILES). +DISTRIBUTED_BUILT_FILES_EXTRA_PATTERNS = \ + $(srcdir)/gperf_[0-9].html $(srcdir)/gperf_[0-9][0-9].html # List of distributed files. DISTFILES = $(SOURCE_FILES) $(IMPORTED_FILES) $(GENERATED_FILES) $(DISTRIBUTED_BUILT_FILES) @@ -192,6 +195,9 @@ distdir : gperf.1-update $(DISTFILES) if test -f $$file; then dir='.'; else dir='$(srcdir)'; fi; \ cp -p $$dir/$$file '$(distdir)'/$$file || exit 1; \ done + for file in $(DISTRIBUTED_BUILT_FILES_EXTRA_PATTERNS); do \ + cp -p $$file '$(distdir)'/ || exit 1; \ + done force :