diff options
-rwxr-xr-x | android-rebuild.sh | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/android-rebuild.sh b/android-rebuild.sh index 136ccc9..d4bdc0a 100755 --- a/android-rebuild.sh +++ b/android-rebuild.sh @@ -6,8 +6,22 @@ # assume that the device tree is in TOP # +case $(uname -s) in + Linux) + HOST_NUM_CPUS=`cat /proc/cpuinfo | grep processor | wc -l` + ;; + Darwin|FreeBsd) + HOST_NUM_CPUS=`sysctl -n hw.ncpu` + ;; + CYGWIN*|*_NT-*) + HOST_NUM_CPUS=$NUMBER_OF_PROCESSORS + ;; + *) # let's play safe here + HOST_NUM_CPUS=1 +esac + cd `dirname $0` -./android-configure.sh $* && \ -make clean && \ -make -j4 && \ +rm -rf objs && +./android-configure.sh $@ && +make -j$HOST_NUM_CPUS && echo "Done. !!" |