blob: e75e4afcc9ea1f9c7d259c4dafcd208db5981419 [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).
65cc_binary {
66 name: "grep",
67 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 ],
75
76 sanitize: {
77 integer_overflow: false,
78 },
79}