2022-03-23 05:26:25 +00:00
|
|
|
load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")
|
2022-03-22 23:04:29 +00:00
|
|
|
load("//bazel:copts.bzl", "COPTS")
|
|
|
|
|
2022-03-23 05:26:25 +00:00
|
|
|
_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",
|
|
|
|
]
|
|
|
|
|
2022-03-22 22:43:47 +00:00
|
|
|
genrule(
|
|
|
|
name = "data",
|
|
|
|
srcs = [
|
|
|
|
"//charmap:data",
|
|
|
|
"//scripts:data",
|
|
|
|
],
|
|
|
|
outs = [
|
|
|
|
"charmap.c",
|
|
|
|
"charmap.r",
|
2022-03-23 05:26:25 +00:00
|
|
|
"charmap_name.c",
|
|
|
|
] + _data,
|
2022-03-22 22:43:47 +00:00
|
|
|
cmd = "$(execpath //gen:macscript) -dest=$(RULEDIR) -src=. -quiet",
|
|
|
|
tools = [
|
|
|
|
"//gen:macscript",
|
|
|
|
],
|
|
|
|
)
|
2022-03-22 23:04:29 +00:00
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "convert",
|
|
|
|
srcs = [
|
2022-03-22 23:05:13 +00:00
|
|
|
"charmap.c",
|
2022-03-23 05:26:25 +00:00
|
|
|
"convert.c",
|
2022-03-22 23:05:13 +00:00
|
|
|
"convert.h",
|
2022-03-23 05:26:25 +00:00
|
|
|
"convert_1f.c",
|
|
|
|
"convert_1r.c",
|
2022-03-22 23:04:29 +00:00
|
|
|
"defs.h",
|
2022-03-23 05:26:25 +00:00
|
|
|
"test.h",
|
2022-03-22 23:04:29 +00:00
|
|
|
"toolbox.c",
|
|
|
|
],
|
|
|
|
copts = COPTS,
|
|
|
|
)
|
2022-03-23 05:26:25 +00:00
|
|
|
|
|
|
|
cc_test(
|
|
|
|
name = "convert_test",
|
|
|
|
srcs = [
|
|
|
|
"charmap_name.c",
|
|
|
|
"convert_test.c",
|
|
|
|
],
|
|
|
|
copts = COPTS,
|
|
|
|
data = _data,
|
|
|
|
deps = [
|
|
|
|
":convert",
|
|
|
|
],
|
|
|
|
)
|