Make build.sh a bit more robust.
authorRyan C. Gordon <icculus@icculus.org>
Sun, 09 Feb 2014 00:17:38 -0500
changeset 23 a5c3269e6d99
parent 22 9adb804d66b0
child 24 c34cc914f09d
Make build.sh a bit more robust.
build.sh
--- a/build.sh	Sun Feb 09 00:17:23 2014 -0500
+++ b/build.sh	Sun Feb 09 00:17:38 2014 -0500
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 #
 # Need to install the following on Ubuntu 12.04:
 # - cmake
@@ -7,5 +7,15 @@
 #
 # If you find other deps, add them here
 
-cmake -DCMAKE_BUILD_TYPE=Release .
-make
+NCPU=`cat /proc/cpuinfo |grep vendor_id |wc -l`
+let NCPU=$NCPU+2
+echo "Will build with 'make -j$NCPU' ... please edit this script if incorrect."
+
+set -x
+rm -rf cmake-build
+mkdir -p cmake-build
+cd $_
+cmake -DCMAKE_BUILD_TYPE=Release ..
+make -j$NCPU && cp -a 1pass ..
+cd ..
+