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