]> Savannah Git Hosting - gnulib.git/commitdiff
maintainer-makefile: avoid spurious error messages
authorEric Blake <eblake@redhat.com>
Wed, 4 Jun 2014 18:52:33 +0000 (12:52 -0600)
committerEric Blake <eblake@redhat.com>
Wed, 4 Jun 2014 19:07:49 +0000 (13:07 -0600)
Ever since commit 3f51bf41, we are leaving garbage in the console
if a user executes commands without first running configure, as
shown in the following pseudo-transcript:

$ git clone $sv/coreutils.git
$ cd coreutils
$ ./bootstrap
$ make
make: -n: Command not found
There seems to be no Makefile in this directory.
You must run ./configure before running 'make'.
make: *** [abort-due-to-no-makefile] Error 1

The first line stems from the fact that we have a $(shell $(SED) -n)
use, which gets unconditionally executed even though $(SED) is only
guaranteed to be defined if Makefile was included.  We also end up
trying to invoke /vc-list-files to compute the set of syntax check
rules to run due to a $(shell $(VC_LIST)), even though that file
likely doesn't exist in the root directory, but where the error
message was squelched.  Since we already have the nice hooks in
place to remind the user they haven't created Makefile yet, and
since 'make syntax-check' makes no sense without a Makefile, it is
easier to just avoid $(shell) computations of internal state
associated with syntax check, by using the same conditional as
GNUmakefile in determining if Makefile exists.

* top/maint.mk (syntax-check): Guard definition and use of
$(shell) by whether Makefile is present.

Signed-off-by: Eric Blake <eblake@redhat.com>
ChangeLog
top/maint.mk

index b08418164b77000ab79f246cf18ad4714ef2689b..27e8256d7a5b64a32309fb9ccca589f7998232a7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2014-06-04  Eric Blake  <eblake@redhat.com>
+
+       maintainer-makefile: avoid spurious error messages
+       * top/maint.mk (syntax-check): Guard definition and use of
+       $(shell) by whether Makefile is present.
+
 2014-06-03  Ben Walton  <bdwalton@gmail.com>
 
        rename: avoid unused-but-set-variable compiler warning
index b6cd5a2031c9469cac717687e35ff0482c63f009..2e1bae63257f3f3a414ac6bc637cba928437143a 100644 (file)
@@ -155,6 +155,7 @@ export LC_ALL = C
 ## Sanity checks.  ##
 ## --------------- ##
 
+ifneq ($(_gl-Makefile),)
 _cfg_mk := $(wildcard $(srcdir)/cfg.mk)
 
 # Collect the names of rules starting with 'sc_'.
@@ -196,6 +197,7 @@ local-check :=                                                              \
     $(filter-out $(local-checks-to-skip), $(local-checks-available)))
 
 syntax-check: $(local-check)
+endif
 
 # _sc_search_regexp
 #