bug-gnulib
[Top][All Lists]
Advanced

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

Re: maint.mk questions


From: Eric Blake
Subject: Re: maint.mk questions
Date: Fri, 24 Apr 2009 18:18:29 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Jim Meyering <jim <at> meyering.net> writes:

> > spotted this one quickly in the diff:
> >
> > -news-date-check: NEWS version-check
> > +news-date-check: NEWS
> 
> Did you mean to make news-date-check depend on version-check?

With m4, I remember being frustrated that 'make alpha' took forever to run, 
only to find out at the very end that the version was incorrect or unspecified, 
and wanted to spare myself some frustrations by hoisting that earlier.  So I 
also had:

-alpha beta major: $(local-check) version-check
...
-.PHONY: version-check
-version-check:
-   @case $(VERSION) in \
-   *[acegikmoqsuwy]) \
-     echo "Version \`$(VERSION)' is not a releasable version, please read:"; \
-     echo "    http://www.gnu.org/software/libtool/contribute.html";; \
-     exit 1; \
-     ;; \
-   esac
-   @if test -z "$(PREV_VERSION)"; \
-           then echo "PREV_VERSION is not set"; exit 1; fi

But that was also with the expectation of running 'make major 
PREV_VERSION=1.4.12' rather than the (nicer) use of .prev-version taken care of 
by the current state of maint.mk.  So it is probably unnecessary to have a 
version-check rule in gnulib's maint.mk.


> > Oh, and the --bootstrap-tools had better be something specified by cfg.mk, 
as
> > m4 does not want bison in the list.
> 
> Good idea.
> If you do this, please add something in maint.mk
> to ensure that the variable is defined.

In the patch below, I went with bootstrap_tools ?= automake,autoconf,gnulib

since the use of gnulib's maintainer-makefile guarantees those three.  Or did 
you want make to actually error out if cfg.mk doesn't specify a variable?

> Maybe we can just remove it.
> I see there is no longer any use of move.if.change in coreutils.

Done.  And no heartburn about dropping delta generation.

> 
> If you feel like preparing a patch for the above, that'd be great.

How about the following?  I've tested that a VPATH m4 build using this patch at 
least gets started on 'make syntax-check' (although I'm now having to edit 
local-checks-to-skip and add .x-sc_ files to skip files like config.guess).  I 
would also need to provide a followup patch to coreutils' cfg.mk.

In the case of m4, I've got a gnulib submodule, so I created a git symlink from 
my build-aux/config.guess into gnulib's copy.  Coreutils doesn't fail the 
sc_space_tab check because config.guess is not under version control (rather, 
it is copied into place during bootstrap), but because m4 maintains it as a 
symlink under version control, VC_LIST thinks it needs to be checked for 
syntax, even though it is an upstream file not subject to the same rules.  
Would it be worth changing vc-list-files to not follow git symlinks, 
particularly if those symlinks point into git submodules?


From: Eric Blake <address@hidden>
Date: Fri, 24 Apr 2009 10:54:03 -0600
Subject: [PATCH] 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): Likewise for vc-list-files module.  Support VPATH
builds.

Signed-off-by: Eric Blake <address@hidden>
---
 ChangeLog    |   16 +++++++++++++++-
 top/maint.mk |   37 ++++++++++++++++++-------------------
 2 files changed, 33 insertions(+), 20 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 0481cbc..05d0f73 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2009-04-24  Eric Blake  <address@hidden>
+
+       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): Likewise for vc-list-files module.  Support VPATH
+       builds.
+
 2009-04-24  Simon Josefsson  <address@hidden>

        * top/maint.mk (makefile-check): Renamed to sc_makefile_check for
diff --git a/top/maint.mk b/top/maint.mk
index 1c6e87b..947d7ae 100644
--- a/top/maint.mk
+++ b/top/maint.mk
@@ -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,11 +27,12 @@ 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
@@ -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 || :
+       (CDPATH=; cd $(srcdir) && $(VC) diff) > vc-diffs || :
        if test -s vc-diffs; then                               \
          cat vc-diffs;                                         \
          echo "Some files are locally modified:" 1>&2;         \
@@ -685,13 +686,13 @@ define my-instcheck
     && test ! -f $(pfx)/bin/ginstall                   \
     && { fail=0;                                       \
       for i in $(built_programs); do                   \
-        test "$$i" = ginstall && i=install;            \
-        for j in "$(pfx)/bin/$$i"                      \
-                 "$(pfx)/share/man/man1/$$i.1"; do     \
-          case $$j in *'[.1') continue;; esac;         \
-          test -f "$$j" && :                           \
-            || { echo "$$j not installed"; fail=1; };  \
-        done;                                          \
+       test "$$i" = ginstall && i=install;             \
+       for j in "$(pfx)/bin/$$i"                       \
+                "$(pfx)/share/man/man1/$$i.1"; do      \
+         case $$j in *'[.1') continue;; esac;          \
+         test -f "$$j" && :                            \
+           || { echo "$$j not installed"; fail=1; };   \
+       done;                                           \
       done;                                            \
       test $$fail = 1 && exit 1 || :;                  \
     }
@@ -777,16 +778,17 @@ rel-check:
 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))
@@ -798,9 +800,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 =====================================
-- 
1.6.1.2








reply via email to

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