maint.mk: import improvements from m4
authorEric Blake <ebb9@byu.net>
Fri, 24 Apr 2009 20:57:01 +0000 (14:57 -0600)
committerEric Blake <ebb9@byu.net>
Sat, 25 Apr 2009 02:10:25 +0000 (20:10 -0600)
* top/maint.mk (VC-tag): Use signing key from cfg.mk.
(move_if_change): Delete unused macro.
(news-date-check, vc-diff-check): Support VPATH builds.
(announcement): Likewise.  Split --bootstrap-tools list...
(boostrap-tools): ...into separate list, which can be overridden
in cfg.mk.
(sc_avoid_if_before_free): Point to $(gnulib_dir), rather than
requiring dependency on useless-if-before-free module.
(VC_LIST, VC_LIST_EXCEPT): Likewise for vc-list-files module.
Support VPATH builds.

Signed-off-by: Eric Blake <ebb9@byu.net>
ChangeLog
top/maint.mk

index 94d42bb..0083daf 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2009-04-24  Eric Blake  <ebb9@byu.net>
+
+       maint.mk: import improvements from m4
+       * top/maint.mk (VC-tag): Use signing key from cfg.mk.
+       (move_if_change): Delete unused macro.
+       (news-date-check, vc-diff-check): Support VPATH builds.
+       (announcement): Likewise.  Split --bootstrap-tools list...
+       (boostrap-tools): ...into separate list, which can be overridden
+       in cfg.mk.
+       (sc_avoid_if_before_free): Point to $(gnulib_dir), rather than
+       requiring dependency on useless-if-before-free module.
+       (VC_LIST, VC_LIST_EXCEPT): Likewise for vc-list-files module.
+       Support VPATH builds.
+
 2009-04-24  Jim Meyering  <meyering@redhat.com>
 
        maint.mk: remove coreutils-specific rules and variables
@@ -27,7 +41,7 @@
        * NEWS: Explain incompatibilities.
 
 2009-04-22  Yoann Vandoorselaere  <yoann.v@prelude-ids.com>
-            Bruno Haible  <bruno@clisp.org>
+           Bruno Haible  <bruno@clisp.org>
 
        Fix cross-compilation results.
        * m4/btowc.m4 (gl_FUNC_BTOWC): Use no-op statement, rather than empty
index fc72d11..9a683a7 100644 (file)
@@ -1,6 +1,6 @@
 # -*-Makefile-*-
 # This Makefile fragment tries to be general-purpose enough to be
-# used by at least coreutils, idutils, CPPI, Bison, and Autoconf.
+# used by many projects via the gnulib maintainer-makefile module.
 
 ## Copyright (C) 2001-2009 Free Software Foundation, Inc.
 ##
@@ -27,14 +27,15 @@ gzip_rsyncable := \
   $(shell gzip --help 2>/dev/null|grep rsyncable >/dev/null && echo --rsyncable)
 GZIP_ENV = '--no-name --best $(gzip_rsyncable)'
 
+# cfg.mk must define the gpg_key_ID used by this package.
 GIT = git
 VC = $(GIT)
-VC-tag = git tag -s -m '$(VERSION)'
+VC-tag = git tag -s -m '$(VERSION)' -u '$(gpg_key_ID)'
 
-VC_LIST = $(srcdir)/build-aux/vc-list-files
+VC_LIST = $(gnulib_dir)/build-aux/vc-list-files -C $(srcdir)
 
 VC_LIST_EXCEPT = \
-  $(VC_LIST) | if test -f .x-$@; then grep -vEf .x-$@; else grep -v ChangeLog; fi
+  $(VC_LIST) | if test -f $(srcdir)/.x-$@; then grep -vEf $(srcdir)/.x-$@; else grep -v ChangeLog; fi
 
 ifeq ($(origin prev_version_file), undefined)
   prev_version_file = $(srcdir)/.prev-version
@@ -68,7 +69,7 @@ export LC_ALL = C
 
 # Collect the names of rules starting with `sc_'.
 syntax-check-rules := $(shell sed -n 's/^\(sc_[a-zA-Z0-9_-]*\):.*/\1/p' \
-                        $(srcdir)/$(ME) $(srcdir)/cfg.mk)
+                       $(srcdir)/$(ME) $(srcdir)/cfg.mk)
 .PHONY: $(syntax-check-rules)
 
 local-checks-available = \
@@ -110,7 +111,7 @@ define _prohibit_regexp
 endef
 
 sc_avoid_if_before_free:
-       @$(srcdir)/build-aux/useless-if-before-free                     \
+       @$(gnulib_dir)/build-aux/useless-if-before-free                 \
                $(useless_free_options)                                 \
            $$($(VC_LIST_EXCEPT)) &&                                    \
          { echo '$(ME): found useless "if" before "free" above' 1>&2;  \
@@ -495,7 +496,7 @@ sc_makefile_check:
 
 news-date-check: NEWS
        today=`date +%Y-%m-%d`;                                         \
-       if head NEWS | grep '^\*.* $(VERSION_REGEXP) ('$$today')'       \
+       if head $(srcdir)/NEWS | grep '^\*.* $(VERSION_REGEXP) ('$$today')' \
            >/dev/null; then                                            \
          :;                                                            \
        else                                                            \
@@ -593,7 +594,7 @@ sc_copyright_check:
        fi
 
 vc-diff-check:
-       $(VC) diff > vc-diffs || :
+       (unset CDPATH; cd $(srcdir) && $(VC) diff) > vc-diffs || :
        if test -s vc-diffs; then                               \
          cat vc-diffs;                                         \
          echo "Some files are locally modified:" 1>&2;         \
@@ -631,16 +632,17 @@ built_programs = $$(cd src && MAKEFLAGS= $(MAKE) -s built_programs.list)
 rel-files = $(DIST_ARCHIVES)
 
 gnulib-version = $$(cd $(gnulib_dir) && git describe)
+bootstrap-tools ?= autoconf,automake,gnulib
 
 announcement: NEWS ChangeLog $(rel-files)
-       @./build-aux/announce-gen                                       \
+       @$(srcdir)/build-aux/announce-gen                               \
            --release-type=$(RELEASE_TYPE)                              \
            --package=$(PACKAGE)                                        \
            --prev=$(PREV_VERSION)                                      \
            --curr=$(VERSION)                                           \
            --gpg-key-id=$(gpg_key_ID)                                  \
            --news=NEWS                                                 \
-           --bootstrap-tools=autoconf,automake,bison,gnulib            \
+           --bootstrap-tools=$(bootstrap-tools)                        \
            --gnulib-version=$(gnulib-version)                          \
            --no-print-checksums                                        \
            $(addprefix --url-dir=, $(url_dir_list))
@@ -652,9 +654,6 @@ announcement: NEWS ChangeLog $(rel-files)
 ftp-gnu = ftp://ftp.gnu.org/gnu
 www-gnu = http://www.gnu.org
 
-# Use mv, if you don't have/want move-if-change.
-move_if_change ?= move-if-change
-
 emit_upload_commands:
        @echo =====================================
        @echo =====================================