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-22 22:43:47 +00:00
|
|
|
genrule(
|
|
|
|
name = "data",
|
|
|
|
srcs = [
|
|
|
|
"//charmap:data",
|
|
|
|
"//scripts:data",
|
|
|
|
],
|
|
|
|
outs = [
|
2022-03-25 02:34:32 +00:00
|
|
|
"charmap_data.c",
|
|
|
|
"charmap_info.c",
|
|
|
|
"charmap_region.c",
|
2022-03-22 22:43:47 +00:00
|
|
|
"charmap.r",
|
2022-03-25 02:34:32 +00:00
|
|
|
],
|
|
|
|
cmd = "$(execpath //gen:macscript) -dest=$(RULEDIR) -src=. -quiet -format=false",
|
2022-03-22 22:43:47 +00:00
|
|
|
tools = [
|
|
|
|
"//gen:macscript",
|
|
|
|
],
|
|
|
|
)
|
2022-03-22 23:04:29 +00:00
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "convert",
|
|
|
|
srcs = [
|
2022-03-25 02:34:32 +00:00
|
|
|
"charmap_data.c",
|
|
|
|
"charmap_info.c",
|
|
|
|
"charmap_region.c",
|
2022-03-23 05:26:25 +00:00
|
|
|
"convert.c",
|
|
|
|
"convert_1f.c",
|
|
|
|
"convert_1r.c",
|
2022-03-25 02:34:32 +00:00
|
|
|
"toolbox.c",
|
|
|
|
],
|
|
|
|
hdrs = [
|
|
|
|
"convert.h",
|
|
|
|
"data.h",
|
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
|
|
|
],
|
|
|
|
copts = COPTS,
|
|
|
|
)
|
2022-03-23 05:26:25 +00:00
|
|
|
|
|
|
|
cc_test(
|
|
|
|
name = "convert_test",
|
|
|
|
srcs = [
|
|
|
|
"convert_test.c",
|
|
|
|
],
|
|
|
|
copts = COPTS,
|
|
|
|
deps = [
|
|
|
|
":convert",
|
|
|
|
],
|
|
|
|
)
|