blob: 8db83276d7c1b3ab63dd3bf887a22b2c10607561 [file] [log] [blame]
Yifan Hong49641ba2017-05-22 18:08:02 -07001common_cflags = [
2 "-Werror",
3 "-Wno-unused-parameter",
4 "-Wno-unused-const-variable",
5 "-include bsd-compatibility.h"
6]
7
8cc_library_static {
9 srcs: [
10 "upstream-netbsd/bin/dd/args.c",
11 "upstream-netbsd/bin/dd/conv.c",
12 "upstream-netbsd/bin/dd/dd.c",
13 "upstream-netbsd/bin/dd/dd_hostops.c",
14 "upstream-netbsd/bin/dd/misc.c",
15 "upstream-netbsd/bin/dd/position.c",
16 "upstream-netbsd/lib/libc/gen/getbsize.c",
17 "upstream-netbsd/lib/libc/gen/humanize_number.c",
18 "upstream-netbsd/lib/libc/stdlib/strsuftoll.c",
19 "upstream-netbsd/lib/libc/string/swab.c",
20 "upstream-netbsd/lib/libutil/raise_default_signal.c",
21 ],
22 cflags: common_cflags + [
23 "-Dmain=dd_main",
24 "-DNO_CONV",
25 ],
26 local_include_dirs: ["upstream-netbsd/include/"],
27 name: "libtoolbox_dd",
28}
29
30// We build BSD grep separately, so it can provide egrep and fgrep too.
Erik Staats0c3b1bd2017-06-09 09:10:59 -070031cc_defaults {
32 name: "grep_common",
Yifan Hong49641ba2017-05-22 18:08:02 -070033 srcs: [
34 "upstream-netbsd/usr.bin/grep/fastgrep.c",
35 "upstream-netbsd/usr.bin/grep/file.c",
36 "upstream-netbsd/usr.bin/grep/grep.c",
37 "upstream-netbsd/usr.bin/grep/queue.c",
38 "upstream-netbsd/usr.bin/grep/util.c",
39 ],
40 cflags: common_cflags,
41 local_include_dirs: ["upstream-netbsd/include/"],
42 symlinks: ["egrep", "fgrep"],
Erik Staats0c3b1bd2017-06-09 09:10:59 -070043}
Yifan Hong49641ba2017-05-22 18:08:02 -070044
Erik Staats0c3b1bd2017-06-09 09:10:59 -070045cc_binary {
46 name: "grep",
47 defaults: ["grep_common"],
48}
49
50// Build vendor grep.
51// TODO: Add vendor_available to "grep" module and remove "grep_vendor" module
52// when vendor_available is fully supported.
53cc_binary {
54 name: "grep_vendor",
55 stem: "grep",
56 vendor: true,
57 defaults: ["grep_common"],
Yifan Hong49641ba2017-05-22 18:08:02 -070058}