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 <ebl...@redhat.com> --- 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 <ebl...@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 <bdwal...@gmail.com> 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