blob: 8cf0d9ae482722eff2ef9d2ee53e0b80f40570ed [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 Hughes37239152019-05-01 15:20:25 -070019 stl: "none",
Dan Willemsenf5e8feb2019-04-12 12:57:56 -070020 yacc: {
21 flags: [
22 "-y",
23 ],
24 },
Elliott Hughesb89363f2019-01-29 12:52:50 -080025}
26
Elliott Hughes52487fa2019-03-15 03:28:55 +000027// TODO: we should actually rebuild awkgram.y and pass the output through maketab.
28// For now we just rebuild the checked-in generated files.
Haibo Huang0687bec2019-09-06 17:32:25 -070029cc_binary_host {
Elliott Hughesb89363f2019-01-29 12:52:50 -080030 name: "awk-maketab",
31 defaults: ["awk-flags"],
32 srcs: ["maketab.c"]
33}
34
35cc_defaults {
36 name: "awk-defaults",
37 defaults: ["awk-flags"],
Elliott Hughes52487fa2019-03-15 03:28:55 +000038
Elliott Hughesb89363f2019-01-29 12:52:50 -080039 srcs: [
40 "b.c",
41 "lex.c",
42 "lib.c",
43 "main.c",
44 "parse.c",
Elliott Hughes52487fa2019-03-15 03:28:55 +000045 "proctab.c",
Elliott Hughesb89363f2019-01-29 12:52:50 -080046 "run.c",
47 "tran.c",
Elliott Hughes52487fa2019-03-15 03:28:55 +000048 "ytab.c",
Elliott Hughesb89363f2019-01-29 12:52:50 -080049 ],
Elliott Hughesc673df22017-11-30 10:53:25 -080050}
51
52cc_binary {
53 name: "awk",
54 defaults: ["awk-defaults"],
55}
56
57cc_binary {
58 name: "awk_vendor",
59 defaults: ["awk-defaults"],
60 stem: "awk",
61 vendor: true,
62}
Elliott Hughes112b3072018-12-12 14:36:24 -080063
64cc_binary_host {
65 name: "one-true-awk",
66 defaults: ["awk-defaults"],
67}