Steven Moreland | fca20d8 | 2017-06-27 18:20:18 -0700 | [diff] [blame] | 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: |
| 24 | event_flag = [ |
| 25 | "-DAUDITD_LOG_TAG=1003", |
| 26 | "-DCHATTY_LOG_TAG=1004", |
| 27 | "-DTAG_DEF_LOG_TAG=1005", |
Elliott Hughes | dc699a2 | 2018-02-16 17:58:14 -0800 | [diff] [blame] | 28 | "-DLIBLOG_LOG_TAG=1006", |
Steven Moreland | fca20d8 | 2017-06-27 18:20:18 -0700 | [diff] [blame] | 29 | ] |
| 30 | |
| 31 | cc_library_static { |
| 32 | name: "liblogd", |
| 33 | |
| 34 | srcs: [ |
| 35 | "LogCommand.cpp", |
| 36 | "CommandListener.cpp", |
| 37 | "LogListener.cpp", |
| 38 | "LogReader.cpp", |
Tom Cherry | 6ec71e9 | 2020-05-04 12:53:36 -0700 | [diff] [blame] | 39 | "LogReaderThread.cpp", |
Steven Moreland | fca20d8 | 2017-06-27 18:20:18 -0700 | [diff] [blame] | 40 | "LogBuffer.cpp", |
| 41 | "LogBufferElement.cpp", |
Steven Moreland | fca20d8 | 2017-06-27 18:20:18 -0700 | [diff] [blame] | 42 | "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 | |
Tom Cherry | 053daca | 2020-04-29 15:38:19 -0700 | [diff] [blame] | 55 | cflags: [ |
| 56 | "-Wextra", |
Tom Cherry | 64e9016 | 2020-05-07 14:44:43 -0700 | [diff] [blame^] | 57 | "-Wthread-safety", |
Tom Cherry | 053daca | 2020-04-29 15:38:19 -0700 | [diff] [blame] | 58 | ] + event_flag, |
Steven Moreland | fca20d8 | 2017-06-27 18:20:18 -0700 | [diff] [blame] | 59 | } |
| 60 | |
| 61 | cc_binary { |
| 62 | name: "logd", |
| 63 | init_rc: ["logd.rc"], |
| 64 | |
| 65 | srcs: ["main.cpp"], |
| 66 | |
Tom Cherry | 9e12433 | 2019-01-17 11:37:22 -0800 | [diff] [blame] | 67 | static_libs: [ |
| 68 | "liblog", |
| 69 | "liblogd", |
| 70 | ], |
Steven Moreland | fca20d8 | 2017-06-27 18:20:18 -0700 | [diff] [blame] | 71 | |
| 72 | shared_libs: [ |
| 73 | "libsysutils", |
Steven Moreland | fca20d8 | 2017-06-27 18:20:18 -0700 | [diff] [blame] | 74 | "libcutils", |
| 75 | "libbase", |
| 76 | "libpackagelistparser", |
Suren Baghdasaryan | 9491078 | 2019-01-25 05:32:52 +0000 | [diff] [blame] | 77 | "libprocessgroup", |
Steven Moreland | fca20d8 | 2017-06-27 18:20:18 -0700 | [diff] [blame] | 78 | "libcap", |
| 79 | ], |
| 80 | |
Tom Cherry | 053daca | 2020-04-29 15:38:19 -0700 | [diff] [blame] | 81 | cflags: [ |
| 82 | "-Wextra", |
| 83 | ], |
Steven Moreland | fca20d8 | 2017-06-27 18:20:18 -0700 | [diff] [blame] | 84 | } |
Sasha Smundak | 3a62fc4 | 2019-01-24 21:16:39 -0800 | [diff] [blame] | 85 | |
Nick Kralevich | be5e446 | 2019-04-09 10:59:39 -0700 | [diff] [blame] | 86 | cc_binary { |
| 87 | name: "auditctl", |
| 88 | |
| 89 | srcs: ["auditctl.cpp"], |
| 90 | |
| 91 | static_libs: [ |
| 92 | "liblogd", |
| 93 | ], |
| 94 | |
| 95 | shared_libs: ["libbase"], |
| 96 | |
| 97 | cflags: [ |
Tom Cherry | 053daca | 2020-04-29 15:38:19 -0700 | [diff] [blame] | 98 | "-Wconversion", |
Nick Kralevich | be5e446 | 2019-04-09 10:59:39 -0700 | [diff] [blame] | 99 | "-Wextra", |
Nick Kralevich | be5e446 | 2019-04-09 10:59:39 -0700 | [diff] [blame] | 100 | ], |
| 101 | } |
Sasha Smundak | 3a62fc4 | 2019-01-24 21:16:39 -0800 | [diff] [blame] | 102 | |
| 103 | prebuilt_etc { |
| 104 | name: "logtagd.rc", |
| 105 | src: "logtagd.rc", |
| 106 | sub_dir: "init", |
| 107 | } |