diff --git a/build b/build
index 914c65b1971bd0b895f5c2aa6f093ee83dd132a2..68966f0f423d13fd2cfb69a380fe02ea9bc25e8f 100755
--- a/build
+++ b/build
@@ -202,7 +202,9 @@ if [[ "$make" != "make" ]] && [[ "$VERBOSE" ]]; then
    VERBOSE="-v"
 fi
 
-$make ${VERBOSE} $make_target
+if ! $make ${VERBOSE} $make_target; then
+   exit 1
+fi
 
 if [[ ${WITH_DOC} == "yes" ]]; then
    "$ROOT_DIR/Documentation/build" --prefix="$PREFIX"
diff --git a/install b/install
index fe138dfaa005539a87e7ccbb9a8746143c4cbb0e..9b66bfbeece92c3bdd629b8c56dd49c47fb2b4f3 100755
--- a/install
+++ b/install
@@ -35,7 +35,10 @@ if [[ ${BUILD_DEBUG} == "yes" ]]; then
       mkdir Debug
    fi
    pushd Debug
-   ../build --root-dir=.. --build=Debug --install=yes ${OPTIONS}
+   if ! ../build --root-dir=.. --build=Debug --install=yes ${OPTIONS}; then
+      echo "Debug build failed."
+      exit 1
+   fi
    popd
 fi
 
@@ -44,7 +47,10 @@ if [[ ${BUILD_RELEASE} == "yes" ]]; then
       mkdir Release
    fi
    pushd Release
-   ../build --root-dir=.. --build=Release --install=yes ${OPTIONS};
+   if ! ../build --root-dir=.. --build=Release --install=yes ${OPTIONS}; then
+      echo "Release build failed."
+      exit 1
+   fi
    popd
 fi