check return status of make basics
authorGengbin Zheng <gzheng@illinois.edu>
Sat, 31 Jan 2009 05:46:59 +0000 (05:46 +0000)
committerGengbin Zheng <gzheng@illinois.edu>
Sat, 31 Jan 2009 05:46:59 +0000 (05:46 +0000)
build

diff --git a/build b/build
index 531417c14e40ef670f89fde88a5882ea04998a7b..65d77d7fd70baa0dac267bc90d76c510cd7e3ab4 100755 (executable)
--- a/build
+++ b/build
@@ -545,11 +545,23 @@ then
   PROGRAM="$PROGRAM bigsim"
 fi
 
+printError()
+{
+       echo "-------------------------------------------------"
+       echo "Charm++ NOT BUILT. Either cd into $DESTINATION/tmp and try"
+       echo "to resolve the problems yourself, visit"
+       echo "    http://charm.cs.uiuc.edu/"
+       echo "for more information. Otherwise, email the developers at ppl@cs.uiuc.edu"
+       exit $MAKEEXIT
+}
+
 echo "Performing '$MAKE $MAKEOPTS $PROGRAM OPTS="$OPTS"' in $VERSION/tmp"
 cd $DESTINATION/tmp 
 $MAKE $MAKEOPTS basics OPTS="$OPTS $BUILD_SHARED"
-$MAKE $MAKEOPTS $PROGRAM OPTS="$OPTS $BUILD_SHARED"
+MAKEEXIT=$?
+[ $MAKEEXIT -ne 0 ] && printError
 
+$MAKE $MAKEOPTS $PROGRAM OPTS="$OPTS $BUILD_SHARED"
 MAKEEXIT=$?
 if [ $MAKEEXIT -eq 0 ]
 then
@@ -558,10 +570,5 @@ then
        echo "Next, try out a sample program like" \
             "tests/charm++/simplearrayhello"
 else
-       echo "-------------------------------------------------"
-       echo "Charm++ NOT BUILT. Either cd into $DESTINATION/tmp and try"
-       echo "to resolve the problems yourself, visit"
-       echo "    http://charm.cs.uiuc.edu/"
-       echo "for more information. Otherwise, email the developers at ppl@cs.uiuc.edu"
-       exit $MAKEEXIT
+        printError
 fi