• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
55LOCAL_PATH:= $(call my-dir)
56
57vixl_include_files := $(LOCAL_PATH)/src/ \
58
59vixl_src_files := \
60  src/vixl/a64/assembler-a64.cc \
61  src/vixl/a64/cpu-a64.cc \
62  src/vixl/a64/debugger-a64.cc \
63  src/vixl/a64/decoder-a64.cc \
64  src/vixl/a64/disasm-a64.cc \
65  src/vixl/a64/instructions-a64.cc \
66  src/vixl/a64/instrument-a64.cc \
67  src/vixl/a64/logic-a64.cc \
68  src/vixl/a64/macro-assembler-a64.cc \
69  src/vixl/a64/simulator-a64.cc \
70  src/vixl/code-buffer.cc  \
71  src/vixl/compiler-intrinsics.cc \
72  src/vixl/utils.cc
73
74vixl_test_files := \
75  test/test-runner.cc \
76  test/test-assembler-a64.cc \
77  test/test-disasm-a64.cc \
78  test/test-fuzz-a64.cc \
79  test/test-invalset.cc \
80  test/test-simulator-a64.cc \
81  test/test-utils-a64.cc \
82
83vixl_cpp_flags := \
84  -DUSE_SIMULATOR \
85  -Wall \
86  -Wextra \
87  -Werror \
88  -fdiagnostics-show-option \
89  -Wredundant-decls \
90  -Wunreachable-code \
91  -pedantic \
92  -std=c++11 \
93
94# Explicitly enable the write-strings warning. VIXL uses
95# const correctly when handling string constants.
96vixl_cpp_flags += \
97  -Wwrite-strings \
98
99vixl_cpp_flags_release := \
100  $(vixl_cpp_flags) \
101  -O3 \
102
103vixl_cpp_flags_debug := \
104  $(vixl_cpp_flags) \
105  -DVIXL_DEBUG \
106  -UNDEBUG \
107  -O2 \
108  -ggdb3 \
109
110VIXL_COVERAGE := false
111
112ifeq ($(ART_COVERAGE), true)
113  VIXL_COVERAGE := true
114endif
115
116include $(CLEAR_VARS)
117LOCAL_CLANG := true
118LOCAL_CPP_EXTENSION := .cc
119LOCAL_CPPFLAGS := $(vixl_cpp_flags_release)
120LOCAL_CLANG_CFLAGS := -Wimplicit-fallthrough
121LOCAL_CPPFLAGS_arm64 := -UUSE_SIMULATOR
122LOCAL_C_INCLUDES := $(vixl_include_files)
123LOCAL_SRC_FILES :=  $(vixl_src_files)
124LOCAL_SHARED_LIBRARIES := liblog
125LOCAL_MODULE_TAGS := optional
126LOCAL_MODULE := libvixl
127LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
128include $(BUILD_SHARED_LIBRARY)
129
130include $(CLEAR_VARS)
131LOCAL_CLANG := true
132LOCAL_CPP_EXTENSION := .cc
133LOCAL_CPPFLAGS := $(vixl_cpp_flags_debug)
134LOCAL_CLANG_CFLAGS := -Wimplicit-fallthrough
135LOCAL_CPPFLAGS_arm64 := -UUSE_SIMULATOR
136LOCAL_C_INCLUDES := $(vixl_include_files)
137LOCAL_SRC_FILES :=  $(vixl_src_files)
138LOCAL_SHARED_LIBRARIES := liblog
139LOCAL_MODULE_TAGS := optional
140LOCAL_MODULE := libvixld
141LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
142include $(BUILD_SHARED_LIBRARY)
143
144
145include $(CLEAR_VARS)
146LOCAL_CLANG := true
147LOCAL_CPP_EXTENSION := .cc
148LOCAL_CPPFLAGS := $(vixl_cpp_flags_release)
149LOCAL_CLANG_CFLAGS := -Wimplicit-fallthrough
150LOCAL_NATIVE_COVERAGE := $(VIXL_COVERAGE)
151LOCAL_C_INCLUDES := $(vixl_include_files)
152LOCAL_SRC_FILES :=  $(vixl_src_files)
153LOCAL_SHARED_LIBRARIES := liblog
154LOCAL_MODULE_TAGS := optional
155LOCAL_MODULE := libvixl
156LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
157LOCAL_MULTILIB := both
158include $(BUILD_HOST_SHARED_LIBRARY)
159
160include $(CLEAR_VARS)
161LOCAL_CLANG := true
162LOCAL_CPP_EXTENSION := .cc
163LOCAL_CPPFLAGS := $(vixl_cpp_flags_debug)
164LOCAL_CLANG_CFLAGS := -Wimplicit-fallthrough
165LOCAL_NATIVE_COVERAGE := $(VIXL_COVERAGE)
166LOCAL_C_INCLUDES := $(vixl_include_files)
167LOCAL_SRC_FILES :=  $(vixl_src_files)
168LOCAL_SHARED_LIBRARIES := liblog
169LOCAL_MODULE_TAGS := optional
170LOCAL_MODULE := libvixld
171LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
172LOCAL_MULTILIB := both
173include $(BUILD_HOST_SHARED_LIBRARY)
174
175
176######### VIXL HOST TESTS #########
177#
178# We only support 64bit host builds for now.
179# To run all the tests: vixl-test-runner --run_all
180#
181include $(CLEAR_VARS)
182LOCAL_CLANG := true
183LOCAL_CPP_EXTENSION := .cc
184LOCAL_CPPFLAGS := $(vixl_cpp_flags_debug)
185LOCAL_CLANG_CFLAGS := -Wimplicit-fallthrough
186LOCAL_NATIVE_COVERAGE := $(VIXL_COVERAGE)
187LOCAL_C_INCLUDES := $(vixl_include_files)
188LOCAL_SRC_FILES :=  $(vixl_test_files) $(vixl_src_files)
189LOCAL_MODULE_TAGS := optional
190LOCAL_MODULE_HOST_ARCH := x86_64
191LOCAL_FORCE_STATIC_EXECUTABLE := true
192LOCAL_MODULE := vixl-test-runner
193LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
194include $(BUILD_HOST_EXECUTABLE)
195
196.PHONY: run-vixl-tests
197run-vixl-tests: vixl-test-runner
198	$(HOST_OUT)/bin/vixl-test-runner --run_all
199	@echo vixl tests PASSED
200