blob: d2030627408c0d05d9996235ee4019c48f395845 [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: [
Tom Cherryd5b38382020-05-12 13:16:41 -070035 "ChattyLogBuffer.cpp",
Steven Morelandfca20d82017-06-27 18:20:18 -070036 "CommandListener.cpp",
37 "LogListener.cpp",
Tom Cherry4e9bf952020-05-15 10:13:38 -070038 "LogPermissions.cpp",
Steven Morelandfca20d82017-06-27 18:20:18 -070039 "LogReader.cpp",
Tom Cherry68630a02020-05-11 16:29:29 -070040 "LogReaderList.cpp",
Tom Cherry6ec71e92020-05-04 12:53:36 -070041 "LogReaderThread.cpp",
Steven Morelandfca20d82017-06-27 18:20:18 -070042 "LogBufferElement.cpp",
Steven Morelandfca20d82017-06-27 18:20:18 -070043 "LogStatistics.cpp",
44 "LogWhiteBlackList.cpp",
45 "libaudit.c",
46 "LogAudit.cpp",
47 "LogKlog.cpp",
48 "LogTags.cpp",
49 ],
50 logtags: ["event.logtags"],
51
52 shared_libs: ["libbase"],
53
54 export_include_dirs: ["."],
55
Tom Cherry053daca2020-04-29 15:38:19 -070056 cflags: [
57 "-Wextra",
Tom Cherry64e90162020-05-07 14:44:43 -070058 "-Wthread-safety",
Tom Cherry053daca2020-04-29 15:38:19 -070059 ] + event_flag,
Tom Cherry72f1aa82020-05-13 11:03:08 -070060
61 lto: {
62 thin: true
63 }
Steven Morelandfca20d82017-06-27 18:20:18 -070064}
65
66cc_binary {
67 name: "logd",
68 init_rc: ["logd.rc"],
69
70 srcs: ["main.cpp"],
71
Tom Cherry9e124332019-01-17 11:37:22 -080072 static_libs: [
73 "liblog",
74 "liblogd",
75 ],
Steven Morelandfca20d82017-06-27 18:20:18 -070076
77 shared_libs: [
78 "libsysutils",
Steven Morelandfca20d82017-06-27 18:20:18 -070079 "libcutils",
80 "libbase",
81 "libpackagelistparser",
Suren Baghdasaryan94910782019-01-25 05:32:52 +000082 "libprocessgroup",
Steven Morelandfca20d82017-06-27 18:20:18 -070083 "libcap",
84 ],
85
Tom Cherry053daca2020-04-29 15:38:19 -070086 cflags: [
87 "-Wextra",
88 ],
Tom Cherry72f1aa82020-05-13 11:03:08 -070089
90 lto: {
91 thin: true
92 }
Steven Morelandfca20d82017-06-27 18:20:18 -070093}
Sasha Smundak3a62fc42019-01-24 21:16:39 -080094
Nick Kralevichbe5e4462019-04-09 10:59:39 -070095cc_binary {
96 name: "auditctl",
97
98 srcs: ["auditctl.cpp"],
99
100 static_libs: [
101 "liblogd",
102 ],
103
104 shared_libs: ["libbase"],
105
106 cflags: [
Tom Cherry053daca2020-04-29 15:38:19 -0700107 "-Wconversion",
Nick Kralevichbe5e4462019-04-09 10:59:39 -0700108 "-Wextra",
Nick Kralevichbe5e4462019-04-09 10:59:39 -0700109 ],
110}
Sasha Smundak3a62fc42019-01-24 21:16:39 -0800111
112prebuilt_etc {
113 name: "logtagd.rc",
114 src: "logtagd.rc",
115 sub_dir: "init",
116}