syncfiles/convert/BUILD.bazel
2022-03-23 17:51:55 -04:00

62 lines
1.1 KiB
Python

load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")
load("//bazel:copts.bzl", "COPTS")
_data = [
"charmap_roman.dat",
"charmap_turkish.dat",
"charmap_croatian.dat",
"charmap_iceland.dat",
"charmap_romanian.dat",
"charmap_celtic.dat",
"charmap_gaelic.dat",
"charmap_greek.dat",
"charmap_cyrillic.dat",
"charmap_inuit.dat",
"charmap_centeuro.dat",
]
genrule(
name = "data",
srcs = [
"//charmap:data",
"//scripts:data",
],
outs = [
"charmap.c",
"charmap.r",
"charmap_name.c",
] + _data,
cmd = "$(execpath //gen:macscript) -dest=$(RULEDIR) -src=. -quiet",
tools = [
"//gen:macscript",
],
)
cc_library(
name = "convert",
srcs = [
"charmap.c",
"convert.c",
"convert.h",
"convert_1f.c",
"convert_1r.c",
"defs.h",
"test.h",
"toolbox.c",
],
copts = COPTS,
)
cc_test(
name = "convert_test",
srcs = [
"charmap_name.c",
"convert_test.c",
],
copts = COPTS,
data = _data,
deps = [
":convert",
],
)