• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
15// This is what we want to do:
16//  event_logtags = $(shell
17//    sed -n
18//        "s/^\([0-9]*\)[ \t]*$1[ \t].*/-D`echo $1 | tr a-z A-Z`_LOG_TAG=\1/p"
19//        $(LOCAL_PATH)/$2/event.logtags)
20//  event_flag := $(call event_logtags,auditd)
21//  event_flag += $(call event_logtags,logd)
22//  event_flag += $(call event_logtags,tag_def)
23// so make sure we do not regret hard-coding it as follows:
24event_flag = [
25    "-DAUDITD_LOG_TAG=1003",
26    "-DCHATTY_LOG_TAG=1004",
27    "-DTAG_DEF_LOG_TAG=1005",
28    "-DLIBLOG_LOG_TAG=1006"
29]
30
31cc_library_static {
32    name: "liblogd",
33
34    srcs: [
35        "LogCommand.cpp",
36        "CommandListener.cpp",
37        "LogListener.cpp",
38        "LogReader.cpp",
39        "FlushCommand.cpp",
40        "LogBuffer.cpp",
41        "LogBufferElement.cpp",
42        "LogBufferInterface.cpp",
43        "LogTimes.cpp",
44        "LogStatistics.cpp",
45        "LogWhiteBlackList.cpp",
46        "libaudit.c",
47        "LogAudit.cpp",
48        "LogKlog.cpp",
49        "LogTags.cpp",
50    ],
51    logtags: ["event.logtags"],
52
53    shared_libs: ["libbase"],
54
55    export_include_dirs: ["."],
56
57    cflags: ["-Werror"] + event_flag,
58}
59
60cc_binary {
61    name: "logd",
62    init_rc: ["logd.rc"],
63
64    srcs: ["main.cpp"],
65
66    static_libs: ["liblogd"],
67
68    shared_libs: [
69        "libsysutils",
70        "liblog",
71        "libcutils",
72        "libbase",
73        "libpackagelistparser",
74        "libcap",
75    ],
76
77    cflags: ["-Werror"],
78}
79