blob: 5289976c6a9ad345a8c0a54f1c161e2bb379d189 [file] [log] [blame]
Dan Willemsena852f952018-01-08 13:50:55 -08001cc_defaults {
2 name: "toolbox_defaults",
3
4 cflags: [
5 "-Werror",
6 "-Wno-unused-parameter",
7 "-Wno-unused-const-variable",
Elliott Hughes16b82b72018-01-22 16:15:55 -08008 "-D_FILE_OFFSET_BITS=64",
Elliott Hughes21ceafb2018-04-20 17:46:03 -07009 "-DWITHOUT_NLS",
Elliott Hughes720c1ec2019-03-28 14:29:00 -070010 "-DWITHOUT_BZ2",
11 "-DWITHOUT_GZIP",
Yifan Hong49641ba2017-05-22 18:08:02 -070012 ],
Dan Willemsena852f952018-01-08 13:50:55 -080013}
14
15genrule {
Dan Willemsena852f952018-01-08 13:50:55 -080016 name: "toolbox_input_labels",
17 tool_files: ["generate-input.h-labels.py"],
18 cmd: "$(location) $(in) >$(out)",
19 srcs: [":kernel_input_headers"],
20 out: ["input.h-labels.h"],
21}
22
Tom Cherry6fb3dca2018-01-09 13:20:08 -080023cc_defaults {
24 name: "toolbox_binary_defaults",
Dan Willemsena852f952018-01-08 13:50:55 -080025 defaults: ["toolbox_defaults"],
Tom Cherry91094e02018-01-02 11:50:16 -080026 cpp_std: "experimental",
Dan Willemsena852f952018-01-08 13:50:55 -080027 srcs: [
28 "toolbox.c",
29 "getevent.c",
Tom Cherry91094e02018-01-02 11:50:16 -080030 "getprop.cpp",
Dan Willemsena852f952018-01-08 13:50:55 -080031 ],
32 generated_headers: [
Dan Willemsena852f952018-01-08 13:50:55 -080033 "toolbox_input_labels",
34 ],
Dan Willemsena852f952018-01-08 13:50:55 -080035 shared_libs: [
Tom Cherry91094e02018-01-02 11:50:16 -080036 "libbase",
Dan Willemsena852f952018-01-08 13:50:55 -080037 ],
Tom Cherry91094e02018-01-02 11:50:16 -080038 static_libs: ["libpropertyinfoparser"],
Dan Willemsena852f952018-01-08 13:50:55 -080039
40 symlinks: [
Dan Willemsena852f952018-01-08 13:50:55 -080041 "getevent",
Tom Cherry91094e02018-01-02 11:50:16 -080042 "getprop",
Dan Willemsena852f952018-01-08 13:50:55 -080043 ],
44}
45
Tom Cherry6fb3dca2018-01-09 13:20:08 -080046cc_binary {
47 name: "toolbox",
48 defaults: ["toolbox_binary_defaults"],
Jiyong Park011ee122018-05-29 16:41:30 +090049 recovery_available: true,
Tom Cherry6fb3dca2018-01-09 13:20:08 -080050}
51
52cc_binary {
53 name: "toolbox_vendor",
54 stem: "toolbox",
55 vendor: true,
56 defaults: ["toolbox_binary_defaults"],
57}
58
Elliott Hughesf9408d52018-07-26 14:43:31 -070059// We build BSD grep separately (but see http://b/111849261).
Elliott Hughes8100d052018-08-01 10:35:46 -070060cc_defaults {
61 name: "grep_common",
Elliott Hughesf9408d52018-07-26 14:43:31 -070062 defaults: ["toolbox_defaults"],
63 srcs: [
64 "upstream-netbsd/usr.bin/grep/fastgrep.c",
65 "upstream-netbsd/usr.bin/grep/file.c",
66 "upstream-netbsd/usr.bin/grep/grep.c",
67 "upstream-netbsd/usr.bin/grep/queue.c",
68 "upstream-netbsd/usr.bin/grep/util.c",
69 ],
Elliott Hughes8100d052018-08-01 10:35:46 -070070 symlinks: [
71 "egrep",
72 "fgrep",
73 ],
Elliott Hughesf9408d52018-07-26 14:43:31 -070074 sanitize: {
75 integer_overflow: false,
76 },
77}
Elliott Hughes8100d052018-08-01 10:35:46 -070078
79cc_binary {
80 name: "grep",
81 defaults: ["grep_common"],
82 recovery_available: true,
83}
84
85// Build vendor grep.
86// TODO: Add vendor_available to "grep" module and remove "grep_vendor" module
87// when vendor_available is fully supported.
88cc_binary {
89 name: "grep_vendor",
90 stem: "grep",
91 vendor: true,
92 defaults: ["grep_common"],
93}