aboutsummaryrefslogtreecommitdiffstats
path: root/android-rebuild.sh
blob: d4bdc0adf6e3d3cbb2707ff8359620e62d56b540 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash
#
# this script is used to rebuild all QEMU binaries for the host
# platforms.
#
# 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`
rm -rf objs &&
./android-configure.sh $@ &&
make -j$HOST_NUM_CPUS &&
echo "Done. !!"