summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bootstat/Android.bp94
-rw-r--r--bootstat/Android.mk141
-rw-r--r--libmemunreachable/Android.bp80
-rw-r--r--libmemunreachable/Android.mk65
-rw-r--r--libsync/Android.bp42
-rw-r--r--libsync/Android.mk30
-rw-r--r--libsync/tests/Android.mk29
7 files changed, 216 insertions, 265 deletions
diff --git a/bootstat/Android.bp b/bootstat/Android.bp
new file mode 100644
index 000000000..89b459865
--- /dev/null
+++ b/bootstat/Android.bp
@@ -0,0 +1,94 @@
1//
2// Copyright (C) 2016 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//
16
17bootstat_lib_src_files = [
18 "boot_event_record_store.cpp",
19 "event_log_list_builder.cpp",
20 "histogram_logger.cpp",
21 "uptime_parser.cpp",
22]
23
24cc_defaults {
25 name: "bootstat_defaults",
26
27 cflags: [
28 "-Wall",
29 "-Wextra",
30 "-Werror",
31
32 // 524291 corresponds to sysui_histogram, from
33 // frameworks/base/core/java/com/android/internal/logging/EventLogTags.logtags
34 "-DHISTOGRAM_LOG_TAG=524291",
35 ],
36 shared_libs: [
37 "libbase",
38 "libcutils",
39 "liblog",
40 ],
41 whole_static_libs: ["libgtest_prod"],
42 // Clang is required because of C++14
43 clang: true,
44}
45
46// bootstat static library
47// -----------------------------------------------------------------------------
48cc_library_static {
49 name: "libbootstat",
50 defaults: ["bootstat_defaults"],
51 srcs: bootstat_lib_src_files,
52}
53
54// bootstat static library, debug
55// -----------------------------------------------------------------------------
56cc_library_static {
57 name: "libbootstat_debug",
58 defaults: ["bootstat_defaults"],
59 host_supported: true,
60 srcs: bootstat_lib_src_files,
61
62 target: {
63 host: {
64 cflags: ["-UNDEBUG"],
65 },
66 },
67}
68
69// bootstat binary
70// -----------------------------------------------------------------------------
71cc_binary {
72 name: "bootstat",
73 defaults: ["bootstat_defaults"],
74 static_libs: ["libbootstat"],
75 init_rc: ["bootstat.rc"],
76 srcs: ["bootstat.cpp"],
77}
78
79// Native tests
80// -----------------------------------------------------------------------------
81cc_test {
82 name: "bootstat_tests",
83 defaults: ["bootstat_defaults"],
84 host_supported: true,
85 static_libs: [
86 "libbootstat_debug",
87 "libgmock",
88 ],
89 srcs: [
90 "boot_event_record_store_test.cpp",
91 "event_log_list_builder_test.cpp",
92 "testrunner.cpp",
93 ],
94}
diff --git a/bootstat/Android.mk b/bootstat/Android.mk
deleted file mode 100644
index bdd680d21..000000000
--- a/bootstat/Android.mk
+++ /dev/null
@@ -1,141 +0,0 @@
1#
2# Copyright (C) 2016 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#
16
17LOCAL_PATH := $(call my-dir)
18
19bootstat_lib_src_files := \
20 boot_event_record_store.cpp \
21 event_log_list_builder.cpp \
22 histogram_logger.cpp \
23 uptime_parser.cpp \
24
25bootstat_src_files := \
26 bootstat.cpp \
27
28bootstat_test_src_files := \
29 boot_event_record_store_test.cpp \
30 event_log_list_builder_test.cpp \
31 testrunner.cpp \
32
33bootstat_shared_libs := \
34 libbase \
35 libcutils \
36 liblog \
37
38bootstat_cflags := \
39 -Wall \
40 -Wextra \
41 -Werror \
42
43# 524291 corresponds to sysui_histogram, from
44# frameworks/base/core/java/com/android/internal/logging/EventLogTags.logtags
45bootstat_cflags += -DHISTOGRAM_LOG_TAG=524291
46
47bootstat_debug_cflags := \
48 $(bootstat_cflags) \
49 -UNDEBUG \
50
51# bootstat static library
52# -----------------------------------------------------------------------------
53
54include $(CLEAR_VARS)
55
56LOCAL_MODULE := libbootstat
57LOCAL_CFLAGS := $(bootstat_cflags)
58LOCAL_WHOLE_STATIC_LIBRARIES := libgtest_prod
59LOCAL_SHARED_LIBRARIES := $(bootstat_shared_libs)
60LOCAL_SRC_FILES := $(bootstat_lib_src_files)
61# Clang is required because of C++14
62LOCAL_CLANG := true
63
64include $(BUILD_STATIC_LIBRARY)
65
66# bootstat static library, debug
67# -----------------------------------------------------------------------------
68
69include $(CLEAR_VARS)
70
71LOCAL_MODULE := libbootstat_debug
72LOCAL_CFLAGS := $(bootstat_cflags)
73LOCAL_WHOLE_STATIC_LIBRARIES := libgtest_prod
74LOCAL_SHARED_LIBRARIES := $(bootstat_shared_libs)
75LOCAL_SRC_FILES := $(bootstat_lib_src_files)
76# Clang is required because of C++14
77LOCAL_CLANG := true
78
79include $(BUILD_STATIC_LIBRARY)
80
81# bootstat host static library, debug
82# -----------------------------------------------------------------------------
83
84include $(CLEAR_VARS)
85
86LOCAL_MODULE := libbootstat_host_debug
87LOCAL_CFLAGS := $(bootstat_debug_cflags)
88LOCAL_WHOLE_STATIC_LIBRARIES := libgtest_prod
89LOCAL_SHARED_LIBRARIES := $(bootstat_shared_libs)
90LOCAL_SRC_FILES := $(bootstat_lib_src_files)
91# Clang is required because of C++14
92LOCAL_CLANG := true
93
94include $(BUILD_HOST_STATIC_LIBRARY)
95
96# bootstat binary
97# -----------------------------------------------------------------------------
98
99include $(CLEAR_VARS)
100
101LOCAL_MODULE := bootstat
102LOCAL_CFLAGS := $(bootstat_cflags)
103LOCAL_WHOLE_STATIC_LIBRARIES := libgtest_prod
104LOCAL_SHARED_LIBRARIES := $(bootstat_shared_libs)
105LOCAL_STATIC_LIBRARIES := libbootstat
106LOCAL_INIT_RC := bootstat.rc
107LOCAL_SRC_FILES := $(bootstat_src_files)
108# Clang is required because of C++14
109LOCAL_CLANG := true
110
111include $(BUILD_EXECUTABLE)
112
113# Native tests
114# -----------------------------------------------------------------------------
115
116include $(CLEAR_VARS)
117
118LOCAL_MODULE := bootstat_tests
119LOCAL_CFLAGS := $(bootstat_tests_cflags)
120LOCAL_SHARED_LIBRARIES := $(bootstat_shared_libs)
121LOCAL_STATIC_LIBRARIES := libbootstat_debug libgmock
122LOCAL_SRC_FILES := $(bootstat_test_src_files)
123# Clang is required because of C++14
124LOCAL_CLANG := true
125
126include $(BUILD_NATIVE_TEST)
127
128# Host native tests
129# -----------------------------------------------------------------------------
130
131include $(CLEAR_VARS)
132
133LOCAL_MODULE := bootstat_tests
134LOCAL_CFLAGS := $(bootstat_tests_cflags)
135LOCAL_SHARED_LIBRARIES := $(bootstat_shared_libs)
136LOCAL_STATIC_LIBRARIES := libbootstat_host_debug libgmock_host
137LOCAL_SRC_FILES := $(bootstat_test_src_files)
138# Clang is required because of C++14
139LOCAL_CLANG := true
140
141include $(BUILD_HOST_NATIVE_TEST)
diff --git a/libmemunreachable/Android.bp b/libmemunreachable/Android.bp
new file mode 100644
index 000000000..85bc421c3
--- /dev/null
+++ b/libmemunreachable/Android.bp
@@ -0,0 +1,80 @@
1cc_defaults {
2 name: "libmemunreachable_defaults",
3
4 cflags: [
5 "-std=c++14",
6 "-Wall",
7 "-Wextra",
8 "-Werror",
9 ],
10 clang: true,
11 shared_libs: [
12 "libbase",
13 "liblog",
14 ],
15}
16
17cc_library_shared {
18 name: "libmemunreachable",
19 defaults: ["libmemunreachable_defaults"],
20 srcs: [
21 "Allocator.cpp",
22 "HeapWalker.cpp",
23 "LeakFolding.cpp",
24 "LeakPipe.cpp",
25 "LineBuffer.cpp",
26 "MemUnreachable.cpp",
27 "ProcessMappings.cpp",
28 "PtracerThread.cpp",
29 "ThreadCapture.cpp",
30 ],
31
32 static_libs: [
33 "libc_malloc_debug_backtrace",
34 "libc_logging",
35 ],
36 // Only need this for arm since libc++ uses its own unwind code that
37 // doesn't mix with the other default unwind code.
38 arch: {
39 arm: {
40 static_libs: ["libunwind_llvm"],
41 },
42 },
43 export_include_dirs: ["include"],
44 local_include_dirs: ["include"],
45}
46
47cc_test {
48 name: "memunreachable_test",
49 defaults: ["libmemunreachable_defaults"],
50 host_supported: true,
51 srcs: [
52 "tests/Allocator_test.cpp",
53 "tests/HeapWalker_test.cpp",
54 "tests/LeakFolding_test.cpp",
55 ],
56
57 target: {
58 android: {
59 srcs: [
60 "tests/DisableMalloc_test.cpp",
61 "tests/MemUnreachable_test.cpp",
62 "tests/ThreadCapture_test.cpp",
63 ],
64 shared_libs: [
65 "libmemunreachable",
66 ],
67 },
68 host: {
69 srcs: [
70 "Allocator.cpp",
71 "HeapWalker.cpp",
72 "LeakFolding.cpp",
73 "tests/HostMallocStub.cpp",
74 ],
75 },
76 darwin: {
77 enabled: false,
78 },
79 },
80}
diff --git a/libmemunreachable/Android.mk b/libmemunreachable/Android.mk
deleted file mode 100644
index 7b66d4401..000000000
--- a/libmemunreachable/Android.mk
+++ /dev/null
@@ -1,65 +0,0 @@
1LOCAL_PATH := $(call my-dir)
2
3memunreachable_srcs := \
4 Allocator.cpp \
5 HeapWalker.cpp \
6 LeakFolding.cpp \
7 LeakPipe.cpp \
8 LineBuffer.cpp \
9 MemUnreachable.cpp \
10 ProcessMappings.cpp \
11 PtracerThread.cpp \
12 ThreadCapture.cpp \
13
14memunreachable_test_srcs := \
15 tests/Allocator_test.cpp \
16 tests/DisableMalloc_test.cpp \
17 tests/HeapWalker_test.cpp \
18 tests/LeakFolding_test.cpp \
19 tests/MemUnreachable_test.cpp \
20 tests/ThreadCapture_test.cpp \
21
22include $(CLEAR_VARS)
23
24LOCAL_MODULE := libmemunreachable
25LOCAL_SRC_FILES := $(memunreachable_srcs)
26LOCAL_CFLAGS := -std=c++14 -Wall -Wextra -Werror
27LOCAL_SHARED_LIBRARIES := libbase liblog
28LOCAL_STATIC_LIBRARIES := libc_malloc_debug_backtrace libc_logging
29# Only need this for arm since libc++ uses its own unwind code that
30# doesn't mix with the other default unwind code.
31LOCAL_STATIC_LIBRARIES_arm := libunwind_llvm
32LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
33LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
34LOCAL_CLANG := true
35
36include $(BUILD_SHARED_LIBRARY)
37
38include $(CLEAR_VARS)
39
40LOCAL_MODULE := memunreachable_test
41LOCAL_SRC_FILES := $(memunreachable_test_srcs)
42LOCAL_CFLAGS := -std=c++14 -Wall -Wextra -Werror
43LOCAL_CLANG := true
44LOCAL_SHARED_LIBRARIES := libmemunreachable libbase liblog
45
46include $(BUILD_NATIVE_TEST)
47
48include $(CLEAR_VARS)
49
50LOCAL_MODULE := memunreachable_test
51LOCAL_SRC_FILES := \
52 Allocator.cpp \
53 HeapWalker.cpp \
54 LeakFolding.cpp \
55 tests/Allocator_test.cpp \
56 tests/HeapWalker_test.cpp \
57 tests/HostMallocStub.cpp \
58 tests/LeakFolding_test.cpp \
59
60LOCAL_CFLAGS := -std=c++14 -Wall -Wextra -Werror
61LOCAL_CLANG := true
62LOCAL_SHARED_LIBRARIES := libbase liblog
63LOCAL_MODULE_HOST_OS := linux
64
65include $(BUILD_HOST_NATIVE_TEST)
diff --git a/libsync/Android.bp b/libsync/Android.bp
new file mode 100644
index 000000000..4948aa524
--- /dev/null
+++ b/libsync/Android.bp
@@ -0,0 +1,42 @@
1cc_defaults {
2 name: "libsync_defaults",
3 srcs: ["sync.c"],
4 local_include_dirs: ["include"],
5 export_include_dirs: ["include"],
6 cflags: ["-Werror"],
7}
8
9cc_library_shared {
10 name: "libsync",
11 defaults: ["libsync_defaults"],
12}
13
14// libsync_recovery is only intended for the recovery binary.
15// Future versions of the kernel WILL require an updated libsync, and will break
16// anything statically linked against the current libsync.
17cc_library_static {
18 name: "libsync_recovery",
19 defaults: ["libsync_defaults"],
20}
21
22cc_test {
23 name: "sync_test",
24 defaults: ["libsync_defaults"],
25 gtest: false,
26 srcs: ["sync_test.c"],
27}
28
29cc_test {
30 name: "sync-unit-tests",
31 shared_libs: ["libsync"],
32 srcs: ["tests/sync_test.cpp"],
33 cflags: [
34 "-g",
35 "-Wall",
36 "-Werror",
37 "-std=gnu++11",
38 "-Wno-missing-field-initializers",
39 "-Wno-sign-compare",
40 ],
41 clang: true,
42}
diff --git a/libsync/Android.mk b/libsync/Android.mk
deleted file mode 100644
index f407bd119..000000000
--- a/libsync/Android.mk
+++ /dev/null
@@ -1,30 +0,0 @@
1LOCAL_PATH:= $(call my-dir)
2
3include $(CLEAR_VARS)
4LOCAL_SRC_FILES := sync.c
5LOCAL_MODULE := libsync
6LOCAL_MODULE_TAGS := optional
7LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
8LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
9LOCAL_CFLAGS := -Werror
10include $(BUILD_SHARED_LIBRARY)
11
12# libsync_recovery is only intended for the recovery binary.
13# Future versions of the kernel WILL require an updated libsync, and will break
14# anything statically linked against the current libsync.
15include $(CLEAR_VARS)
16LOCAL_SRC_FILES := sync.c
17LOCAL_MODULE := libsync_recovery
18LOCAL_MODULE_TAGS := optional
19LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
20LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
21LOCAL_CFLAGS := -Werror
22include $(BUILD_STATIC_LIBRARY)
23
24include $(CLEAR_VARS)
25LOCAL_SRC_FILES := sync.c sync_test.c
26LOCAL_MODULE := sync_test
27LOCAL_MODULE_TAGS := optional tests
28LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
29LOCAL_CFLAGS := -Werror
30include $(BUILD_EXECUTABLE)
diff --git a/libsync/tests/Android.mk b/libsync/tests/Android.mk
deleted file mode 100644
index 8137c7af6..000000000
--- a/libsync/tests/Android.mk
+++ /dev/null
@@ -1,29 +0,0 @@
1#
2# Copyright 2014 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#
16
17LOCAL_PATH:= $(call my-dir)
18
19include $(CLEAR_VARS)
20LOCAL_CLANG := true
21LOCAL_MODULE := sync-unit-tests
22LOCAL_CFLAGS += -g -Wall -Werror -std=gnu++11 -Wno-missing-field-initializers -Wno-sign-compare
23LOCAL_SHARED_LIBRARIES += libsync
24LOCAL_STATIC_LIBRARIES += libgtest_main
25LOCAL_C_INCLUDES += $(LOCAL_PATH)/../include
26LOCAL_C_INCLUDES += $(LOCAL_PATH)/..
27LOCAL_SRC_FILES := \
28 sync_test.cpp
29include $(BUILD_NATIVE_TEST)