bug-gnulib
[Top][All Lists]
Advanced

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

[PATCH 1/2] maintainer-makefile: avoid spurious error messages


From: Eric Blake
Subject: [PATCH 1/2] maintainer-makefile: avoid spurious error messages
Date: Wed, 4 Jun 2014 13:13:21 -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 <address@hidden>
---
 ChangeLog    | 6 ++++++
 top/maint.mk | 2 ++
 2 files changed, 8 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index b084181..27e8256 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2014-06-04  Eric Blake  <address@hidden>
+
+       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  <address@hidden>

        rename: avoid unused-but-set-variable compiler warning
diff --git a/top/maint.mk b/top/maint.mk
index b6cd5a2..2e1bae6 100644
--- a/top/maint.mk
+++ b/top/maint.mk
@@ -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
 #
-- 
1.9.3




reply via email to

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