From: Bruno Haible Date: Mon, 22 Jul 2024 11:25:14 +0000 (+0200) Subject: build: Support "make dist" without prior "make". X-Git-Tag: v0.23~234 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=088a93812e2c9aa60faa0f322c4a75852731387a;p=thirdparty%2Fgettext.git build: Support "make dist" without prior "make". This is required by the GNU Coding Standards . Reported by in . * Makefile.am (distdir1): New target. * configure.ac: Apply FIX_MAKEFILE_DISTRIB on Makefile. * gettext-runtime/Makefile.am (distdir1, gen-man1): New targets. * gettext-runtime/configure.ac: Apply FIX_MAKEFILE_DISTRIB on Makefile. * gettext-tools/Makefile.am (programs-for-distdir, distdir1, gen-man1, distdir2): New targets. * gettext-tools/configure.ac: Apply FIX_MAKEFILE_DISTRIB on Makefile. * gettext-tools/src/Makefile.am (built-sources): New target. --- diff --git a/Makefile.am b/Makefile.am index 4e2ad1128..5eacee01b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -104,6 +104,18 @@ dist-hook: gen-ChangeLogs echo $(VERSION) > $(distdir)/.tarball-version +# Support for "make dist" without prior "make". + +# Ensure that the prerequisites of gettext-tools/src are built when "make dist" +# runs. +# Hidden from automake, but really activated. Works around an automake bug. +#distdir: distdir1 +.PHONY: distdir1 +distdir1: + cd gettext-runtime/intl && $(MAKE) $(AM_MAKEFLAGS) + cd libtextstyle && $(MAKE) $(AM_MAKEFLAGS) + + # Generate ChangeLog. gen_start_date = 2015-10-13 diff --git a/configure.ac b/configure.ac index f4e54ea6b..510667695 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ dnl Configuration for the toplevel directory of GNU gettext -dnl Copyright (C) 1995-2020 Free Software Foundation, Inc. +dnl Copyright (C) 1995-2024 Free Software Foundation, Inc. dnl dnl This program is free software: you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by @@ -51,7 +51,8 @@ dnl Optional Packages: AC_ARG_WITH calls dnl Some influential environment variables: AC_ARG_VAR calls esyscmd([{ cd gettext-runtime && autoconf --trace=AC_ARG_ENABLE:'$n([$1],[$2])' --trace=AC_ARG_WITH:'$n([$1],[$2])' --trace=AC_ARG_VAR:'$n($@)' && cd ..; cd libtextstyle && autoconf --trace=AC_ARG_ENABLE:'$n([$1],[$2])' --trace=AC_ARG_WITH:'$n([$1],[$2])' --trace=AC_ARG_VAR:'$n($@)' && cd ..; { cd gettext-tools && autoconf --trace=AC_ARG_ENABLE:'$n([$1],[$2])' --trace=AC_ARG_WITH:'$n([$1],[$2])' --trace=AC_ARG_VAR:'$n($@)' && cd ..; } | grep -v installed.libtextstyle | grep -v installed.csharp | grep -v 'installed C#'; } | sed -f build-aux/ac-help.sed ]) -AC_CONFIG_FILES([Makefile]) +AC_CONFIG_FILES([Makefile], + [FIX_MAKEFILE_DISTRIB]) AC_CONFIG_FILES([gnulib-local/Makefile]) diff --git a/gettext-runtime/Makefile.am b/gettext-runtime/Makefile.am index 0a8e7d9d5..958e2e57c 100644 --- a/gettext-runtime/Makefile.am +++ b/gettext-runtime/Makefile.am @@ -1,6 +1,5 @@ ## Makefile for the gettext-runtime directory of GNU gettext -## Copyright (C) 1995-2006, 2010, 2012-2016, 2018-2019 Free Software Foundation, -## Inc. +## Copyright (C) 1995-2024 Free Software Foundation, Inc. ## ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -47,6 +46,23 @@ EXTRA_DIST += gnulib-m4/gnulib-cache.m4 EXTRA_DIST += INSTALL.windows +# Support for "make dist" without prior "make". + +# Ensure that the manual pages are up-to-date when "make dist" runs. +# Hidden from automake, but really activated. Works around an automake bug. +#distdir: distdir1 +.PHONY: distdir1 +distdir1: man/gettext.1 man/ngettext.1 man/envsubst.1 +man/gettext.1 man/ngettext.1 man/envsubst.1: gen-man1 +.PHONY: gen-man1 +gen-man1: src/gettext.c man/gettext.x \ + src/ngettext.c man/ngettext.x \ + src/envsubst.c man/envsubst.x + cd gnulib-lib && $(MAKE) $(AM_MAKEFLAGS) + cd src && $(MAKE) $(AM_MAKEFLAGS) gettext$(EXEEXT) ngettext$(EXEEXT) envsubst$(EXEEXT) + cd man && $(MAKE) $(AM_MAKEFLAGS) gettext.1 ngettext.1 envsubst.1 + + maintainer-update-po: $(top_builddir)/config.status $(SHELL) ./config.status --recheck $(SHELL) ./config.status po/Makefile.in po-directories diff --git a/gettext-runtime/configure.ac b/gettext-runtime/configure.ac index 93d615785..da6b5e136 100644 --- a/gettext-runtime/configure.ac +++ b/gettext-runtime/configure.ac @@ -197,7 +197,8 @@ AC_CONFIG_SUBDIRS([intl]) AC_CONFIG_SUBDIRS([libasprintf]) -AC_CONFIG_FILES([Makefile]) +AC_CONFIG_FILES([Makefile], + [FIX_MAKEFILE_DISTRIB]) AC_CONFIG_FILES([uninstalled-config.sh]) AC_CONFIG_FILES([doc/Makefile]) diff --git a/gettext-tools/Makefile.am b/gettext-tools/Makefile.am index 26bb9941d..d198877ce 100644 --- a/gettext-tools/Makefile.am +++ b/gettext-tools/Makefile.am @@ -1,5 +1,5 @@ ## Makefile for the gettext-tools directory of GNU gettext -## Copyright (C) 1995-2023 Free Software Foundation, Inc. +## Copyright (C) 1995-2024 Free Software Foundation, Inc. ## ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -59,6 +59,118 @@ EXTRA_DIST += INSTALL.windows EXTRA_DIST += woe32dll/export.h + +# Support for "make dist" without prior "make". + +# Prerequisites of both distdir1 and distdir2. +.PHONY: programs-for-distdir +programs-for-distdir: + cd gnulib-lib && $(MAKE) $(AM_MAKEFLAGS) + cd libgrep && $(MAKE) $(AM_MAKEFLAGS) + cd src \ + && $(MAKE) $(AM_MAKEFLAGS) built-sources \ + && $(MAKE) $(AM_MAKEFLAGS) \ + msgcmp$(EXEEXT) \ + msgfmt$(EXEEXT) \ + msgmerge$(EXEEXT) \ + msgunfmt$(EXEEXT) \ + xgettext$(EXEEXT) \ + msgattrib$(EXEEXT) \ + msgcat$(EXEEXT) \ + msgcomm$(EXEEXT) \ + msgconv$(EXEEXT) \ + msgen$(EXEEXT) \ + msgexec$(EXEEXT) \ + msgfilter$(EXEEXT) \ + msggrep$(EXEEXT) \ + msginit$(EXEEXT) \ + msguniq$(EXEEXT) \ + recode-sr-latin$(EXEEXT) + +# Ensure that the manual pages are up-to-date when "make dist" runs. +# Hidden from automake, but really activated. Works around an automake bug. +#distdir: distdir1 +.PHONY: distdir1 +distdir1: \ + man/msgcmp.1 \ + man/msgfmt.1 \ + man/msgmerge.1 \ + man/msgunfmt.1 \ + man/xgettext.1 \ + man/msgattrib.1 \ + man/msgcat.1 \ + man/msgcomm.1 \ + man/msgconv.1 \ + man/msgen.1 \ + man/msgexec.1 \ + man/msgfilter.1 \ + man/msggrep.1 \ + man/msginit.1 \ + man/msguniq.1 \ + man/recode-sr-latin.1 +man/msgcmp.1 \ + man/msgfmt.1 \ + man/msgmerge.1 \ + man/msgunfmt.1 \ + man/xgettext.1 \ + man/msgattrib.1 \ + man/msgcat.1 \ + man/msgcomm.1 \ + man/msgconv.1 \ + man/msgen.1 \ + man/msgexec.1 \ + man/msgfilter.1 \ + man/msggrep.1 \ + man/msginit.1 \ + man/msguniq.1 \ + man/recode-sr-latin.1 \ + : gen-man1 +.PHONY: gen-man1 +gen-man1: programs-for-distdir \ + src/msgcmp.c man/msgcmp.x \ + src/msgfmt.c man/msgfmt.x \ + src/msgmerge.c man/msgmerge.x \ + src/msgunfmt.c man/msgunfmt.x \ + src/xgettext.c man/xgettext.x \ + src/msgattrib.c man/msgattrib.x \ + src/msgcat.c man/msgcat.x \ + src/msgcomm.c man/msgcomm.x \ + src/msgconv.c man/msgconv.x \ + src/msgen.c man/msgen.x \ + src/msgexec.c man/msgexec.x \ + src/msgfilter.c man/msgfilter.x \ + src/msggrep.c man/msggrep.x \ + src/msginit.c man/msginit.x \ + src/msguniq.c man/msguniq.x \ + src/recode-sr-latin.c man/recode-sr-latin.x + cd man \ + && $(MAKE) $(AM_MAKEFLAGS) \ + msgcmp.1 \ + msgfmt.1 \ + msgmerge.1 \ + msgunfmt.1 \ + xgettext.1 \ + msgattrib.1 \ + msgcat.1 \ + msgcomm.1 \ + msgconv.1 \ + msgen.1 \ + msgexec.1 \ + msgfilter.1 \ + msggrep.1 \ + msginit.1 \ + msguniq.1 \ + recode-sr-latin.1 + +# Ensure that the examples are up-to-date when "make dist" runs. +# Hidden from automake, but really activated. Works around an automake bug. +#distdir: distdir2 +.PHONY: distdir2 +distdir2: programs-for-distdir + cd misc && $(MAKE) $(AM_MAKEFLAGS) + cd examples && $(MAKE) $(AM_MAKEFLAGS) + + maintainer-update-po: $(top_builddir)/config.status $(SHELL) ./config.status --recheck $(SHELL) ./config.status po/Makefile.in po-directories diff --git a/gettext-tools/configure.ac b/gettext-tools/configure.ac index c864cddb8..56df96f00 100644 --- a/gettext-tools/configure.ac +++ b/gettext-tools/configure.ac @@ -582,7 +582,8 @@ AM_CONDITIONAL([TEST_SYSTEM_LIBINTL], [test $USE_INCLUDED_LIBINTL = no]) AC_CONFIG_SUBDIRS([examples]) -AC_CONFIG_FILES([Makefile]) +AC_CONFIG_FILES([Makefile], + [FIX_MAKEFILE_DISTRIB]) AC_CONFIG_FILES([doc/Makefile]) diff --git a/gettext-tools/src/Makefile.am b/gettext-tools/src/Makefile.am index 0316ca287..f51bb64dc 100644 --- a/gettext-tools/src/Makefile.am +++ b/gettext-tools/src/Makefile.am @@ -615,6 +615,11 @@ MAINTAINERCLEANFILES += cldr-plural.c cldr-plural.h EXTRA_DIST += cldr-plural.c cldr-plural.h +# This is implicit in "make all", but is needed explicitly before other target +# invocations. +built-sources: $(BUILT_SOURCES) + + # Special rules for installation of auxiliary programs. install-exec-local: