blob: 85165c36475c71b8266617da017357abfef285b7 [file] [log] [blame]
cc_defaults {
name: "awk-defaults",
srcs: [
// We remove the upstream ytab.c/ytab.h and let the build system build
// awkgram.y for us. Because all the source refers to ytab.h, we have a
// one-line ytab.h that includes the generated awkgram.h.
"awkgram.y",
"b.c",
"lex.c",
"lib.c",
"main.c",
"parse.c",
// We don't build or run `maketab` because it can't cope with modern
// yacc output which generates an enum rather than #defines. Luckily
// the upstream prebuilt proctab.c is good enough.
"proctab.c",
"run.c",
"tran.c",
],
cflags: [
"-Wall",
"-Werror",
"-Wextra",
// Ignore a few harmless idioms widely used in this code.
"-Wno-missing-field-initializers",
"-Wno-self-assign",
"-Wno-unused-parameter",
// And one less harmless used with strtod(3) in `lex.c`.
"-Wno-unused-result",
// Also ignore harmless macro redefinitions: glibc 2.17 #defines dprintf
// in stdio2.h, and this #defines it in awk.h
"-Wno-macro-redefined",
],
}
cc_binary {
name: "awk",
defaults: ["awk-defaults"],
}
cc_binary {
name: "awk_vendor",
defaults: ["awk-defaults"],
stem: "awk",
vendor: true,
}
cc_binary_host {
name: "one-true-awk",
defaults: ["awk-defaults"],
}