• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Licensed under the Apache License, Version 2.0 (the "License");
2# you may not use this file except in compliance with the License.
3# You may obtain a copy of the License at
4#
5#      http://www.apache.org/licenses/LICENSE-2.0
6#
7# Unless required by applicable law or agreed to in writing, software
8# distributed under the License is distributed on an "AS IS" BASIS,
9# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10# See the License for the specific language governing permissions and
11# limitations under the License.
12#
13
14# Include once
15ifneq ($(vts_run_on_host_mk_included),true)
16vts_run_on_host_mk_included := true
17
18ifneq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),arm mips x86))
19LINKER = linker64
20else
21LINKER = linker
22endif
23
24ifeq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),x86 x86_64))
25# gtest needs ANDROID_DATA/local/tmp for death test output.
26# Make sure to create ANDROID_DATA/local/tmp if doesn't exist.
27# VTS itself should always work relative to ANDROID_DATA or ANDROID_ROOT.
28vts-prepare-run-on-host: $(TARGET_OUT_EXECUTABLES)/$(LINKER) $(TARGET_OUT)/etc/hosts $(TARGET_OUT_EXECUTABLES)/sh
29	if [ ! -d /system ]; then \
30	  echo "Attempting to create /system"; \
31	  sudo mkdir -p -m 0777 /system; \
32	fi
33	echo "Attempting to create $(TARGET_OUT_DATA)/local/tmp if not exists"
34	mkdir -p $(TARGET_OUT_DATA)/local/tmp
35	ln -fs `realpath $(TARGET_OUT)/bin` /system/
36	ln -fs `realpath $(TARGET_OUT)/etc` /system/
37	ln -fs `realpath $(TARGET_OUT)/lib` /system/
38	if [ -d "$(TARGET_OUT)/lib64" ]; then \
39	  ln -fs `realpath $(TARGET_OUT)/lib64` /system/; \
40	fi
41endif
42endif