[Top][All Lists]

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

[FYI] {master} build: clearer diagnostic if "make" is invoked before "./

From: Stefano Lattarini
Subject: [FYI] {master} build: clearer diagnostic if "make" is invoked before "./configure"
Date: Thu, 16 Feb 2012 19:54:57 +0100

Since a GNUmakefile wrapper has been introduced in our build
system, a "make" invocation issued before a "./configure" one
has caused GNU make to die with the cryptic message:

  GNUmakefile:18: Makefile: No such file or directory
  GNUmakefile:19: / No such file or directory
  make: *** No rule to make target `/'.  Stop.

* GNUmakefile: Detect when we are being run from an unconfigured
tree, and give helpful diagnostic.
 GNUmakefile |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/GNUmakefile b/GNUmakefile
index 134e743..9d83dba 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -15,5 +15,14 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <>.
-include ./Makefile
-include $(srcdir)/
+# If the user runs GNU make but has not yet run ./configure,
+# give them an helpful diagnostic instead of a cryptic error.
+am--Makefile := $(wildcard Makefile)
+ifeq ($(am--Makefile),)
+  $(warning There seems to be no Makefile in this directory.)
+  $(warning You must run ./configure before running 'make'.)
+  $(error Fatal Error)
+  include ./Makefile
+  include $(srcdir)/

reply via email to

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