blob: 1f852ff2aa209d4f0c5f837ba441846c7b218340 [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
Dan Willemsena852f952018-01-08 13:50:55 -080059// We only want 'r' on userdebug and eng builds.
60cc_binary {
61 name: "r",
62 defaults: ["toolbox_defaults"],
63 srcs: ["r.c"],
Petri Gynther7c71e062019-03-01 14:01:00 -080064 vendor_available: true,
Yifan Hong49641ba2017-05-22 18:08:02 -070065}
Elliott Hughesf9408d52018-07-26 14:43:31 -070066
67// We build BSD grep separately (but see http://b/111849261).
Elliott Hughes8100d052018-08-01 10:35:46 -070068cc_defaults {
69 name: "grep_common",
Elliott Hughesf9408d52018-07-26 14:43:31 -070070 defaults: ["toolbox_defaults"],
71 srcs: [
72 "upstream-netbsd/usr.bin/grep/fastgrep.c",
73 "upstream-netbsd/usr.bin/grep/file.c",
74 "upstream-netbsd/usr.bin/grep/grep.c",
75 "upstream-netbsd/usr.bin/grep/queue.c",
76 "upstream-netbsd/usr.bin/grep/util.c",
77 ],
Elliott Hughes8100d052018-08-01 10:35:46 -070078 symlinks: [
79 "egrep",
80 "fgrep",
81 ],
Elliott Hughesf9408d52018-07-26 14:43:31 -070082 sanitize: {
83 integer_overflow: false,
84 },
85}
Elliott Hughes8100d052018-08-01 10:35:46 -070086
87cc_binary {
88 name: "grep",
89 defaults: ["grep_common"],
90 recovery_available: true,
91}
92
93// Build vendor grep.
94// TODO: Add vendor_available to "grep" module and remove "grep_vendor" module
95// when vendor_available is fully supported.
96cc_binary {
97 name: "grep_vendor",
98 stem: "grep",
99 vendor: true,
100 defaults: ["grep_common"],
101}