autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Generalize GNUmakefile, ...


From: Eric Blake
Subject: Re: [PATCH] Generalize GNUmakefile, ...
Date: Thu, 20 Mar 2008 07:19:56 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.12) Gecko/20080213 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Jim Meyering on 3/13/2008 4:44 PM:
| If consensus is for maint.mk, I'm happy to switch to that,
| assuming it's not too disruptive, otherwise.
| Far better to have only one such file name.

Here's stage 1 of the sync for coreutils.  The patch looks big, but that's
due to how 'git format-patch' handles renames.  Once gnulib is further
fixed to dump GNUmakefile into the top directory, stage 2 would be using
the gnulib module rather than synchronizing the files.

Hopefully, git format-patch -M did the right thing to the patch file to
pick up this rename:

Created commit 4aeb45a: Sync GNUmakefile with gnulib.
~ 7 files changed, 24 insertions(+), 22 deletions(-)
~ rename Makefile.cfg => cfg.mk (95%)
~ rename Makefile.maint => maint.mk (98%)

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

Eric Blake             address@hidden
-----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

iEYEARECAAYFAkfiZHwACgkQ84KuGfSFAYAiVgCeMvOF7+k4AZ5ETMxV+peU5eur
ZtAAn1a0GuwILg/i4v2K4tvVYqW6bJGR
=ZBfc
-----END PGP SIGNATURE-----
>From 4aeb45aad596186601feb4458e3705689069374f Mon Sep 17 00:00:00 2001
From: Eric Blake <address@hidden>
Date: Thu, 20 Mar 2008 06:58:25 -0600
Subject: [PATCH] Sync GNUmakefile with gnulib.

* GNUmakefile (Makefile.cfg): Rename...
(cfg.mk): ...to this, and make optional.
(GNUmakefile.cfg): Delete, redundant with cfg.mk.
(Makefile.maint): Rename...
(maint.mk): ...to this.
(all) [!_have-Makefile]: Rename...
(abort-due-to-no-makefile): ...to this, and invoke via
.DEFAULT_GOAL to pick up all targets.
* Makefile.cfg: Rename...
* cfg.mk: ...to this.
* Makefile.maint: Rename...
* maint.mk ...to this.
(ME): Reflect rename.
(makefile-check, m4-check, author_mark_check, msg): Use $(ME)
rather than hard-coded name.
* Makefile.am (EXTRA_DIST): Distribute renamed files.
* .x-sc_file_system: Reflect rename.
* .x-sc_obsolete_symbols: Likewise.
* TODO: Likewise.

Signed-off-by: Eric Blake <address@hidden>
---
 .x-sc_file_system          |    2 +-
 .x-sc_obsolete_symbols     |    2 +-
 GNUmakefile                |   24 +++++++++++++-----------
 Makefile.am                |    2 +-
 TODO                       |    4 ++--
 Makefile.cfg => cfg.mk     |    2 +-
 Makefile.maint => maint.mk |   10 +++++-----
 7 files changed, 24 insertions(+), 22 deletions(-)
 rename Makefile.cfg => cfg.mk (95%)
 rename Makefile.maint => maint.mk (98%)

diff --git a/.x-sc_file_system b/.x-sc_file_system
index a2e3887..07b9660 100644
--- a/.x-sc_file_system
+++ b/.x-sc_file_system
@@ -1,5 +1,5 @@
 ChangeLog
-Makefile.maint
+maint.mk
 NEWS
 config-log
 po/
diff --git a/.x-sc_obsolete_symbols b/.x-sc_obsolete_symbols
index a2fe831..d9e1eda 100644
--- a/.x-sc_obsolete_symbols
+++ b/.x-sc_obsolete_symbols
@@ -1,5 +1,5 @@
 ChangeLog*
-Makefile.maint
+maint.mk
 config.hin
 configure
 m4/jm-macros.m4
diff --git a/GNUmakefile b/GNUmakefile
index 8bbd6c8..fac11d3 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -1,11 +1,12 @@
 # Having a separate GNUmakefile lets me `include' the dynamically
-# generated rules created via Makefile.maint as well as Makefile.maint itself.
+# generated rules created via cfg.mk (package-local configuration)
+# as well as maint.mk (generic maintainer rules).
 # 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-2008 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
 # the Free Software Foundation, either version 3 of the License, or
@@ -29,10 +30,9 @@ else
 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.
+_have-Makefile := $(shell test -f Makefile && echo yes)
 ifeq ($(_have-Makefile),yes)
 
 # Make tar archive easier to reproduce.
@@ -41,7 +41,8 @@ export TAR_OPTIONS = --owner=0 --group=0 --numeric-owner
 include Makefile
 
 # Some projects override e.g., _autoreconf here.
--include $(srcdir)/GNUmakefile.cfg
+-include $(srcdir)/cfg.mk
+include $(srcdir)/maint.mk
 
 _autoreconf ?= autoreconf
 
@@ -60,18 +61,19 @@ ifeq (0,$(MAKELEVEL))
   endif
 endif
 
-include $(srcdir)/Makefile.cfg
-include $(srcdir)/Makefile.maint
-
 else
 
-all:
+.DEFAULT_GOAL := abort-due-to-no-makefile
+
+# The package can override .DEFAULT_GOAL to run actions like autoreconf.
+-include ./cfg.mk
+include ./maint.mk
+
+abort-due-to-no-makefile:
        @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
diff --git a/Makefile.am b/Makefile.am
index 2862940..e7fc118 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -16,7 +16,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 SUBDIRS = lib src doc man po tests gnulib-tests
-EXTRA_DIST = Makefile.cfg Makefile.maint GNUmakefile \
+EXTRA_DIST = cfg.mk maint.mk GNUmakefile \
   .prev-version THANKS-to-translators THANKStt.in \
   .version \
   .vg-suppressions \
diff --git a/TODO b/TODO
index 4e0b298..86320b9 100644
--- a/TODO
+++ b/TODO
@@ -142,11 +142,11 @@ Add a distcheck-time test to ensure that every distributed
 file is either read-only(indicating generated) or is
 version-controlled and up to date.
 
-remove `%s' notation (now that they're all gone, add a Makefile.maint sc_
+remove `%s' notation (now that they're all gone, add a maint.mk sc_
     rule to ensure no new ones are added):
   grep -E "\`%.{,4}s'" src/*.c
 
-remove all uses of the `register' keyword: Done.  add a Makefile.maint rule
+remove all uses of the `register' keyword: Done.  add a maint.mk rule
   for this, too.
 
 remove or adjust chown's --changes option, since it
diff --git a/Makefile.cfg b/cfg.mk
similarity index 95%
rename from Makefile.cfg
rename to cfg.mk
index 7ade521..49c2c48 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/Makefile.maint b/maint.mk
similarity index 98%
rename from Makefile.maint
rename to maint.mk
index c866cba..9f49b6e 100644
--- a/Makefile.maint
+++ b/maint.mk
@@ -19,7 +19,7 @@
 
 # This is reported not to work with make-3.79.1
 # ME := $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
-ME := Makefile.maint
+ME := maint.mk
 
 # Do not save the original name or timestamp in the .tar.gz file.
 # Use --rsyncable if available.
@@ -428,7 +428,7 @@ check-AUTHORS:
 # to emit a definition for each substituted variable.
 makefile-check:
        grep -nE '@[A-Z_0-9]+@' `find . -name Makefile.am` \
-         && { echo 'Makefile.maint: use $$(...), not @...@' 1>&2; exit 1; } || 
:
+         && { echo '$(ME): use $$(...), not @...@' 1>&2; exit 1; } || :
 
 news-date-check: NEWS
        today=`date +%Y-%m-%d`;                                         \
@@ -451,7 +451,7 @@ changelog-check:
 
 m4-check:
        @grep -n 'AC_DEFUN([^[]' 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; } || :
 
 # Verify that all source files using _() are listed in po/POTFILES.in.
@@ -484,7 +484,7 @@ po-check:
 # gettext recognizes it as a string requiring translation.
 author_mark_check:
        @grep -n '^# *define AUTHORS "[^"]* and ' src/*.c |grep -v ' N_ (' && \
-         { echo 'Makefile.maint: enclose the above strings in N_ (...)' 1>&2; \
+         { echo '$(ME): enclose the above strings in N_ (...)' 1>&2; \
            exit 1; } || :
 
 # Sometimes it is useful to change the PATH environment variable
@@ -493,7 +493,7 @@ author_mark_check:
 # It'd be better to use `find -print0 ...|xargs -0 ...', but less portable,
 # and there probably aren't many projects with so many Makefile.am files
 # that we'd have to worry about limits on command line length.
-msg = 'Makefile.maint: Do not use `:'\'' above; use @PATH_SEPARATOR@ instead'
+msg = '$(ME): Do not use `:'\'' above; use @PATH_SEPARATOR@ instead'
 makefile_path_separator_check:
        @grep -n 'PATH=.*:' `find $(srcdir) -name Makefile.am` \
          && { echo $(msg) 1>&2; exit 1; } || :
-- 
1.5.4


reply via email to

[Prev in Thread] Current Thread [Next in Thread]