Android.mk revision 486d1cf358a5589263ac509ca513a30251bf20d6
1# Copyright (C) 2017 The Android Open Source Project
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#      http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15LOCAL_PATH:= $(call my-dir)
16
17# =========
18# statsd
19# =========
20
21include $(CLEAR_VARS)
22
23LOCAL_MODULE := statsd
24
25LOCAL_SRC_FILES := \
26    ../../core/java/android/os/IStatsManager.aidl \
27    ../../core/java/android/os/IStatsCompanionService.aidl \
28    src/StatsService.cpp \
29    src/AnomalyMonitor.cpp \
30    src/LogEntryPrinter.cpp \
31    src/LogReader.cpp \
32    src/main.cpp
33
34LOCAL_CFLAGS += \
35    -Wall \
36    -Werror \
37    -Wno-missing-field-initializers \
38    -Wno-unused-variable \
39    -Wno-unused-function \
40    -Wno-unused-parameter
41
42ifeq (debug,)
43    LOCAL_CFLAGS += \
44            -g -O0
45else
46    # optimize for size (protobuf glop can get big)
47    LOCAL_CFLAGS += \
48            -Os
49endif
50
51LOCAL_AIDL_INCLUDES := $(LOCAL_PATH)/../../core/java
52LOCAL_C_INCLUDES += $(LOCAL_PATH)/src
53
54LOCAL_SHARED_LIBRARIES := \
55        libbase \
56        libbinder \
57        libcutils \
58        libincident \
59        liblog \
60        libselinux \
61        libutils
62
63LOCAL_MODULE_CLASS := EXECUTABLES
64
65#LOCAL_INIT_RC := statsd.rc
66
67include $(BUILD_EXECUTABLE)
68
69# ==============
70# statsd_test
71# ==============
72
73include $(CLEAR_VARS)
74
75LOCAL_MODULE := statsd_test
76LOCAL_COMPATIBILITY_SUITE := device-tests
77LOCAL_MODULE_TAGS := tests
78
79LOCAL_CFLAGS += \
80    -Wall \
81    -Werror \
82    -Wno-missing-field-initializers \
83    -Wno-unused-variable \
84    -Wno-unused-function \
85    -Wno-unused-parameter
86
87LOCAL_C_INCLUDES += $(LOCAL_PATH)/src
88
89LOCAL_SRC_FILES := \
90    ../../core/java/android/os/IStatsManager.aidl \
91    src/StatsService.cpp \
92    src/LogEntryPrinter.cpp \
93    src/LogReader.cpp \
94    tests/LogReader_test.cpp \
95
96LOCAL_STATIC_LIBRARIES := \
97    libgmock \
98
99LOCAL_SHARED_LIBRARIES := \
100    libbase \
101    libbinder \
102    libcutils \
103    liblog \
104    libselinux \
105    libutils
106
107include $(BUILD_NATIVE_TEST)
108
109