• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
17 LOCAL_PATH := $(call my-dir)
18 
19 bootstat_c_includes := external/gtest/include
20 
21 bootstat_lib_src_files := \
22         boot_event_record_store.cpp \
23         event_log_list_builder.cpp \
24         histogram_logger.cpp \
25         uptime_parser.cpp \
26 
27 bootstat_src_files := \
28         bootstat.cpp \
29 
30 bootstat_test_src_files := \
31         boot_event_record_store_test.cpp \
32         event_log_list_builder_test.cpp \
33         testrunner.cpp \
34 
35 bootstat_shared_libs := \
36         libbase \
37         libcutils \
38         liblog \
39 
40 bootstat_cflags := \
41         -Wall \
42         -Wextra \
43         -Werror \
44 
45 # 524291 corresponds to sysui_histogram, from
46 # frameworks/base/core/java/com/android/internal/logging/EventLogTags.logtags
47 bootstat_cflags += -DHISTOGRAM_LOG_TAG=524291
48 
49 bootstat_debug_cflags := \
50         $(bootstat_cflags) \
51         -UNDEBUG \
52 
53 # bootstat static library
54 # -----------------------------------------------------------------------------
55 
56 include $(CLEAR_VARS)
57 
58 LOCAL_MODULE := libbootstat
59 LOCAL_CFLAGS := $(bootstat_cflags)
60 LOCAL_C_INCLUDES := $(bootstat_c_includes)
61 LOCAL_SHARED_LIBRARIES := $(bootstat_shared_libs)
62 LOCAL_SRC_FILES := $(bootstat_lib_src_files)
63 # Clang is required because of C++14
64 LOCAL_CLANG := true
65 
66 include $(BUILD_STATIC_LIBRARY)
67 
68 # bootstat static library, debug
69 # -----------------------------------------------------------------------------
70 
71 include $(CLEAR_VARS)
72 
73 LOCAL_MODULE := libbootstat_debug
74 LOCAL_CFLAGS := $(bootstat_cflags)
75 LOCAL_C_INCLUDES := $(bootstat_c_includes)
76 LOCAL_SHARED_LIBRARIES := $(bootstat_shared_libs)
77 LOCAL_SRC_FILES := $(bootstat_lib_src_files)
78 # Clang is required because of C++14
79 LOCAL_CLANG := true
80 
81 include $(BUILD_STATIC_LIBRARY)
82 
83 # bootstat host static library, debug
84 # -----------------------------------------------------------------------------
85 
86 include $(CLEAR_VARS)
87 
88 LOCAL_MODULE := libbootstat_host_debug
89 LOCAL_CFLAGS := $(bootstat_debug_cflags)
90 LOCAL_C_INCLUDES := $(bootstat_c_includes)
91 LOCAL_SHARED_LIBRARIES := $(bootstat_shared_libs)
92 LOCAL_SRC_FILES := $(bootstat_lib_src_files)
93 # Clang is required because of C++14
94 LOCAL_CLANG := true
95 
96 include $(BUILD_HOST_STATIC_LIBRARY)
97 
98 # bootstat binary
99 # -----------------------------------------------------------------------------
100 
101 include $(CLEAR_VARS)
102 
103 LOCAL_MODULE := bootstat
104 LOCAL_CFLAGS := $(bootstat_cflags)
105 LOCAL_C_INCLUDES := $(bootstat_c_includes)
106 LOCAL_SHARED_LIBRARIES := $(bootstat_shared_libs)
107 LOCAL_STATIC_LIBRARIES := libbootstat
108 LOCAL_INIT_RC := bootstat.rc
109 LOCAL_SRC_FILES := $(bootstat_src_files)
110 # Clang is required because of C++14
111 LOCAL_CLANG := true
112 
113 include $(BUILD_EXECUTABLE)
114 
115 # Native tests
116 # -----------------------------------------------------------------------------
117 
118 include $(CLEAR_VARS)
119 
120 LOCAL_MODULE := bootstat_tests
121 LOCAL_CFLAGS := $(bootstat_tests_cflags)
122 LOCAL_SHARED_LIBRARIES := $(bootstat_shared_libs)
123 LOCAL_STATIC_LIBRARIES := libbootstat_debug libgmock
124 LOCAL_SRC_FILES := $(bootstat_test_src_files)
125 # Clang is required because of C++14
126 LOCAL_CLANG := true
127 
128 include $(BUILD_NATIVE_TEST)
129 
130 # Host native tests
131 # -----------------------------------------------------------------------------
132 
133 include $(CLEAR_VARS)
134 
135 LOCAL_MODULE := bootstat_tests
136 LOCAL_CFLAGS := $(bootstat_tests_cflags)
137 LOCAL_SHARED_LIBRARIES := $(bootstat_shared_libs)
138 LOCAL_STATIC_LIBRARIES := libbootstat_host_debug libgmock_host
139 LOCAL_SRC_FILES := $(bootstat_test_src_files)
140 # Clang is required because of C++14
141 LOCAL_CLANG := true
142 
143 include $(BUILD_HOST_NATIVE_TEST)
144