* commit 'ad8e339a565af518bcda51e5ebbc536aa63de9e3': Extract bionic-prepare-run-on-host to inc file.
This commit is contained in:
		@@ -73,26 +73,22 @@ LOCAL_CXX_STL := libc++
 | 
				
			|||||||
include $(BUILD_HOST_EXECUTABLE)
 | 
					include $(BUILD_HOST_EXECUTABLE)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ifeq ($(HOST_OS)-$(HOST_ARCH),$(filter $(HOST_OS)-$(HOST_ARCH),linux-x86 linux-x86_64))
 | 
					ifeq ($(HOST_OS)-$(HOST_ARCH),$(filter $(HOST_OS)-$(HOST_ARCH),linux-x86 linux-x86_64))
 | 
				
			||||||
ifeq ($(TARGET_ARCH),x86)
 | 
					include $(LOCAL_PATH)/../build/run-on-host.mk
 | 
				
			||||||
LINKER = linker
 | 
					 | 
				
			||||||
NATIVE_SUFFIX=32
 | 
					 | 
				
			||||||
else
 | 
					 | 
				
			||||||
LINKER = linker64
 | 
					 | 
				
			||||||
NATIVE_SUFFIX=64
 | 
					 | 
				
			||||||
endif
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
bionic-benchmarks-run-on-host: bionic-benchmarks $(TARGET_OUT_EXECUTABLES)/$(LINKER) $(TARGET_OUT_EXECUTABLES)/sh
 | 
					ifeq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),x86 x86_64))
 | 
				
			||||||
	if [ ! -d /system ]; then \
 | 
					bionic-benchmarks-run-on-host32: bionic-benchmarks bionic-prepare-run-on-host
 | 
				
			||||||
	  echo "Attempting to create /system"; \
 | 
					 | 
				
			||||||
	  sudo mkdir -p -m 0777 /system; \
 | 
					 | 
				
			||||||
	fi
 | 
					 | 
				
			||||||
	mkdir -p $(TARGET_OUT_DATA)/local/tmp
 | 
					 | 
				
			||||||
	ln -fs `realpath $(TARGET_OUT)/bin` /system/
 | 
					 | 
				
			||||||
	ln -fs `realpath $(TARGET_OUT)/etc` /system/
 | 
					 | 
				
			||||||
	ANDROID_DATA=$(TARGET_OUT_DATA) \
 | 
						ANDROID_DATA=$(TARGET_OUT_DATA) \
 | 
				
			||||||
	ANDROID_ROOT=$(TARGET_OUT) \
 | 
						ANDROID_ROOT=$(TARGET_OUT) \
 | 
				
			||||||
	LD_LIBRARY_PATH=$(TARGET_OUT_SHARED_LIBRARIES) \
 | 
							$(TARGET_OUT_EXECUTABLES)/bionic-benchmarks32 $(BIONIC_BENCHMARKS_FLAGS)
 | 
				
			||||||
		$(TARGET_OUT_EXECUTABLES)/bionic-benchmarks$(NATIVE_SUFFIX) $(BIONIC_BENCHMARKS_FLAGS)
 | 
					endif
 | 
				
			||||||
endif # linux-x86
 | 
					
 | 
				
			||||||
 | 
					ifeq ($(TARGET_IS_64_BIT),true)
 | 
				
			||||||
 | 
					bionic-benchmarks-run-on-host64: bionic-benchmarks bionic-prepare-run-on-host
 | 
				
			||||||
 | 
						ANDROID_DATA=$(TARGET_OUT_DATA) \
 | 
				
			||||||
 | 
						ANDROID_ROOT=$(TARGET_OUT) \
 | 
				
			||||||
 | 
							$(TARGET_OUT_EXECUTABLES)/bionic-benchmarks64 $(BIONIC_BENCHMARKS_FLAGS)
 | 
				
			||||||
 | 
					endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
endif # !BUILD_TINY_ANDROID
 | 
					endif # !BUILD_TINY_ANDROID
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										39
									
								
								build/run-on-host.mk
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										39
									
								
								build/run-on-host.mk
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,39 @@
 | 
				
			|||||||
 | 
					#
 | 
				
			||||||
 | 
					# Copyright (C) 2014 The Android Open Source Project
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# Licensed under the Apache License, Version 2.0 (the "License");
 | 
				
			||||||
 | 
					# you may not use this file except in compliance with the License.
 | 
				
			||||||
 | 
					# You may obtain a copy of the License at
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					#      http://www.apache.org/licenses/LICENSE-2.0
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# Unless required by applicable law or agreed to in writing, software
 | 
				
			||||||
 | 
					# distributed under the License is distributed on an "AS IS" BASIS,
 | 
				
			||||||
 | 
					# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
				
			||||||
 | 
					# See the License for the specific language governing permissions and
 | 
				
			||||||
 | 
					# limitations under the License.
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					ifneq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),arm mips x86))
 | 
				
			||||||
 | 
					LINKER = linker64
 | 
				
			||||||
 | 
					else
 | 
				
			||||||
 | 
					LINKER = linker
 | 
				
			||||||
 | 
					endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					ifeq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),x86 x86_64))
 | 
				
			||||||
 | 
					# gtest needs ANDROID_DATA/local/tmp for death test output.
 | 
				
			||||||
 | 
					# Make sure to create ANDROID_DATA/local/tmp if doesn't exist.
 | 
				
			||||||
 | 
					# bionic itself should always work relative to ANDROID_DATA or ANDROID_ROOT.
 | 
				
			||||||
 | 
					bionic-prepare-run-on-host: $(TARGET_OUT_EXECUTABLES)/$(LINKER) $(TARGET_OUT)/etc/hosts $(TARGET_OUT_EXECUTABLES)/sh
 | 
				
			||||||
 | 
						if [ ! -d /system ]; then \
 | 
				
			||||||
 | 
						  echo "Attempting to create /system"; \
 | 
				
			||||||
 | 
						  sudo mkdir -p -m 0777 /system; \
 | 
				
			||||||
 | 
						fi
 | 
				
			||||||
 | 
						mkdir -p $(TARGET_OUT_DATA)/local/tmp
 | 
				
			||||||
 | 
						ln -fs `realpath $(TARGET_OUT)/bin` /system/
 | 
				
			||||||
 | 
						ln -fs `realpath $(TARGET_OUT)/etc` /system/
 | 
				
			||||||
 | 
						ln -fs `realpath $(TARGET_OUT)/lib` /system/
 | 
				
			||||||
 | 
						if [ -d "$(TARGET_OUT)/lib64" ]; then \
 | 
				
			||||||
 | 
						  ln -fs `realpath $(TARGET_OUT)/lib64` /system/; \
 | 
				
			||||||
 | 
						fi
 | 
				
			||||||
 | 
					endif
 | 
				
			||||||
@@ -373,14 +373,6 @@ include $(BUILD_STATIC_LIBRARY)
 | 
				
			|||||||
# Host glibc tests.
 | 
					# Host glibc tests.
 | 
				
			||||||
# -----------------------------------------------------------------------------
 | 
					# -----------------------------------------------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ifneq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),arm mips x86))
 | 
					 | 
				
			||||||
LINKER = linker64
 | 
					 | 
				
			||||||
NATIVE_TEST_SUFFIX=64
 | 
					 | 
				
			||||||
else
 | 
					 | 
				
			||||||
LINKER = linker
 | 
					 | 
				
			||||||
NATIVE_TEST_SUFFIX=32
 | 
					 | 
				
			||||||
endif
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# gtest needs ANDROID_DATA/local/tmp for death test output.
 | 
					# gtest needs ANDROID_DATA/local/tmp for death test output.
 | 
				
			||||||
# Make sure to create ANDROID_DATA/local/tmp if doesn't exist.
 | 
					# Make sure to create ANDROID_DATA/local/tmp if doesn't exist.
 | 
				
			||||||
# Use the current target out directory as ANDROID_DATA.
 | 
					# Use the current target out directory as ANDROID_DATA.
 | 
				
			||||||
@@ -389,46 +381,32 @@ bionic-unit-tests-glibc-run: bionic-unit-tests-glibc
 | 
				
			|||||||
	mkdir -p $(TARGET_OUT_DATA)/local/tmp
 | 
						mkdir -p $(TARGET_OUT_DATA)/local/tmp
 | 
				
			||||||
	ANDROID_DATA=$(TARGET_OUT_DATA) \
 | 
						ANDROID_DATA=$(TARGET_OUT_DATA) \
 | 
				
			||||||
	ANDROID_ROOT=$(TARGET_OUT) \
 | 
						ANDROID_ROOT=$(TARGET_OUT) \
 | 
				
			||||||
		$(HOST_OUT_EXECUTABLES)/bionic-unit-tests-glibc$(NATIVE_TEST_SUFFIX) $(BIONIC_TEST_FLAGS)
 | 
							$(HOST_OUT_EXECUTABLES)/bionic-unit-tests-glibc64 $(BIONIC_TEST_FLAGS)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# -----------------------------------------------------------------------------
 | 
					# -----------------------------------------------------------------------------
 | 
				
			||||||
# Run the unit tests built against x86 bionic on an x86 host.
 | 
					# Run the unit tests built against x86 bionic on an x86 host.
 | 
				
			||||||
# -----------------------------------------------------------------------------
 | 
					# -----------------------------------------------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					include $(LOCAL_PATH)/../build/run-on-host.mk
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ifeq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),x86 x86_64))
 | 
					ifeq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),x86 x86_64))
 | 
				
			||||||
# gtest needs ANDROID_DATA/local/tmp for death test output.
 | 
					 | 
				
			||||||
# Make sure to create ANDROID_DATA/local/tmp if doesn't exist.
 | 
					 | 
				
			||||||
# bionic itself should always work relative to ANDROID_DATA or ANDROID_ROOT.
 | 
					 | 
				
			||||||
# BIONIC_TEST_FLAGS is either empty or it comes from the user.
 | 
					# BIONIC_TEST_FLAGS is either empty or it comes from the user.
 | 
				
			||||||
bionic-unit-tests-run-on-host-prepare: $(TARGET_OUT_EXECUTABLES)/$(LINKER) $(TARGET_OUT)/etc/hosts $(TARGET_OUT_EXECUTABLES)/sh
 | 
					bionic-unit-tests-run-on-host32: bionic-unit-tests bionic-prepare-run-on-host
 | 
				
			||||||
	if [ ! -d /system ]; then \
 | 
					 | 
				
			||||||
	  echo "Attempting to create /system"; \
 | 
					 | 
				
			||||||
	  sudo mkdir -p -m 0777 /system; \
 | 
					 | 
				
			||||||
	fi
 | 
					 | 
				
			||||||
	mkdir -p $(TARGET_OUT_DATA)/local/tmp
 | 
					 | 
				
			||||||
	ln -fs `realpath $(TARGET_OUT)/bin` /system/
 | 
					 | 
				
			||||||
	ln -fs `realpath $(TARGET_OUT)/etc` /system/
 | 
					 | 
				
			||||||
	ln -fs `realpath $(TARGET_OUT)/lib` /system/
 | 
					 | 
				
			||||||
	if [ -d "$(TARGET_OUT)/lib64" ]; then \
 | 
					 | 
				
			||||||
	  ln -fs `realpath $(TARGET_OUT)/lib64` /system/; \
 | 
					 | 
				
			||||||
	fi
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
bionic-unit-tests-run-on-host: bionic-unit-tests bionic-unit-tests-run-on-host-prepare
 | 
					 | 
				
			||||||
	ANDROID_DATA=$(TARGET_OUT_DATA) \
 | 
						ANDROID_DATA=$(TARGET_OUT_DATA) \
 | 
				
			||||||
	ANDROID_DNS_MODE=local \
 | 
						ANDROID_DNS_MODE=local \
 | 
				
			||||||
	ANDROID_ROOT=$(TARGET_OUT) \
 | 
						ANDROID_ROOT=$(TARGET_OUT) \
 | 
				
			||||||
		$(TARGET_OUT_DATA_NATIVE_TESTS)/bionic-unit-tests/bionic-unit-tests$(NATIVE_TEST_SUFFIX) $(BIONIC_TEST_FLAGS)
 | 
							$(TARGET_OUT_DATA)/nativetest/bionic-unit-tests/bionic-unit-tests32 $(BIONIC_TEST_FLAGS)
 | 
				
			||||||
endif
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
ifeq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),x86_64))
 | 
					ifeq ($(TARGET_IS_64_BIT),true)
 | 
				
			||||||
# add target to run lp32 tests
 | 
					# add target to run lp64 tests
 | 
				
			||||||
bionic-unit-tests-run-on-host32: bionic-unit-tests_32 bionic-unit-tests-run-on-host-prepare
 | 
					bionic-unit-tests-run-on-host64: bionic-unit-tests bionic-prepare-run-on-host
 | 
				
			||||||
	ANDROID_DATA=$(TARGET_OUT_DATA) \
 | 
						ANDROID_DATA=$(TARGET_OUT_DATA) \
 | 
				
			||||||
	ANDROID_DNS_MODE=local \
 | 
						ANDROID_DNS_MODE=local \
 | 
				
			||||||
	ANDROID_ROOT=$(TARGET_OUT) \
 | 
						ANDROID_ROOT=$(TARGET_OUT) \
 | 
				
			||||||
		$(2ND_TARGET_OUT_DATA_NATIVE_TESTS)/bionic-unit-tests/bionic-unit-tests32 $(BIONIC_TEST_FLAGS)
 | 
							$(TARGET_OUT_DATA)/nativetest64/bionic-unit-tests/bionic-unit-tests64 $(BIONIC_TEST_FLAGS)
 | 
				
			||||||
endif
 | 
					endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					endif # x86 x86_64
 | 
				
			||||||
endif # linux-x86
 | 
					endif # linux-x86
 | 
				
			||||||
 | 
					
 | 
				
			||||||
include $(call first-makefiles-under,$(LOCAL_PATH))
 | 
					include $(call first-makefiles-under,$(LOCAL_PATH))
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user