bug-gnulib
[Top][All Lists]
Advanced

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

Re: GNUmakefile and maintainer-distcheck


From: Eric Blake
Subject: Re: GNUmakefile and maintainer-distcheck
Date: Thu, 3 Apr 2008 20:07:40 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Eric Blake <ebb9 <at> byu.net> writes:

> 
> In preparing autoconf 2.62, I noticed that 'make distcheck' triggered a 
version 
> update, but not the more extensive 'make maintainer-distcheck'.  Fixed as 
> follows.

Another GNUmakefile tweak.  It turns out that GNU make only 
honors .DEFAULT_GOAL if $(MAKECMDGOALS) is empty.  The patch was a bit tricky, 
since setting MAKECMDGOALS is documented to not alter make behavior.  However, 
it IS possible to alter make behavior by adding additional dependencies.

Additionally, in packages where maint.mk is VPATH aware, it is nice to set 
$(srcdir) when Makefile is not present.

Before this patch, un-configured autoconf issued spurious complaints (due to 
$(srcdir) being empty), and didn't behave nicely when given a target:

$ make
cat: /.prev-version: No such file or directory
sed: can't read /maint.mk: No such file or directory
There seems to be no Makefile in this directory.
You must run ./configure before running `make'.
make: *** [abort-due-to-no-makefile] Error 1
$ make pdf
cat: /.prev-version: No such file or directory
sed: can't read /maint.mk: No such file or directory
make: *** No rule to make target `pdf'.  Stop.

After the patch everything is well-behaved:

$ make
There seems to be no Makefile in this directory.
You must run ./configure before running `make'.
make: *** [abort-due-to-no-makefile] Error 1
$ make pdf
There seems to be no Makefile in this directory.
You must run ./configure before running `make'.
make: *** [abort-due-to-no-makefile] Error 1

>From 95002d80002acb26000b3c20a2e1a3db929628ae Mon Sep 17 00:00:00 2001
From: Eric Blake <address@hidden>
Date: Thu, 3 Apr 2008 14:03:49 -0600
Subject: [PATCH] Make GNU make output nicer.

* top/GNUmakefile [!_have-Makefile]: Add dependency on
MAKECMDGOALS to enforce message for all command line targets.  Set
srcdir for use in maint.mk.

Signed-off-by: Eric Blake <address@hidden>
---
 ChangeLog       |    5 +++++
 top/GNUmakefile |    5 +++++
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 3073092..9f68c74 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2008-04-03  Eric Blake  <address@hidden>
 
+       Make GNU make output nicer.
+       * top/GNUmakefile [!_have-Makefile]: Add dependency on
+       MAKECMDGOALS to enforce message for all command line targets.  Set
+       srcdir for use in maint.mk.
+
        Another maintainer tweak.
        * top/GNUmakefile (_is-dist-target): Allow maintainer-distcheck as
        a target that regenerates version.
diff --git a/top/GNUmakefile b/top/GNUmakefile
index 42d7d12..bba6243 100644
--- a/top/GNUmakefile
+++ b/top/GNUmakefile
@@ -68,11 +68,16 @@ endif
 else
 
 .DEFAULT_GOAL := abort-due-to-no-makefile
+srcdir = .
 
 # The package can override .DEFAULT_GOAL to run actions like autoreconf.
 -include ./cfg.mk
 include ./maint.mk
 
+ifeq ($(.DEFAULT_GOAL),abort-due-to-no-makefile)
+$(MAKECMDGOALS): abort-due-to-no-makefile
+endif
+
 abort-due-to-no-makefile:
        @echo There seems to be no Makefile in this directory.   1>&2
        @echo "You must run ./configure before running \`make'." 1>&2
-- 
1.5.4







reply via email to

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