blob: 9ca56073d5a026d54f4b6f9e9c9483509911cd35 [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",
Tom Cherry65a1ee82019-06-05 10:26:54 -070031 "setprop.cpp",
32 "start.cpp",
Dan Willemsena852f952018-01-08 13:50:55 -080033 ],
34 generated_headers: [
Dan Willemsena852f952018-01-08 13:50:55 -080035 "toolbox_input_labels",
36 ],
Dan Willemsena852f952018-01-08 13:50:55 -080037 shared_libs: [
Tom Cherry91094e02018-01-02 11:50:16 -080038 "libbase",
Dan Willemsena852f952018-01-08 13:50:55 -080039 ],
Tom Cherry91094e02018-01-02 11:50:16 -080040 static_libs: ["libpropertyinfoparser"],
Dan Willemsena852f952018-01-08 13:50:55 -080041
42 symlinks: [
Dan Willemsena852f952018-01-08 13:50:55 -080043 "getevent",
Tom Cherry91094e02018-01-02 11:50:16 -080044 "getprop",
Tom Cherry65a1ee82019-06-05 10:26:54 -070045 "setprop",
46 "start",
47 "stop",
Dan Willemsena852f952018-01-08 13:50:55 -080048 ],
49}
50
Tom Cherry6fb3dca2018-01-09 13:20:08 -080051cc_binary {
52 name: "toolbox",
53 defaults: ["toolbox_binary_defaults"],
Jiyong Park011ee122018-05-29 16:41:30 +090054 recovery_available: true,
Tom Cherry6fb3dca2018-01-09 13:20:08 -080055}
56
57cc_binary {
58 name: "toolbox_vendor",
59 stem: "toolbox",
60 vendor: true,
61 defaults: ["toolbox_binary_defaults"],
62}
63
Elliott Hughesf9408d52018-07-26 14:43:31 -070064// We build BSD grep separately (but see http://b/111849261).
Elliott Hughes8100d052018-08-01 10:35:46 -070065cc_defaults {
66 name: "grep_common",
Elliott Hughesf9408d52018-07-26 14:43:31 -070067 defaults: ["toolbox_defaults"],
68 srcs: [
69 "upstream-netbsd/usr.bin/grep/fastgrep.c",
70 "upstream-netbsd/usr.bin/grep/file.c",
71 "upstream-netbsd/usr.bin/grep/grep.c",
72 "upstream-netbsd/usr.bin/grep/queue.c",
73 "upstream-netbsd/usr.bin/grep/util.c",
74 ],
Elliott Hughes8100d052018-08-01 10:35:46 -070075 symlinks: [
76 "egrep",
77 "fgrep",
78 ],
Elliott Hughesf9408d52018-07-26 14:43:31 -070079 sanitize: {
80 integer_overflow: false,
81 },
82}
Elliott Hughes8100d052018-08-01 10:35:46 -070083
84cc_binary {
85 name: "grep",
86 defaults: ["grep_common"],
87 recovery_available: true,
88}
89
90// Build vendor grep.
91// TODO: Add vendor_available to "grep" module and remove "grep_vendor" module
92// when vendor_available is fully supported.
93cc_binary {
94 name: "grep_vendor",
95 stem: "grep",
96 vendor: true,
97 defaults: ["grep_common"],
98}