blob: de9b35d3eabfead52615efcf85ed8c5fea72d27a [file] [log] [blame]
Nicolas Geoffrayfbeca752015-05-29 10:54:12 +01001#!/bin/bash
2#
3# Copyright (C) 2015 The Android Open Source Project
4#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16
17if [ ! -d art ]; then
18 echo "Script needs to be run at the root of the android tree"
19 exit 1
20fi
21
Nicolas Geoffray5e0199b2015-09-21 11:11:40 +010022common_targets="vogar vogar.jar core-tests apache-harmony-jdwp-tests-hostdex jsr166-tests"
Nicolas Geoffrayfbeca752015-05-29 10:54:12 +010023mode="target"
24j_arg="-j$(nproc)"
Roland Levillainb8b93562015-08-20 17:49:56 +010025showcommands=
Nicolas Geoffrayfbeca752015-05-29 10:54:12 +010026make_command=
27
Nicolas Geoffrayfbeca752015-05-29 10:54:12 +010028while true; do
29 if [[ "$1" == "--host" ]]; then
30 mode="host"
31 shift
32 elif [[ "$1" == "--target" ]]; then
33 mode="target"
34 shift
Nicolas Geoffrayfbeca752015-05-29 10:54:12 +010035 elif [[ "$1" == -j* ]]; then
Nicolas Geoffray667b99e2015-05-29 12:17:06 +010036 j_arg=$1
Nicolas Geoffrayfbeca752015-05-29 10:54:12 +010037 shift
Roland Levillainb8b93562015-08-20 17:49:56 +010038 elif [[ "$1" == "--showcommands" ]]; then
39 showcommands="showcommands"
40 shift
Nicolas Geoffrayfbeca752015-05-29 10:54:12 +010041 elif [[ "$1" == "" ]]; then
42 break
43 fi
44done
45
46if [[ $mode == "host" ]]; then
Nicolas Geoffrayaadc9862015-09-29 14:56:31 +010047 make_command="make $j_arg $showcommands build-art-host-tests $common_targets out/host/linux-x86/lib/libjavacoretests.so out/host/linux-x86/lib64/libjavacoretests.so"
Nicolas Geoffrayfbeca752015-05-29 10:54:12 +010048elif [[ $mode == "target" ]]; then
Nicolas Geoffrayaadc9862015-09-29 14:56:31 +010049 make_command="make $j_arg $showcommands build-art-target-tests $common_targets libjavacrypto libjavacoretests linker toybox toolbox sh out/host/linux-x86/bin/adb"
Nicolas Geoffrayfbeca752015-05-29 10:54:12 +010050fi
51
Nicolas Geoffrayaadc9862015-09-29 14:56:31 +010052echo "Executing $make_command"
53$make_command