blob: f08cf937bb403831539b0b86cc9efcc10c77ae22 [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",
Yifan Hong49641ba2017-05-22 18:08:02 -070010 ],
Dan Willemsena852f952018-01-08 13:50:55 -080011}
12
13genrule {
Dan Willemsena852f952018-01-08 13:50:55 -080014 name: "toolbox_input_labels",
15 tool_files: ["generate-input.h-labels.py"],
16 cmd: "$(location) $(in) >$(out)",
17 srcs: [":kernel_input_headers"],
18 out: ["input.h-labels.h"],
19}
20
Tom Cherry6fb3dca2018-01-09 13:20:08 -080021cc_defaults {
22 name: "toolbox_binary_defaults",
Dan Willemsena852f952018-01-08 13:50:55 -080023 defaults: ["toolbox_defaults"],
Tom Cherry91094e02018-01-02 11:50:16 -080024 cpp_std: "experimental",
Dan Willemsena852f952018-01-08 13:50:55 -080025 srcs: [
26 "toolbox.c",
27 "getevent.c",
Tom Cherry91094e02018-01-02 11:50:16 -080028 "getprop.cpp",
Dan Willemsena852f952018-01-08 13:50:55 -080029 ],
30 generated_headers: [
Dan Willemsena852f952018-01-08 13:50:55 -080031 "toolbox_input_labels",
32 ],
Dan Willemsena852f952018-01-08 13:50:55 -080033 shared_libs: [
Tom Cherry91094e02018-01-02 11:50:16 -080034 "libbase",
Dan Willemsena852f952018-01-08 13:50:55 -080035 ],
Tom Cherry91094e02018-01-02 11:50:16 -080036 static_libs: ["libpropertyinfoparser"],
Dan Willemsena852f952018-01-08 13:50:55 -080037
38 symlinks: [
Dan Willemsena852f952018-01-08 13:50:55 -080039 "getevent",
Tom Cherry91094e02018-01-02 11:50:16 -080040 "getprop",
Dan Willemsena852f952018-01-08 13:50:55 -080041 ],
42}
43
Tom Cherry6fb3dca2018-01-09 13:20:08 -080044cc_binary {
45 name: "toolbox",
46 defaults: ["toolbox_binary_defaults"],
Jiyong Park011ee122018-05-29 16:41:30 +090047 recovery_available: true,
Tom Cherry6fb3dca2018-01-09 13:20:08 -080048}
49
50cc_binary {
51 name: "toolbox_vendor",
52 stem: "toolbox",
53 vendor: true,
54 defaults: ["toolbox_binary_defaults"],
55}
56
Dan Willemsena852f952018-01-08 13:50:55 -080057// We only want 'r' on userdebug and eng builds.
58cc_binary {
59 name: "r",
60 defaults: ["toolbox_defaults"],
61 srcs: ["r.c"],
Yifan Hong49641ba2017-05-22 18:08:02 -070062}
Elliott Hughesf9408d52018-07-26 14:43:31 -070063
64// 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}