blob: eb72d8841d2c3db340645fa46ecf4cfb5403226f [file] [log] [blame]
Yabin Cui67d3abd2015-04-16 15:26:31 -07001#
2# Copyright (C) 2015 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#
Yabin Cui67d3abd2015-04-16 15:26:31 -070016LOCAL_PATH := $(call my-dir)
17
Yabin Cui6ef55f72016-07-26 18:42:38 -070018simpleperf_version := $(shell git -C $(LOCAL_PATH) rev-parse --short=12 HEAD 2>/dev/null)
19
20simpleperf_common_cppflags := -Wextra -Wunused -Wno-unknown-pragmas \
21 -DSIMPLEPERF_REVISION='"$(simpleperf_version)"'
Yabin Cui76769e52015-07-13 12:23:54 -070022
Yabin Cuiffaa9122016-01-15 15:25:48 -080023simpleperf_cppflags_target := $(simpleperf_common_cppflags)
Yabin Cui9fd3cc12015-06-25 17:42:23 -070024
Yabin Cui3c8c2132015-08-13 20:30:20 -070025simpleperf_cppflags_host := $(simpleperf_common_cppflags) \
26 -DUSE_BIONIC_UAPI_HEADERS -I bionic/libc/kernel \
Yabin Cuia447c0d2016-08-26 11:35:28 -070027 -fvisibility=hidden \
Yabin Cui323e9452015-04-20 18:07:17 -070028
Yabin Cuiffaa9122016-01-15 15:25:48 -080029simpleperf_cppflags_host_darwin := -I $(LOCAL_PATH)/nonlinux_support/include
30simpleperf_cppflags_host_windows := -I $(LOCAL_PATH)/nonlinux_support/include
Yabin Cui3c8c2132015-08-13 20:30:20 -070031
Yabin Cui3c8c2132015-08-13 20:30:20 -070032
33LLVM_ROOT_PATH := external/llvm
34include $(LLVM_ROOT_PATH)/llvm.mk
35
Than McIntoshf831e6d2016-02-01 19:50:20 -050036simpleperf_static_libraries_target := \
Yabin Cui040f7b42016-04-13 21:28:54 -070037 libbacktrace_offline \
Yabin Cui6d8c8342016-02-10 11:29:51 -080038 libbacktrace \
Yabin Cui040f7b42016-04-13 21:28:54 -070039 libunwind \
Yabin Cui6d8c8342016-02-10 11:29:51 -080040 libziparchive \
41 libz \
42 libbase \
43 libcutils \
44 liblog \
Yabin Cui7e5aa132016-11-16 22:47:53 +000045 libprocinfo \
Yabin Cui6d8c8342016-02-10 11:29:51 -080046 libutils \
Yabin Cui6d8c8342016-02-10 11:29:51 -080047 liblzma \
48 libLLVMObject \
49 libLLVMBitReader \
50 libLLVMMC \
51 libLLVMMCParser \
52 libLLVMCore \
53 libLLVMSupport \
Yabin Cui42c8dc62016-06-03 15:06:53 -070054 libprotobuf-cpp-lite \
Yabin Cui3e4c5952016-07-26 15:03:27 -070055 libevent \
Yabin Cui6d8c8342016-02-10 11:29:51 -080056 libc \
Than McIntoshf831e6d2016-02-01 19:50:20 -050057
Yabin Cui569f64a2016-02-05 17:32:08 -080058simpleperf_static_libraries_host := \
Colin Crossdec58a22016-08-26 11:16:28 -070059 libziparchive \
Yabin Cui569f64a2016-02-05 17:32:08 -080060 libbase \
61 liblog \
Yabin Cui05400532016-03-17 21:18:53 -070062 liblzma \
Yabin Cui569f64a2016-02-05 17:32:08 -080063 libz \
64 libutils \
Yabin Cui040f7b42016-04-13 21:28:54 -070065 libLLVMObject \
66 libLLVMBitReader \
67 libLLVMMC \
68 libLLVMMCParser \
69 libLLVMCore \
70 libLLVMSupport \
Yabin Cui42c8dc62016-06-03 15:06:53 -070071 libprotobuf-cpp-lite \
Yabin Cui040f7b42016-04-13 21:28:54 -070072
73simpleperf_static_libraries_host_linux := \
Yabin Cui7e5aa132016-11-16 22:47:53 +000074 libprocinfo \
Yabin Cui040f7b42016-04-13 21:28:54 -070075 libbacktrace_offline \
76 libbacktrace \
77 libunwind \
78 libcutils \
Yabin Cui3e4c5952016-07-26 15:03:27 -070079 libevent \
Yabin Cui3c8c2132015-08-13 20:30:20 -070080
Yabin Cui569f64a2016-02-05 17:32:08 -080081simpleperf_ldlibs_host_linux := -lrt
Yabin Cui9759e1b2015-04-28 15:54:13 -070082
Yabin Cui9fd3cc12015-06-25 17:42:23 -070083# libsimpleperf
84# =========================================================
Yabin Cui3c8c2132015-08-13 20:30:20 -070085libsimpleperf_src_files := \
Yabin Cui9759e1b2015-04-28 15:54:13 -070086 cmd_dumprecord.cpp \
Yabin Cui67d3abd2015-04-16 15:26:31 -070087 cmd_help.cpp \
Yabin Cui6965d422016-06-15 11:41:42 -070088 cmd_kmem.cpp \
Yabin Cui2672dea2015-05-21 12:17:23 -070089 cmd_report.cpp \
Yabin Cui767dd172016-06-02 21:02:43 -070090 cmd_report_sample.cpp \
Yabin Cui67d3abd2015-04-16 15:26:31 -070091 command.cpp \
Yabin Cuiec12ed92015-06-08 10:38:10 -070092 dso.cpp \
Yabin Cui67d3abd2015-04-16 15:26:31 -070093 event_attr.cpp \
Yabin Cui67d3abd2015-04-16 15:26:31 -070094 event_type.cpp \
Yabin Cui76769e52015-07-13 12:23:54 -070095 perf_regs.cpp \
Yabin Cui569f64a2016-02-05 17:32:08 -080096 read_apk.cpp \
Yabin Cui8f622512015-05-05 19:58:07 -070097 read_elf.cpp \
Yabin Cui9759e1b2015-04-28 15:54:13 -070098 record.cpp \
Yabin Cui9fd3cc12015-06-25 17:42:23 -070099 record_file_reader.cpp \
Yabin Cui42c8dc62016-06-03 15:06:53 -0700100 report_sample.proto \
Yabin Cui60a0ea92015-07-22 20:30:43 -0700101 thread_tree.cpp \
Yabin Cui4f41df62016-06-01 17:29:06 -0700102 tracing.cpp \
Yabin Cui67d3abd2015-04-16 15:26:31 -0700103 utils.cpp \
Yabin Cui9fd3cc12015-06-25 17:42:23 -0700104
Yabin Cui3c8c2132015-08-13 20:30:20 -0700105libsimpleperf_src_files_linux := \
Yabin Cui9fd3cc12015-06-25 17:42:23 -0700106 cmd_list.cpp \
107 cmd_record.cpp \
108 cmd_stat.cpp \
Yabin Cui3c8c2132015-08-13 20:30:20 -0700109 dwarf_unwind.cpp \
Yabin Cui9fd3cc12015-06-25 17:42:23 -0700110 environment.cpp \
111 event_fd.cpp \
112 event_selection_set.cpp \
Yabin Cui26968e62017-01-30 11:34:24 -0800113 InplaceSamplerClient.cpp \
Yabin Cui3e4c5952016-07-26 15:03:27 -0700114 IOEventLoop.cpp \
Yabin Cuiaa65c8b2016-09-15 10:43:20 -0700115 perf_clock.cpp \
Yabin Cui9fd3cc12015-06-25 17:42:23 -0700116 record_file_writer.cpp \
Yabin Cui54500702016-10-24 16:53:32 -0700117 UnixSocket.cpp \
Yabin Cui323e9452015-04-20 18:07:17 -0700118 workload.cpp \
Yabin Cui67d3abd2015-04-16 15:26:31 -0700119
Yabin Cui3c8c2132015-08-13 20:30:20 -0700120libsimpleperf_src_files_darwin := \
Yabin Cuiffaa9122016-01-15 15:25:48 -0800121 nonlinux_support/nonlinux_support.cpp \
122
123libsimpleperf_src_files_windows := \
124 nonlinux_support/nonlinux_support.cpp \
Yabin Cui9fd3cc12015-06-25 17:42:23 -0700125
Yabin Cui3c8c2132015-08-13 20:30:20 -0700126# libsimpleperf target
Yabin Cui67d3abd2015-04-16 15:26:31 -0700127include $(CLEAR_VARS)
128LOCAL_CLANG := true
Yabin Cuiffaa9122016-01-15 15:25:48 -0800129LOCAL_MODULE := libsimpleperf
130LOCAL_MODULE_TAGS := debug
131LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
Yabin Cui3c8c2132015-08-13 20:30:20 -0700132LOCAL_CPPFLAGS := $(simpleperf_cppflags_target)
133LOCAL_SRC_FILES := \
134 $(libsimpleperf_src_files) \
135 $(libsimpleperf_src_files_linux) \
136
Yabin Cui569f64a2016-02-05 17:32:08 -0800137LOCAL_STATIC_LIBRARIES := $(simpleperf_static_libraries_target)
Yabin Cuid0d14542016-03-30 15:37:53 -0700138LOCAL_MULTILIB := both
Yabin Cui42c8dc62016-06-03 15:06:53 -0700139LOCAL_PROTOC_OPTIMIZE_TYPE := lite-static
Yabin Cui6d8c8342016-02-10 11:29:51 -0800140include $(LLVM_DEVICE_BUILD_MK)
141include $(BUILD_STATIC_LIBRARY)
142
Yabin Cuiffaa9122016-01-15 15:25:48 -0800143# libsimpleperf host
Yabin Cui323e9452015-04-20 18:07:17 -0700144include $(CLEAR_VARS)
Yabin Cuiffaa9122016-01-15 15:25:48 -0800145#LOCAL_CLANG := true # Comment it to build on windows.
Yabin Cui323e9452015-04-20 18:07:17 -0700146LOCAL_MODULE := libsimpleperf
Yabin Cuiffaa9122016-01-15 15:25:48 -0800147LOCAL_MODULE_HOST_OS := darwin linux windows
148LOCAL_CPPFLAGS := $(simpleperf_cppflags_host)
149LOCAL_CPPFLAGS_darwin := $(simpleperf_cppflags_host_darwin)
150LOCAL_CPPFLAGS_linux := $(simpleperf_cppflags_host_linux)
151LOCAL_CPPFLAGS_windows := $(simpleperf_cppflags_host_windows)
152LOCAL_SRC_FILES := $(libsimpleperf_src_files)
153LOCAL_SRC_FILES_darwin := $(libsimpleperf_src_files_darwin)
154LOCAL_SRC_FILES_linux := $(libsimpleperf_src_files_linux)
155LOCAL_SRC_FILES_windows := $(libsimpleperf_src_files_windows)
Yabin Cui569f64a2016-02-05 17:32:08 -0800156LOCAL_STATIC_LIBRARIES := $(simpleperf_static_libraries_host)
Yabin Cui040f7b42016-04-13 21:28:54 -0700157LOCAL_STATIC_LIBRARIES_linux := $(simpleperf_static_libraries_host_linux)
Yabin Cuiffaa9122016-01-15 15:25:48 -0800158LOCAL_LDLIBS_linux := $(simpleperf_ldlibs_host_linux)
Daniel Friederichb2465ad2016-10-17 12:28:03 -0500159LOCAL_MULTILIB := both
Yabin Cui42c8dc62016-06-03 15:06:53 -0700160LOCAL_PROTOC_OPTIMIZE_TYPE := lite-static
Yabin Cuibe903f42016-06-22 15:30:37 -0700161LOCAL_CXX_STL := libc++_static
Yabin Cui8f622512015-05-05 19:58:07 -0700162include $(LLVM_HOST_BUILD_MK)
Yabin Cui323e9452015-04-20 18:07:17 -0700163include $(BUILD_HOST_STATIC_LIBRARY)
Yabin Cui9fd3cc12015-06-25 17:42:23 -0700164
Yabin Cui3c8c2132015-08-13 20:30:20 -0700165
Yabin Cui9fd3cc12015-06-25 17:42:23 -0700166# simpleperf
167# =========================================================
Yabin Cui3c8c2132015-08-13 20:30:20 -0700168
169# simpleperf target
Yabin Cui323e9452015-04-20 18:07:17 -0700170include $(CLEAR_VARS)
171LOCAL_CLANG := true
Yabin Cuiffaa9122016-01-15 15:25:48 -0800172LOCAL_MODULE := simpleperf
173LOCAL_MODULE_TAGS := debug
174LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
Yabin Cui3c8c2132015-08-13 20:30:20 -0700175LOCAL_CPPFLAGS := $(simpleperf_cppflags_target)
Yabin Cui323e9452015-04-20 18:07:17 -0700176LOCAL_SRC_FILES := main.cpp
Yabin Cuiff7465c2016-02-25 11:02:30 -0800177LOCAL_STATIC_LIBRARIES := libsimpleperf $(simpleperf_static_libraries_target)
Yabin Cuid0d14542016-03-30 15:37:53 -0700178ifdef TARGET_2ND_ARCH
179LOCAL_MULTILIB := both
180LOCAL_MODULE_STEM_32 := simpleperf32
181LOCAL_MODULE_STEM_64 := simpleperf
182endif
Yabin Cui6d8c8342016-02-10 11:29:51 -0800183LOCAL_FORCE_STATIC_EXECUTABLE := true
184include $(LLVM_DEVICE_BUILD_MK)
185include $(BUILD_EXECUTABLE)
186
Dan Willemsene87fd022016-06-22 16:41:36 -0700187$(call dist-for-goals,sdk,$(ALL_MODULES.simpleperf.BUILT))
188ifdef TARGET_2ND_ARCH
189$(call dist-for-goals,sdk,$(ALL_MODULES.simpleperf$(TARGET_2ND_ARCH_MODULE_SUFFIX).BUILT))
190endif
191
Yabin Cuiffaa9122016-01-15 15:25:48 -0800192# simpleperf host
Yabin Cui67d3abd2015-04-16 15:26:31 -0700193include $(CLEAR_VARS)
Yabin Cui57222a32017-01-04 21:27:26 +0000194LOCAL_MODULE := simpleperf_host
Yabin Cuiffaa9122016-01-15 15:25:48 -0800195LOCAL_MODULE_HOST_OS := darwin linux windows
196LOCAL_CPPFLAGS := $(simpleperf_cppflags_host)
197LOCAL_CPPFLAGS_darwin := $(simpleperf_cppflags_host_darwin)
198LOCAL_CPPFLAGS_linux := $(simpleperf_cppflags_host_linux)
199LOCAL_CPPFLAGS_windows := $(simpleperf_cppflags_host_windows)
Yabin Cui323e9452015-04-20 18:07:17 -0700200LOCAL_SRC_FILES := main.cpp
Yabin Cuiff7465c2016-02-25 11:02:30 -0800201LOCAL_STATIC_LIBRARIES := libsimpleperf $(simpleperf_static_libraries_host)
Yabin Cui040f7b42016-04-13 21:28:54 -0700202LOCAL_STATIC_LIBRARIES_linux := $(simpleperf_static_libraries_host_linux)
Yabin Cuiffaa9122016-01-15 15:25:48 -0800203LOCAL_LDLIBS_linux := $(simpleperf_ldlibs_host_linux)
Yabin Cui57222a32017-01-04 21:27:26 +0000204LOCAL_MULTILIB := both
205LOCAL_MODULE_STEM_32 := simpleperf32
206LOCAL_MODULE_STEM_64 := simpleperf
Yabin Cuibe903f42016-06-22 15:30:37 -0700207LOCAL_CXX_STL := libc++_static
Yabin Cui040f7b42016-04-13 21:28:54 -0700208include $(LLVM_HOST_BUILD_MK)
Yabin Cui67d3abd2015-04-16 15:26:31 -0700209include $(BUILD_HOST_EXECUTABLE)
Yabin Cui9fd3cc12015-06-25 17:42:23 -0700210
Yabin Cui57222a32017-01-04 21:27:26 +0000211$(call dist-for-goals,sdk,$(ALL_MODULES.simpleperf_host.BUILT):simpleperf_host)
212ifdef HOST_2ND_ARCH
213$(call dist-for-goals,sdk,$(ALL_MODULES.simpleperf_host$(HOST_2ND_ARCH_MODULE_SUFFIX).BUILT):simpleperf_host32)
214endif
215$(call dist-for-goals,win_sdk,$(ALL_MODULES.host_cross_simpleperf_host.BUILT))
216ifdef HOST_CROSS_2ND_ARCH
217$(call dist-for-goals,win_sdk,$(ALL_MODULES.host_cross_simpleperf_host$(HOST_CROSS_2ND_ARCH_MODULE_SUFFIX).BUILT))
218endif
219
Yabin Cui3c8c2132015-08-13 20:30:20 -0700220
Yabin Cuia447c0d2016-08-26 11:35:28 -0700221# libsimpleperf_report.so
222# It is the shared library used on host by python scripts
223# to report samples in different ways.
224# =========================================================
225include $(CLEAR_VARS)
226LOCAL_MODULE := libsimpleperf_report
227LOCAL_MODULE_HOST_OS := darwin linux windows
228LOCAL_CPPFLAGS := $(simpleperf_cppflags_host)
Yabin Cuia447c0d2016-08-26 11:35:28 -0700229LOCAL_CPPFLAGS_darwin := $(simpleperf_cppflags_host_darwin)
230LOCAL_CPPFLAGS_linux := $(simpleperf_cppflags_host_linux)
231LOCAL_CPPFLAGS_windows := $(simpleperf_cppflags_host_windows)
232LOCAL_SRC_FILES := report_lib_interface.cpp
233LOCAL_STATIC_LIBRARIES := libsimpleperf $(simpleperf_static_libraries_host)
234LOCAL_STATIC_LIBRARIES_linux := $(simpleperf_static_libraries_host_linux)
235LOCAL_LDLIBS_linux := $(simpleperf_ldlibs_host_linux) -Wl,--exclude-libs,ALL
Daniel Friederichb2465ad2016-10-17 12:28:03 -0500236LOCAL_MULTILIB := both
Yabin Cuia447c0d2016-08-26 11:35:28 -0700237LOCAL_CXX_STL := libc++_static
238include $(LLVM_HOST_BUILD_MK)
239include $(BUILD_HOST_SHARED_LIBRARY)
240
Yabin Cui57222a32017-01-04 21:27:26 +0000241$(call dist-for-goals,sdk,$(ALL_MODULES.libsimpleperf_report.BUILT))
242ifdef HOST_2ND_ARCH
243$(call dist-for-goals,sdk,$(ALL_MODULES.libsimpleperf_report$(HOST_2ND_ARCH_MODULE_SUFFIX).BUILT):libsimpleperf_report32.so)
244endif
245$(call dist-for-goals,win_sdk,$(ALL_MODULES.host_cross_libsimpleperf_report.BUILT):libsimpleperf_report32.dll)
246ifdef HOST_CROSS_2ND_ARCH
247$(call dist-for-goals,win_sdk,$(ALL_MODULES.host_cross_libsimpleperf_report$(HOST_CROSS_2ND_ARCH_MODULE_SUFFIX).BUILT))
248endif
Yabin Cuia447c0d2016-08-26 11:35:28 -0700249
Yabin Cuib92bae82017-02-10 12:07:29 -0800250
251# libsimpleperf_inplace_sampler.so
252# It is the shared library linked with user's app and get samples from
253# signal handlers in each thread.
254# =========================================================
255
256libsimpleperf_inplace_sampler_static_libraries_target := \
257 $(filter-out libc,$(simpleperf_static_libraries_target)) \
258
259# libsimpleperf_inplace_sampler.so on target
260include $(CLEAR_VARS)
261LOCAL_CLANG := true
262LOCAL_MODULE := libsimpleperf_inplace_sampler
263LOCAL_CPPFLAGS := $(simpleperf_cppflags_target)
264LOCAL_SRC_FILES := inplace_sampler_lib.cpp
265LOCAL_STATIC_LIBRARIES := libsimpleperf $(libsimpleperf_inplace_sampler_static_libraries_target)
266LOCAL_MULTILIB := both
267LOCAL_CXX_STL := libc++_static
268LOCAL_LDLIBS := -Wl,--exclude-libs,ALL
269include $(LLVM_DEVICE_BUILD_MK)
270include $(BUILD_SHARED_LIBRARY)
271
272# libsimpleperf_inplace_sampler.so on host
273include $(CLEAR_VARS)
274LOCAL_CLANG := true
275LOCAL_MODULE := libsimpleperf_inplace_sampler
276LOCAL_MODULE_HOST_OS := linux
277LOCAL_CPPFLAGS := $(simpleperf_cppflags_host)
278LOCAL_CPPFLAGS_linux := $(simpleperf_cppflags_host_linux)
279LOCAL_SRC_FILES := inplace_sampler_lib.cpp
280LOCAL_STATIC_LIBRARIES := libsimpleperf $(simpleperf_static_libraries_host)
281LOCAL_STATIC_LIBRARIES_linux := $(simpleperf_static_libraries_host_linux)
282LOCAL_LDLIBS_linux := $(simpleperf_ldlibs_host_linux) -Wl,--exclude-libs,ALL
283LOCAL_MULTILIB := both
284LOCAL_CXX_STL := libc++_static
285include $(LLVM_HOST_BUILD_MK)
286include $(BUILD_HOST_SHARED_LIBRARY)
287
288
Yabin Cui9fd3cc12015-06-25 17:42:23 -0700289# simpleperf_unit_test
290# =========================================================
Yabin Cui3c8c2132015-08-13 20:30:20 -0700291simpleperf_unit_test_src_files := \
Yabin Cui6965d422016-06-15 11:41:42 -0700292 cmd_kmem_test.cpp \
Yabin Cui6e51bef2016-02-23 21:41:03 -0800293 cmd_report_test.cpp \
Yabin Cui767dd172016-06-02 21:02:43 -0700294 cmd_report_sample_test.cpp \
Yabin Cui9fd3cc12015-06-25 17:42:23 -0700295 command_test.cpp \
296 gtest_main.cpp \
Yabin Cui569f64a2016-02-05 17:32:08 -0800297 read_apk_test.cpp \
298 read_elf_test.cpp \
Yabin Cui9fd3cc12015-06-25 17:42:23 -0700299 record_test.cpp \
300 sample_tree_test.cpp \
Yabin Cuib4212972016-05-25 14:08:05 -0700301 utils_test.cpp \
Yabin Cui9fd3cc12015-06-25 17:42:23 -0700302
Yabin Cui3c8c2132015-08-13 20:30:20 -0700303simpleperf_unit_test_src_files_linux := \
Yabin Cui9759e1b2015-04-28 15:54:13 -0700304 cmd_dumprecord_test.cpp \
Yabin Cui323e9452015-04-20 18:07:17 -0700305 cmd_list_test.cpp \
Yabin Cui9759e1b2015-04-28 15:54:13 -0700306 cmd_record_test.cpp \
Yabin Cui323e9452015-04-20 18:07:17 -0700307 cmd_stat_test.cpp \
Yabin Cui323e9452015-04-20 18:07:17 -0700308 environment_test.cpp \
Yabin Cui3e4c5952016-07-26 15:03:27 -0700309 IOEventLoop_test.cpp \
Yabin Cui9759e1b2015-04-28 15:54:13 -0700310 record_file_test.cpp \
Yabin Cui54500702016-10-24 16:53:32 -0700311 UnixSocket_test.cpp \
Yabin Cui323e9452015-04-20 18:07:17 -0700312 workload_test.cpp \
313
Yabin Cui3c8c2132015-08-13 20:30:20 -0700314# simpleperf_unit_test target
Yabin Cui323e9452015-04-20 18:07:17 -0700315include $(CLEAR_VARS)
316LOCAL_CLANG := true
Yabin Cuiffaa9122016-01-15 15:25:48 -0800317LOCAL_MODULE := simpleperf_unit_test
Dan Shi222a0252017-03-28 11:40:50 -0700318LOCAL_COMPATIBILITY_SUITE := device-tests
Yabin Cui3c8c2132015-08-13 20:30:20 -0700319LOCAL_CPPFLAGS := $(simpleperf_cppflags_target)
320LOCAL_SRC_FILES := \
321 $(simpleperf_unit_test_src_files) \
322 $(simpleperf_unit_test_src_files_linux) \
323
Yabin Cuiff7465c2016-02-25 11:02:30 -0800324LOCAL_STATIC_LIBRARIES += libsimpleperf $(simpleperf_static_libraries_target)
Po Hu4432b6f2017-04-25 08:53:24 +0800325LOCAL_TEST_DATA := $(call find-test-data-in-subdirs,$(LOCAL_PATH),"*",testdata)
Yabin Cui5be914d2016-11-29 15:21:13 -0800326LOCAL_MULTILIB := both
Yabin Cui33754212016-04-14 16:35:00 -0700327LOCAL_FORCE_STATIC_EXECUTABLE := true
328include $(LLVM_DEVICE_BUILD_MK)
Yabin Cui323e9452015-04-20 18:07:17 -0700329include $(BUILD_NATIVE_TEST)
330
Yabin Cuiffaa9122016-01-15 15:25:48 -0800331# simpleperf_unit_test host
Yabin Cui323e9452015-04-20 18:07:17 -0700332include $(CLEAR_VARS)
Yabin Cui323e9452015-04-20 18:07:17 -0700333LOCAL_MODULE := simpleperf_unit_test
Yabin Cuiffaa9122016-01-15 15:25:48 -0800334LOCAL_MODULE_HOST_OS := darwin linux windows
335LOCAL_CPPFLAGS := $(simpleperf_cppflags_host)
336LOCAL_CPPFLAGS_darwin := $(simpleperf_cppflags_host_darwin)
337LOCAL_CPPFLAGS_linux := $(simpleperf_cppflags_host_linux)
338LOCAL_CPPFLAGS_windows := $(simpleperf_cppflags_host_windows)
Yabin Cui3c8c2132015-08-13 20:30:20 -0700339LOCAL_SRC_FILES := $(simpleperf_unit_test_src_files)
Yabin Cuiffaa9122016-01-15 15:25:48 -0800340LOCAL_SRC_FILES_linux := $(simpleperf_unit_test_src_files_linux)
Yabin Cuiff7465c2016-02-25 11:02:30 -0800341LOCAL_STATIC_LIBRARIES := libsimpleperf $(simpleperf_static_libraries_host)
Yabin Cui040f7b42016-04-13 21:28:54 -0700342LOCAL_STATIC_LIBRARIES_linux := $(simpleperf_static_libraries_host_linux)
Yabin Cuiffaa9122016-01-15 15:25:48 -0800343LOCAL_LDLIBS_linux := $(simpleperf_ldlibs_host_linux)
Yabin Cui57222a32017-01-04 21:27:26 +0000344LOCAL_MULTILIB := both
Yabin Cui040f7b42016-04-13 21:28:54 -0700345include $(LLVM_HOST_BUILD_MK)
Yabin Cui9fd3cc12015-06-25 17:42:23 -0700346include $(BUILD_HOST_NATIVE_TEST)
Yabin Cui0930ea82015-10-01 17:24:07 -0700347
Yabin Cui89905b72015-12-07 20:14:14 -0800348
349# simpleperf_cpu_hotplug_test
350# =========================================================
351simpleperf_cpu_hotplug_test_src_files := \
Yabin Cui89905b72015-12-07 20:14:14 -0800352 cpu_hotplug_test.cpp \
353
354# simpleperf_cpu_hotplug_test target
355include $(CLEAR_VARS)
356LOCAL_CLANG := true
Yabin Cuiffaa9122016-01-15 15:25:48 -0800357LOCAL_MODULE := simpleperf_cpu_hotplug_test
Dan Shi222a0252017-03-28 11:40:50 -0700358LOCAL_COMPATIBILITY_SUITE := device-tests
Yabin Cui89905b72015-12-07 20:14:14 -0800359LOCAL_CPPFLAGS := $(simpleperf_cppflags_target)
360LOCAL_SRC_FILES := $(simpleperf_cpu_hotplug_test_src_files)
Yabin Cuiff7465c2016-02-25 11:02:30 -0800361LOCAL_STATIC_LIBRARIES := libsimpleperf $(simpleperf_static_libraries_target)
Yabin Cui56335862016-04-18 13:43:20 -0700362LOCAL_MULTILIB := both
Yabin Cui33754212016-04-14 16:35:00 -0700363LOCAL_FORCE_STATIC_EXECUTABLE := true
364include $(LLVM_DEVICE_BUILD_MK)
Yabin Cui89905b72015-12-07 20:14:14 -0800365include $(BUILD_NATIVE_TEST)
366
367# simpleperf_cpu_hotplug_test linux host
Yabin Cui89905b72015-12-07 20:14:14 -0800368include $(CLEAR_VARS)
369LOCAL_CLANG := true
Yabin Cuiffaa9122016-01-15 15:25:48 -0800370LOCAL_MODULE := simpleperf_cpu_hotplug_test
371LOCAL_MODULE_HOST_OS := linux
372LOCAL_CPPFLAGS := $(simpleperf_cppflags_host)
373LOCAL_CPPFLAGS_linux := $(simpleperf_cppflags_host_linux)
Yabin Cui89905b72015-12-07 20:14:14 -0800374LOCAL_SRC_FILES := $(simpleperf_cpu_hotplug_test_src_files)
Yabin Cuiff7465c2016-02-25 11:02:30 -0800375LOCAL_STATIC_LIBRARIES := libsimpleperf $(simpleperf_static_libraries_host)
Yabin Cui040f7b42016-04-13 21:28:54 -0700376LOCAL_STATIC_LIBRARIES_linux := $(simpleperf_static_libraries_host_linux)
Yabin Cuiffaa9122016-01-15 15:25:48 -0800377LOCAL_LDLIBS_linux := $(simpleperf_ldlibs_host_linux)
Yabin Cui89905b72015-12-07 20:14:14 -0800378LOCAL_MULTILIB := first
Yabin Cui040f7b42016-04-13 21:28:54 -0700379include $(LLVM_HOST_BUILD_MK)
Yabin Cui89905b72015-12-07 20:14:14 -0800380include $(BUILD_HOST_NATIVE_TEST)
Yabin Cui89905b72015-12-07 20:14:14 -0800381
Yabin Cuibe7ec662016-03-02 13:56:28 -0800382
383# libsimpleperf_cts_test
384# =========================================================
385libsimpleperf_cts_test_src_files := \
386 $(libsimpleperf_src_files) \
387 $(libsimpleperf_src_files_linux) \
388 $(simpleperf_unit_test_src_files) \
389 $(simpleperf_unit_test_src_files_linux) \
390
391# libsimpleperf_cts_test target
392include $(CLEAR_VARS)
393LOCAL_CLANG := true
394LOCAL_MODULE := libsimpleperf_cts_test
Yabin Cuif560a6f2016-12-14 17:43:26 -0800395LOCAL_CPPFLAGS := $(simpleperf_cppflags_target) -DRUN_IN_APP_CONTEXT
Yabin Cuibe7ec662016-03-02 13:56:28 -0800396LOCAL_SRC_FILES := $(libsimpleperf_cts_test_src_files)
397LOCAL_STATIC_LIBRARIES := $(simpleperf_static_libraries_target)
Yabin Cuibe7ec662016-03-02 13:56:28 -0800398LOCAL_MULTILIB := both
Yabin Cui33754212016-04-14 16:35:00 -0700399LOCAL_FORCE_STATIC_EXECUTABLE := true
Yabin Cuibe7ec662016-03-02 13:56:28 -0800400include $(LLVM_DEVICE_BUILD_MK)
401include $(BUILD_STATIC_TEST_LIBRARY)
402
403# libsimpleperf_cts_test linux host
404include $(CLEAR_VARS)
405LOCAL_CLANG := true
406LOCAL_MODULE := libsimpleperf_cts_test
407LOCAL_MODULE_HOST_OS := linux
Yabin Cui6acf8c62016-03-18 13:48:42 -0700408LOCAL_CPPFLAGS := $(simpleperf_cppflags_host)
Yabin Cuibe7ec662016-03-02 13:56:28 -0800409LOCAL_CPPFLAGS_linux := $(simpleperf_cppflags_host_linux)
410LOCAL_SRC_FILES := $(libsimpleperf_cts_test_src_files)
411LOCAL_STATIC_LIBRARIES := $(simpleperf_static_libraries_host)
Yabin Cui040f7b42016-04-13 21:28:54 -0700412LOCAL_STATIC_LIBRARIES_linux := $(simpleperf_static_libraries_host_linux)
Yabin Cuibe7ec662016-03-02 13:56:28 -0800413LOCAL_LDLIBS_linux := $(simpleperf_ldlibs_host_linux)
414LOCAL_MULTILIB := both
415include $(LLVM_HOST_BUILD_MK)
416include $(BUILD_HOST_STATIC_TEST_LIBRARY)
417
Christopher Ferris860a8582016-01-25 16:21:54 -0800418include $(call first-makefiles-under,$(LOCAL_PATH))