load("//:bison.bzl", "bison") load(":bison_test.bzl", "bison_test") genrule( name = "bison_help", testonly = True, outs = ["bison_help.txt"], cmd = "$(execpath //:bison) --help > $@", cmd_bat = "$(execpath //:bison) --help > $@", tools = ["//:bison"], ) genrule( name = "bison_print_datadir", testonly = True, outs = ["bison_print_datadir.txt"], cmd = "$(execpath //:bison) --print-datadir > $@", cmd_bat = "$(execpath //:bison) --print-datadir > $@", tools = ["//:bison"], ) bison( name = "bison_genrule_grammar", testonly = True, srcs = ["c/rpcalc/rpcalc.y"], outs = ["rpcalc_genrule.c"], args = [ "-o", "$(execpath rpcalc_genrule.c)", "$(execpath c/rpcalc/rpcalc.y)", ], ) bison_test( name = "rpcalc_test", src = "c/rpcalc/rpcalc.y", linkopts = select({ "@platforms//os:linux": ["-lm"], "//conditions:default": [], }), ) bison_test( name = "calc_test", src = "c/calc/calc.y", header = "calc.h", )