1LOCAL_PATH := $(call my-dir)
2
3test_executable := CtsSimpleperfTestCases
4list_executable := $(test_executable)_list
5simpleperf_src_path := system/extras/simpleperf
6
7LLVM_ROOT_PATH := external/llvm
8include $(LLVM_ROOT_PATH)/llvm.mk
9
10include $(CLEAR_VARS)
11LOCAL_MODULE := $(test_executable)
12LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/nativetest
13LOCAL_MULTILIB := both
14LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
15LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
16
17LOCAL_SHARED_LIBRARIES += \
18  libbacktrace \
19  libunwind \
20  libbase \
21  liblog \
22  libutils \
23  libLLVM \
24
25LOCAL_WHOLE_STATIC_LIBRARIES = \
26  libsimpleperf_cts_test \
27
28LOCAL_STATIC_LIBRARIES += \
29  libgtest \
30  libbacktrace_offline \
31  libziparchive \
32  libz \
33  liblzma \
34
35LOCAL_POST_LINK_CMD =  \
36  TMP_FILE=`mktemp $(OUT_DIR)/simpleperf-post-link-XXXXXXXXXX` && \
37  (cd $(simpleperf_src_path)/testdata && zip - -0 -r .) > $$TMP_FILE && \
38  $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_OBJCOPY) --add-section .testzipdata=$$TMP_FILE $(linked_module) && \
39  rm -f $$TMP_FILE
40
41LOCAL_COMPATIBILITY_SUITE := cts
42
43LOCAL_CTS_TEST_PACKAGE := android.simpleperf
44include $(BUILD_CTS_EXECUTABLE)
45
46
47include $(CLEAR_VARS)
48LOCAL_MODULE := $(list_executable)
49LOCAL_MODULE_HOST_OS := linux
50LOCAL_MULTILIB := first
51LOCAL_LDLIBS = -lrt
52
53LOCAL_WHOLE_STATIC_LIBRARIES += \
54  libsimpleperf_cts_test \
55
56LOCAL_STATIC_LIBRARIES += \
57  libbacktrace_offline \
58  libbacktrace \
59  libunwind \
60  libziparchive-host \
61  libz \
62  liblzma \
63  libbase \
64  liblog \
65  libcutils \
66  libutils \
67  libLLVMObject \
68  libLLVMBitReader \
69  libLLVMMC \
70  libLLVMMCParser \
71  libLLVMCore \
72  libLLVMSupport \
73
74include $(LLVM_HOST_BUILD_MK)
75include $(BUILD_HOST_NATIVE_TEST)
76