From 2c4e3ce9dc521699ca9a20c0bec135f491f1412c Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Tue, 11 Nov 2008 10:19:42 -0600 Subject: [PATCH] check that the makefile exists and stop if it doesnt --- build-support/factor.sh | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/build-support/factor.sh b/build-support/factor.sh index bd234afb5f..8d75b8cff2 100755 --- a/build-support/factor.sh +++ b/build-support/factor.sh @@ -176,7 +176,7 @@ find_os() { *FreeBSD*) OS=freebsd;; *OpenBSD*) OS=openbsd;; *DragonFly*) OS=dragonflybsd;; - SunOS) OS=solaris;; + SunOS) OS=solaris;; esac } @@ -264,7 +264,7 @@ check_os_arch_word() { $ECHO "WORD: $WORD" $ECHO "OS, ARCH, or WORD is empty. Please report this." - echo $MAKE_TARGET + echo $MAKE_TARGET exit 5 fi } @@ -339,9 +339,21 @@ cd_factor() { check_ret cd } +check_makefile_exists() { + if [[ ! -e "Makefile" ]] ; then + echo "" + echo "***Makefile not found***" + echo "You are likely in the wrong directory." + echo "Run this script from your factor directory:" + echo " ./build-support/factor.sh" + exit 6 + fi +} + invoke_make() { - $MAKE $MAKE_OPTS $* - check_ret $MAKE + check_makefile_exists + $MAKE $MAKE_OPTS $* + check_ret $MAKE } make_clean() {