aboutsummaryrefslogtreecommitdiffhomepage
path: root/platform_tools/android/bin/android_make
blob: 497859d42d76e0a901bc46bcf09e5d70b131890d (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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/bash

makeVars=""
deviceID=""

while (( "$#" )); do

  if [[ $(echo "$1" | grep "^-d$") != "" ]];
  then 
    deviceID="$2"
    shift
  elif [[ "$1" == "--use-ccache" ]];
  then
    if [[ -z "$ANDROID_MAKE_CCACHE" ]];
    then
      ANDROID_MAKE_CCACHE=$(which ccache)
    fi
  else
    makeVars="$makeVars $1"
  fi

shift
done

if [[ -n "$ANDROID_MAKE_CCACHE" ]]; then
  $ANDROID_MAKE_CCACHE --version &> /dev/null
  if [[ "$?" != "0" ]]; then
    echo "Unable to find ccache!"
    exit 1
  fi
fi

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

# hack for x86 support in android_setup.sh
if [ "$deviceID" == "x86" ]
then
  ANDROID_ARCH="x86"
fi

source $SCRIPT_DIR/android_setup.sh

setup_device $deviceID
returnVal=$?
if [ $returnVal != 0 ]
then
  exit 1;
fi

# write the out directory into the .android_config file
echo $SKIA_OUT > .android_config

make $makeVars
if [ $? != 0 ]
then
  exit 1;
fi