1 # 2 # Copyright (C) 2014 The Android Open Source Project 3 # All rights reserved. 4 # 5 # Redistribution and use in source and binary forms, with or without 6 # modification, are permitted provided that the following conditions 7 # are met: 8 # * Redistributions of source code must retain the above copyright 9 # notice, this list of conditions and the following disclaimer. 10 # * Redistributions in binary form must reproduce the above copyright 11 # notice, this list of conditions and the following disclaimer in 12 # the documentation and/or other materials provided with the 13 # distribution. 14 # 15 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 16 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 17 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 18 # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 19 # COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 20 # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 21 # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 22 # OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 23 # AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 25 # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 # SUCH DAMAGE. 27 # 28 # 29 # Copyright (c) 2014 ARM Ltd 30 # All rights reserved. 31 # 32 # Redistribution and use in source and binary forms, with or without 33 # modification, are permitted provided that the following conditions 34 # are met: 35 # 1. Redistributions of source code must retain the above copyright 36 # notice, this list of conditions and the following disclaimer. 37 # 2. Redistributions in binary form must reproduce the above copyright 38 # notice, this list of conditions and the following disclaimer in the 39 # documentation and/or other materials provided with the distribution. 40 # 3. The name of the company may not be used to endorse or promote 41 # products derived from this software without specific prior written 42 # permission. 43 # 44 # THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS'' AND ANY EXPRESS OR IMPLIED 45 # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 46 # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 47 # IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 48 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 49 # TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 50 # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 51 # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 52 # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 53 # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 54 55 LOCAL_PATH:= $(call my-dir) 56 57 vixl_include_files := $(LOCAL_PATH)/src/ \ 58 59 vixl_src_files := \ 60 src/a64/assembler-a64.cc \ 61 src/a64/cpu-a64.cc \ 62 src/a64/debugger-a64.cc \ 63 src/a64/decoder-a64.cc \ 64 src/a64/disasm-a64.cc \ 65 src/a64/instructions-a64.cc \ 66 src/a64/instrument-a64.cc \ 67 src/a64/macro-assembler-a64.cc \ 68 src/a64/simulator-a64.cc \ 69 src/utils-vixl.cc 70 71 vixl_test_files := \ 72 test/cctest.cc \ 73 test/test-utils-a64.cc \ 74 test/test-assembler-a64.cc \ 75 test/test-simulator-a64.cc \ 76 test/test-disasm-a64.cc \ 77 test/test-fuzz-a64.cc 78 79 include $(CLEAR_VARS) 80 LOCAL_CPP_EXTENSION := .cc 81 LOCAL_CPPFLAGS := -O2 -Wall -Wextra -DUSE_SIMULATOR 82 LOCAL_CPPFLAGS_arm64 := -UUSE_SIMULATOR 83 LOCAL_C_INCLUDES := $(vixl_include_files) 84 LOCAL_SRC_FILES := $(vixl_src_files) 85 LOCAL_SHARED_LIBRARIES := liblog 86 LOCAL_MODULE_TAGS := optional 87 LOCAL_MODULE := libvixl 88 LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk 89 include external/libcxx/libcxx.mk 90 include $(BUILD_SHARED_LIBRARY) 91 92 include $(CLEAR_VARS) 93 LOCAL_CPP_EXTENSION := .cc 94 LOCAL_CPPFLAGS := -O2 -Wall -Wextra -DDEBUG=1 -DUSE_SIMULATOR 95 LOCAL_CPPFLAGS_arm64 := -UUSE_SIMULATOR 96 LOCAL_C_INCLUDES := $(vixl_include_files) 97 LOCAL_SRC_FILES := $(vixl_src_files) 98 LOCAL_SHARED_LIBRARIES := liblog 99 LOCAL_MODULE_TAGS := optional 100 LOCAL_MODULE := libvixlg 101 LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk 102 include external/libcxx/libcxx.mk 103 include $(BUILD_SHARED_LIBRARY) 104 105 include $(CLEAR_VARS) 106 LOCAL_CLANG := true 107 LOCAL_CPP_EXTENSION := .cc 108 LOCAL_CPPFLAGS := -O2 -Wall -Wextra -DUSE_SIMULATOR 109 LOCAL_C_INCLUDES := $(vixl_include_files) 110 LOCAL_SRC_FILES := $(vixl_src_files) 111 LOCAL_STATIC_LIBRARIES := liblog 112 LOCAL_MODULE_TAGS := optional 113 LOCAL_MODULE := libvixl 114 LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk 115 LOCAL_MULTILIB := both 116 include external/libcxx/libcxx.mk 117 include $(BUILD_HOST_STATIC_LIBRARY) 118 119 # cctest_vixl: VIXL native tests (to run all tests execute ./cctest_vixl --run_all) 120 # 121 # We only support 64bit host builds of cctest. 122 include $(CLEAR_VARS) 123 LOCAL_CLANG := true 124 LOCAL_CPP_EXTENSION := .cc 125 LOCAL_CPPFLAGS := -O2 -Wall -Wextra -DUSE_SIMULATOR -DDEBUG=1 -UNDEBUG 126 LOCAL_C_INCLUDES := $(vixl_include_files) 127 LOCAL_SRC_FILES := $(vixl_test_files) $(vixl_src_files) 128 LOCAL_MODULE_TAGS := optional 129 LOCAL_MODULE_HOST_ARCH := x86_64 130 LOCAL_FORCE_STATIC_EXECUTABLE := true 131 LOCAL_MODULE := cctest_vixl 132 LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk 133 include external/libcxx/libcxx.mk 134 include $(BUILD_HOST_EXECUTABLE) 135 136 .PHONY: run-vixl-tests 137 run-vixl-tests: cctest_vixl 138 $(HOST_OUT)/bin/cctest_vixl --run_all 139 @echo vixl tests PASSED 140