sync GNUmakefile with gnulib

Eric Blake <[email protected]>
Newsgroups gmane.comp.gnu.m4.patches
Message-ID <[email protected]>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Now that gnulib finally provides a decent module for GNUmakefile, I'll use
it.  I'm not quite ready to synchronize maint.mk with gnulib, so I'm
intentionally not pulling in the maintainer-makefile module yet.  (And I'm
still waiting for git 1.5.5 to come out before I can make the master
branch use git-version-gen, because it needs 'git describe --match "v*"').

- --
Don't work too hard, make some time for fun as well!

Eric Blake             [email protected]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkfnl8QACgkQ84KuGfSFAYBZNwCffpEon2buIi7PmN/n2VwbXAPr
+oYAoMPNMba3hGEF0tPS0g7nfPLEFirA
=04tg
-----END PGP SIGNATURE-----

_______________________________________________
M4-patches mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/m4-patches
m4.patch332 (text/plain, 11.9 KB)
From 5adf9c383dd56c648aade9521e312d2c1f61b2a2 Mon Sep 17 00:00:00 2001
From: Eric Blake <[email protected]>
Date: Fri, 21 Mar 2008 07:05:54 -0600
Subject: [PATCH] Pull GNUmakefile from gnulib.

* m4/gnulib-cache.m4: Import gnumakefile module.
* GNUmakefile: Remove from version control; supplied by gnulib
instead.
* configure.ac (AC_CONFIG_LINKS): Let gnulib do this now.
* Makefile.am (distclean-local): Likewise.
(EXTRA_DIST): Likewise.  Also handle renamed files.
* Makefile.cfg: Rename...
* cfg.mk: ...to this.
* Makefile.maint: Rename...
* maint.mk: ...to this.
(ME, makefile-check, m4-check): Use new macro instead of
hard-coded name.
* HACKING: Mention that maintainer rules should now work in VPATH
builds.

Signed-off-by: Eric Blake <[email protected]>
---
 .cvsignore                 |    1 +
 .gitignore                 |    1 +
 ChangeLog                  |   18 ++++++++++
 GNUmakefile                |   80 --------------------------------------------
 HACKING                    |    5 +--
 Makefile.am                |    7 +---
 Makefile.cfg => cfg.mk     |    2 +-
 configure.ac               |   14 --------
 m4/gnulib-cache.m4         |    4 +-
 Makefile.maint => maint.mk |   10 ++++--
 10 files changed, 32 insertions(+), 110 deletions(-)
 delete mode 100644 GNUmakefile
 rename Makefile.cfg => cfg.mk (95%)
 rename Makefile.maint => maint.mk (95%)

diff --git a/.cvsignore b/.cvsignore
index ecbb873..8fc44d6 100644
--- a/.cvsignore
+++ b/.cvsignore
@@ -30,3 +30,4 @@ stamp-h
 stamp-h1
 stamp-h.in
 tests
+GNUmakefile
diff --git a/.gitignore b/.gitignore
index ff3c4c8..b581eac 100644
--- a/.gitignore
+++ b/.gitignore
@@ -34,3 +34,4 @@ stamp-h
 stamp-h1
 stamp-h.in
 tests
+GNUmakefile
diff --git a/ChangeLog b/ChangeLog
index 49f9b80..d8fc94a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2008-03-24  Eric Blake  <[email protected]>
+
+	Pull GNUmakefile from gnulib.
+	* m4/gnulib-cache.m4: Import gnumakefile module.
+	* GNUmakefile: Remove from version control; supplied by gnulib
+	instead.
+	* configure.ac (AC_CONFIG_LINKS): Let gnulib do this now.
+	* Makefile.am (distclean-local): Likewise.
+	(EXTRA_DIST): Likewise.  Also handle renamed files.
+	* Makefile.cfg: Rename...
+	* cfg.mk: ...to this.
+	* Makefile.maint: Rename...
+	* maint.mk: ...to this.
+	(ME, makefile-check, m4-check): Use new macro instead of
+	hard-coded name.
+	* HACKING: Mention that maintainer rules should now work in VPATH
+	builds.
+
 2008-03-19  Eric Blake  <[email protected]>
 
 	Stage 20: make m4wrap obey POSIX fifo ordering.
diff --git a/GNUmakefile b/GNUmakefile
deleted file mode 100644
index ac70f63..0000000
--- a/GNUmakefile
+++ /dev/null
@@ -1,80 +0,0 @@
-# Having a separate GNUmakefile lets me `include' both Makefile.maint
-# and Makefile.
-# This makefile is used only if you run GNU Make.
-# It is necessary if you want to build targets usually of interest
-# only to the maintainer.
-
-# Copyright (C) 2001, 2003, 2006, 2007, 2008 Free Software Foundation,
-# Inc.
-#
-# This file is part of GNU M4.
-#
-# GNU M4 is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# GNU M4 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 General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-# Systems where /bin/sh is not the default shell need this.  The $(shell)
-# command below won't work with e.g. stock DOS/Windows shells.
-ifeq ($(wildcard /bin/s[h]),/bin/sh)
-SHELL = /bin/sh
-else
-# will be used only with the next shell-test line, then overwritten
-# by a configured-in value
-SHELL = sh
-endif
-
-_have-Makefile := $(shell test -f Makefile && echo yes)
-
-# If the user runs GNU make but has not yet run ./configure,
-# give them a diagnostic.
-ifeq ($(_have-Makefile),yes)
-
-# Make tar archive easier to reproduce.
-export TAR_OPTIONS = --owner=0 --group=0 --numeric-owner
-
-include Makefile
-
-_curr-ver := $(VERSION)
-
-# Ensure that $(VERSION) is up to date for dist-related targets, but not
-# for others: running autoreconf and recompiling everything isn't cheap.
-ifeq (0,$(MAKELEVEL))
-  _is-dist-target = $(filter-out %clean, \
-    $(filter dist% alpha beta major,$(MAKECMDGOALS)))
-  ifneq (,$(_is-dist-target))
-    _curr-ver := $(shell cd $(srcdir) && build-aux/git-version-gen \
-		   $(srcdir)/.tarball-version)
-    ifneq ($(_curr-ver),$(VERSION))
-      $(info INFO: running autoreconf for new version string: $(_curr-ver))
-      _dummy := $(shell (cd $(srcdir) && rm -rf autom4te.cache && autoreconf))
-    endif
-  endif
-endif
-
-include $(srcdir)/Makefile.cfg
-include $(srcdir)/Makefile.maint
-
-else
-
-all:
-	@echo There seems to be no Makefile in this directory.   1>&2
-	@echo "You must run ./configure before running \`make'." 1>&2
-	@exit 1
-
-check dist distcheck install: all
-
-endif
-
-# Tell version 3.79 and up of GNU make to not build goals in this
-# directory in parallel.  This is necessary in case someone tries to
-# build multiple targets on one command line.
-.NOTPARALLEL:
diff --git a/HACKING b/HACKING
index f42ffb4..b365923 100644
--- a/HACKING
+++ b/HACKING
@@ -203,10 +203,7 @@ yyyy-mm-dd  Name of Author  <email@address>  (tiny change)
 
 * Run ./bootstrap.
 
-* Run ./configure (a VPATH build is not recommended, since several
-  targets in GNUMakefile and Makefile.maint assume an in-tree build for
-  distribution purposes.  Normal builds do not suffer from this
-  restriction, and make distcheck ensures VPATH still works).
+* Run ./configure (a VPATH build should work, but is less tested).
 
 * Run `make'.  The file doc/m4.1 needs to exist for a distribution, and
   be up-to-date with m4 --help output, but `make dist' intentionally
diff --git a/Makefile.am b/Makefile.am
index b12f710..81ea47e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -21,7 +21,7 @@
 ## Written by Gary V. Vaughan <[email protected]>
 
 SUBDIRS = . examples lib src doc tests checks
-EXTRA_DIST = bootstrap c-boxes.el GNUmakefile Makefile.cfg Makefile.maint \
+EXTRA_DIST = bootstrap c-boxes.el cfg.mk maint.mk \
 	.version m4/gnulib-cache.m4
 DISTCLEANFILES = stamp-h
 ## maintainer-clean should remove as much as possible that ./bootstrap can
@@ -42,8 +42,3 @@ BUILT_SOURCES = .version
 # tarball, and never in a checked-out repository.
 dist-hook:
 	echo $(VERSION) > $(distdir)/.tarball-version
-
-# Arrange to remove the symlink to GNUmakefile in VPATH builds.
-# TODO remove this once automake vs. AC_CONFIG_LINKS issue is fixed.
-distclean-local:
-	if test x"$(VPATH)" != x ; then rm -f GNUmakefile ; fi
diff --git a/Makefile.cfg b/cfg.mk
similarity index 95%
rename from Makefile.cfg
rename to cfg.mk
index 77680c9..142980f 100644
--- a/Makefile.cfg
+++ b/cfg.mk
@@ -1,4 +1,4 @@
-# Customize Makefile.maint.                           -*- makefile -*-
+# Customize maint.mk.                           -*- makefile -*-
 # Copyright (C) 2003-2008 Free Software Foundation, Inc.
 
 # This program is free software: you can redistribute it and/or modify
diff --git a/configure.ac b/configure.ac
index aa1f32e..990c8f6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -162,20 +162,6 @@ M4_WITH_DMALLOC
 
 AC_CONFIG_COMMANDS([stamp-h], [[test -z "$CONFIG_HEADERS" || date > stamp-h]])
 
-dnl Allow maintainer rules under GNU make even in VPATH builds.  This does
-dnl not work in autoconf 2.61 or earlier, but we don't want to require
-dnl non-maintainers to use unreleased autoconf, hence the version test.
-dnl TODO remove the version check once autoconf 2.62 is released.
-dnl Meanwhile, we must use a shell variable so that we bypass automake's
-dnl attempts to remove the sole copy of GNUmakefile in a non-VPATH build
-dnl during 'make distclean'.
-dnl TODO avoid the shell variable once automake is fixed.
-GNUmakefile=GNUmakefile
-m4_if(m4_version_compare([2.61a.100],
-	m4_defn([m4_PACKAGE_VERSION])), [1], [],
-      [AC_CONFIG_LINKS([$GNUmakefile:$GNUmakefile], [],
-	[GNUmakefile=$GNUmakefile])])
-
 AC_CONFIG_FILES([Makefile
 		 doc/Makefile
 		 lib/Makefile
diff --git a/m4/gnulib-cache.m4 b/m4/gnulib-cache.m4
index 669b011..14ec2a6 100644
--- a/m4/gnulib-cache.m4
+++ b/m4/gnulib-cache.m4
@@ -15,11 +15,11 @@
 
 
 # Specification in the form of a command-line invocation:
-#   gnulib-tool --import --dir=. --local-dir=local --lib=libm4 --source-base=lib --m4-base=m4 --doc-base=doc --aux-dir=build-aux --with-tests --no-libtool --macro-prefix=M4 announce-gen assert avltree-oset binary-io clean-temp cloexec close-stream closein config-h error fdl fflush flexmember fopen-safer fseeko gendocs getopt git-version-gen gnupload gpl-3.0 intprops memchr2 memmem mkstemp obstack quote regex stdbool stdint stdlib-safer strtod strtol unlocked-io vasnprintf-posix verror version-etc version-etc-fsf xalloc xprintf xvasprintf-posix
+#   gnulib-tool --import --dir=. --local-dir=local --lib=libm4 --source-base=lib --m4-base=m4 --doc-base=doc --aux-dir=build-aux --with-tests --no-libtool --macro-prefix=M4 announce-gen assert avltree-oset binary-io clean-temp cloexec close-stream closein config-h error fdl fflush flexmember fopen-safer fseeko gendocs getopt git-version-gen gnumakefile gnupload gpl-3.0 intprops memchr2 memmem mkstemp obstack quote regex stdbool stdint stdlib-safer strtod strtol unlocked-io vasnprintf-posix verror version-etc version-etc-fsf xalloc xprintf xvasprintf-posix
 
 # Specification in the form of a few gnulib-tool.m4 macro invocations:
 gl_LOCAL_DIR([local])
-gl_MODULES([announce-gen assert avltree-oset binary-io clean-temp cloexec close-stream closein config-h error fdl fflush flexmember fopen-safer fseeko gendocs getopt git-version-gen gnupload gpl-3.0 intprops memchr2 memmem mkstemp obstack quote regex stdbool stdint stdlib-safer strtod strtol unlocked-io vasnprintf-posix verror version-etc version-etc-fsf xalloc xprintf xvasprintf-posix])
+gl_MODULES([announce-gen assert avltree-oset binary-io clean-temp cloexec close-stream closein config-h error fdl fflush flexmember fopen-safer fseeko gendocs getopt git-version-gen gnumakefile gnupload gpl-3.0 intprops memchr2 memmem mkstemp obstack quote regex stdbool stdint stdlib-safer strtod strtol unlocked-io vasnprintf-posix verror version-etc version-etc-fsf xalloc xprintf xvasprintf-posix])
 gl_AVOID([])
 gl_SOURCE_BASE([lib])
 gl_M4_BASE([m4])
diff --git a/Makefile.maint b/maint.mk
similarity index 95%
rename from Makefile.maint
rename to maint.mk
index 2e80845..c9b51d8 100644
--- a/Makefile.maint
+++ b/maint.mk
@@ -1,4 +1,4 @@
-## Makefile.maint -- Makefile rules for m4 maintainers -*-Makefile-*-
+## maint.mk -- Makefile rules for m4 maintainers -*-Makefile-*-
 ##
 ## Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation
 ##
@@ -17,6 +17,10 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+# This is reported not to work with make-3.79.1
+# ME := $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
+ME := maint.mk
+
 # Do not save the original name or timestamp in the .tar.gz file.
 # Use --rsyncable if available.
 gzip_rsyncable := \
@@ -43,7 +47,7 @@ my_distdir = $(PACKAGE)-$(VERSION)
 # to emit a definition for each substituted variable.
 makefile-check:
 	grep -nE '@[A-Z_0-9]+@' `find $(srcdir) -name Makefile.am` \
-	  && { echo 'Makefile.maint: use $$(...), not @...@' 1>&2; exit 1; } || :
+	  && { echo '$(ME): use $$(...), not @...@' 1>&2; exit 1; } || :
 
 news-date-check: NEWS version-check
 	today=`date +%Y-%m-%d`;						\
@@ -66,7 +70,7 @@ changelog-check:
 
 m4-check:
 	@grep -n 'AC_DEFUN([^[]' $(srcdir)/m4/*.m4 \
-	  && { echo 'Makefile.maint: quote the first arg to AC_DEFUN' 1>&2; \
+	  && { echo '$(ME): quote the first arg to AC_DEFUN' 1>&2; \
 	       exit 1; } || :
 
 vc-diff-check:
-- 
1.5.4
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.