blob: b6d30cde8fc89a0478bbab6e4f48337976ddbfd4 [file] [log] [blame]
Steven Morelandfca20d82017-06-27 18:20:18 -07001// 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",
Elliott Hughesdc699a22018-02-16 17:58:14 -080028 "-DLIBLOG_LOG_TAG=1006",
Steven Morelandfca20d82017-06-27 18:20:18 -070029]
30
31cc_library_static {
32 name: "liblogd",
33
34 srcs: [
35 "LogCommand.cpp",
36 "CommandListener.cpp",
37 "LogListener.cpp",
38 "LogReader.cpp",
Tom Cherry6ec71e92020-05-04 12:53:36 -070039 "LogReaderThread.cpp",
Steven Morelandfca20d82017-06-27 18:20:18 -070040 "LogBuffer.cpp",
41 "LogBufferElement.cpp",
Steven Morelandfca20d82017-06-27 18:20:18 -070042 "LogStatistics.cpp",
43 "LogWhiteBlackList.cpp",
44 "libaudit.c",
45 "LogAudit.cpp",
46 "LogKlog.cpp",
47 "LogTags.cpp",
48 ],
49 logtags: ["event.logtags"],
50
51 shared_libs: ["libbase"],
52
53 export_include_dirs: ["."],
54
55 cflags: ["-Werror"] + event_flag,
56}
57
58cc_binary {
59 name: "logd",
60 init_rc: ["logd.rc"],
61
62 srcs: ["main.cpp"],
63
Tom Cherry9e124332019-01-17 11:37:22 -080064 static_libs: [
65 "liblog",
66 "liblogd",
67 ],
Steven Morelandfca20d82017-06-27 18:20:18 -070068
69 shared_libs: [
70 "libsysutils",
Steven Morelandfca20d82017-06-27 18:20:18 -070071 "libcutils",
72 "libbase",
73 "libpackagelistparser",
Suren Baghdasaryan94910782019-01-25 05:32:52 +000074 "libprocessgroup",
Steven Morelandfca20d82017-06-27 18:20:18 -070075 "libcap",
76 ],
77
78 cflags: ["-Werror"],
79}
Sasha Smundak3a62fc42019-01-24 21:16:39 -080080
Nick Kralevichbe5e4462019-04-09 10:59:39 -070081cc_binary {
82 name: "auditctl",
83
84 srcs: ["auditctl.cpp"],
85
86 static_libs: [
87 "liblogd",
88 ],
89
90 shared_libs: ["libbase"],
91
92 cflags: [
93 "-Wall",
94 "-Wextra",
95 "-Werror",
96 "-Wconversion"
97 ],
98}
Sasha Smundak3a62fc42019-01-24 21:16:39 -080099
100prebuilt_etc {
101 name: "logtagd.rc",
102 src: "logtagd.rc",
103 sub_dir: "init",
104}