]> git.donarmstrong.com Git - kiibohd-controller.git/blobdiff - Keyboards/cmake.bash
Start removing select Linux-isms
[kiibohd-controller.git] / Keyboards / cmake.bash
index 61995b0cf0432edc07416f44a16d298fbe9f7214..9587abe062a1daef7e6cb93ef606d79bc4664b1c 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 # This is bash lib file for the convenience build scripts
 # Don't call this script directly
 # Jacob Alexander 2015
@@ -82,7 +82,19 @@ done
 mkdir -p "${BuildPath}"
 cd "${BuildPath}"
 cmake -DCHIP="${Chip}" -DCOMPILER="${Compiler}" -DScanModule="${ScanModule}" -DMacroModule="${MacroModule}" -DOutputModule="${OutputModule}" -DDebugModule="${DebugModule}" -DBaseMap="${BaseMap}" -DDefaultMap="${DefaultMap}" -DPartialMaps="${PartialMapsExpanded}" "${CMakeListsPath}"
+return_code=$?
+if [ $return_code != 0 ] ; then
+  echo "Error in cmake. Exiting..."
+  exit $return_code
+fi
+
 make
+return_code=$?
+if [ $return_code != 0 ] ; then
+  echo "Error in make. Exiting..."
+  exit $return_code
+fi
 
 echo "Firmware has been compiled into: '${BuildPath}'"
+cd -