blob: 1c9e5c1b47e088f36ec2fbee78173b27a58c94de [file] [log] [blame]
Elliott Hughesc673df22017-11-30 10:53:25 -08001cc_defaults {
Elliott Hughesb89363f2019-01-29 12:52:50 -08002 name: "awk-flags",
Elliott Hughesc673df22017-11-30 10:53:25 -08003 cflags: [
4 "-Wall",
5 "-Werror",
6 "-Wextra",
7 // Ignore a few harmless idioms widely used in this code.
8 "-Wno-missing-field-initializers",
9 "-Wno-self-assign",
10 "-Wno-unused-parameter",
Elliott Hughesc9fdfd82019-03-08 15:25:46 -080011 // A loop to UCHAR_MAX in `b.c`.
12 "-Wno-sign-compare",
Elliott Hughes112b3072018-12-12 14:36:24 -080013 // And one less harmless used with strtod(3) in `lex.c`.
14 "-Wno-unused-result",
George Burgess IVb8702902019-01-15 18:56:57 -080015 // Also ignore harmless macro redefinitions: glibc 2.17 #defines dprintf
16 // in stdio2.h, and this #defines it in awk.h
17 "-Wno-macro-redefined",
Elliott Hughesc673df22017-11-30 10:53:25 -080018 ],
Elliott Hughesb89363f2019-01-29 12:52:50 -080019 yaccflags: [
20 "-y",
21 ],
22}
23
Elliott Hughes52487fa2019-03-15 03:28:55 +000024// TODO: we should actually rebuild awkgram.y and pass the output through maketab.
25// For now we just rebuild the checked-in generated files.
26cc_binary {
Elliott Hughesb89363f2019-01-29 12:52:50 -080027 name: "awk-maketab",
28 defaults: ["awk-flags"],
29 srcs: ["maketab.c"]
30}
31
32cc_defaults {
33 name: "awk-defaults",
34 defaults: ["awk-flags"],
Elliott Hughes52487fa2019-03-15 03:28:55 +000035
Elliott Hughesb89363f2019-01-29 12:52:50 -080036 srcs: [
37 "b.c",
38 "lex.c",
39 "lib.c",
40 "main.c",
41 "parse.c",
Elliott Hughes52487fa2019-03-15 03:28:55 +000042 "proctab.c",
Elliott Hughesb89363f2019-01-29 12:52:50 -080043 "run.c",
44 "tran.c",
Elliott Hughes52487fa2019-03-15 03:28:55 +000045 "ytab.c",
Elliott Hughesb89363f2019-01-29 12:52:50 -080046 ],
Elliott Hughesc673df22017-11-30 10:53:25 -080047}
48
49cc_binary {
50 name: "awk",
51 defaults: ["awk-defaults"],
52}
53
54cc_binary {
55 name: "awk_vendor",
56 defaults: ["awk-defaults"],
57 stem: "awk",
58 vendor: true,
59}
Elliott Hughes112b3072018-12-12 14:36:24 -080060
61cc_binary_host {
62 name: "one-true-awk",
63 defaults: ["awk-defaults"],
64}