1#!/bin/bash
2#
3# this script is used to rebuild all QEMU binaries for the host
4# platforms.
5#
6# assume that the device tree is in TOP
7#
8
9case $(uname -s) in
10    Linux)
11        HOST_NUM_CPUS=`cat /proc/cpuinfo | grep processor | wc -l`
12        ;;
13    Darwin|FreeBsd)
14        HOST_NUM_CPUS=`sysctl -n hw.ncpu`
15        ;;
16    CYGWIN*|*_NT-*)
17        HOST_NUM_CPUS=$NUMBER_OF_PROCESSORS
18        ;;
19    *)  # let's play safe here
20        HOST_NUM_CPUS=1
21esac
22
23cd `dirname $0`
24rm -rf objs &&
25./android-configure.sh $@ &&
26make -j$HOST_NUM_CPUS &&
27echo "Done. !!"
28