blob: 232dd63327a6588cc3c7a84c8809764a2d1455a2 [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 "newfs_msdos.c",
30 ],
31 generated_headers: [
Dan Willemsena852f952018-01-08 13:50:55 -080032 "toolbox_input_labels",
33 ],
Dan Willemsena852f952018-01-08 13:50:55 -080034 shared_libs: [
Tom Cherry91094e02018-01-02 11:50:16 -080035 "libbase",
Dan Willemsena852f952018-01-08 13:50:55 -080036 ],
Tom Cherry91094e02018-01-02 11:50:16 -080037 static_libs: ["libpropertyinfoparser"],
Dan Willemsena852f952018-01-08 13:50:55 -080038
39 symlinks: [
Dan Willemsena852f952018-01-08 13:50:55 -080040 "getevent",
Tom Cherry91094e02018-01-02 11:50:16 -080041 "getprop",
Dan Willemsena852f952018-01-08 13:50:55 -080042 "newfs_msdos",
43 ],
44}
45
Tom Cherry6fb3dca2018-01-09 13:20:08 -080046cc_binary {
47 name: "toolbox",
48 defaults: ["toolbox_binary_defaults"],
49}
50
51cc_binary {
52 name: "toolbox_vendor",
53 stem: "toolbox",
54 vendor: true,
55 defaults: ["toolbox_binary_defaults"],
56}
57
Dan Willemsena852f952018-01-08 13:50:55 -080058// We only want 'r' on userdebug and eng builds.
59cc_binary {
60 name: "r",
61 defaults: ["toolbox_defaults"],
62 srcs: ["r.c"],
Yifan Hong49641ba2017-05-22 18:08:02 -070063}
64
65// We build BSD grep separately, so it can provide egrep and fgrep too.
Erik Staats0c3b1bd2017-06-09 09:10:59 -070066cc_defaults {
67 name: "grep_common",
Dan Willemsena852f952018-01-08 13:50:55 -080068 defaults: ["toolbox_defaults"],
Yifan Hong49641ba2017-05-22 18:08:02 -070069 srcs: [
70 "upstream-netbsd/usr.bin/grep/fastgrep.c",
71 "upstream-netbsd/usr.bin/grep/file.c",
72 "upstream-netbsd/usr.bin/grep/grep.c",
73 "upstream-netbsd/usr.bin/grep/queue.c",
74 "upstream-netbsd/usr.bin/grep/util.c",
75 ],
Dan Willemsena852f952018-01-08 13:50:55 -080076 symlinks: [
77 "egrep",
78 "fgrep",
79 ],
Ivan Lozanof4dafbc2017-11-13 14:06:08 -080080
81 sanitize: {
82 integer_overflow: false,
83 },
Erik Staats0c3b1bd2017-06-09 09:10:59 -070084}
Yifan Hong49641ba2017-05-22 18:08:02 -070085
Erik Staats0c3b1bd2017-06-09 09:10:59 -070086cc_binary {
87 name: "grep",
88 defaults: ["grep_common"],
89}
90
91// Build vendor grep.
92// TODO: Add vendor_available to "grep" module and remove "grep_vendor" module
93// when vendor_available is fully supported.
94cc_binary {
95 name: "grep_vendor",
96 stem: "grep",
97 vendor: true,
98 defaults: ["grep_common"],
Yifan Hong49641ba2017-05-22 18:08:02 -070099}