blob: 61d2807aba9536102d7ad319daa0752d5b740a83 [file] [edit]
# Copyright 2026 The Pigweed Authors
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.
load("@rules_cc//cc/toolchains:tool.bzl", "cc_tool")
load("@rules_cc//cc/toolchains:tool_map.bzl", "cc_tool_map")
package(default_visibility = ["//visibility:public"])
licenses(["notice"])
filegroup(
name = "all",
srcs = glob(["**"]),
visibility = ["//visibility:public"],
)
filegroup(
name = "arc_stdlib",
srcs = glob([
"arc-zephyr-elf/include/**",
"arc-zephyr-elf/lib/**",
]),
)
cc_tool_map(
name = "all_tools",
tools = {
"@rules_cc//cc/toolchains/actions:assembly_actions": "arc-gcc",
"@rules_cc//cc/toolchains/actions:c_compile_actions": "arc-gcc",
"@rules_cc//cc/toolchains/actions:cpp_compile_actions": "arc-g++",
"@rules_cc//cc/toolchains/actions:link_actions": "arc-g++",
"@rules_cc//cc/toolchains/actions:strip": "arc-strip",
"@rules_cc//cc/toolchains/actions:objcopy_embed_data": "arc-objcopy",
"@rules_cc//cc/toolchains/actions:ar_actions": "arc-ar",
},
)
cc_tool(
name = "arc-ar",
src = "//:bin/arc-zephyr-elf-ar",
)
cc_tool(
name = "arc-g++",
src = "//:bin/arc-zephyr-elf-g++",
data = glob([
"lib/gcc/arc-zephyr-elf/12.2.0/include/**",
"lib/gcc/arc-zephyr-elf/12.2.0/include-fixed/**",
"libexec/gcc/arc-zephyr-elf/12.2.0/**",
"arc-zephyr-elf/bin/**",
]) + [":arc_stdlib"],
)
cc_tool(
name = "arc-gcc",
src = "//:bin/arc-zephyr-elf-gcc",
data = glob([
"picolibc/**",
"lib/gcc/arc-zephyr-elf/12.2.0/include/**",
"lib/gcc/arc-zephyr-elf/12.2.0/include-fixed/**",
"libexec/gcc/arc-zephyr-elf/12.2.0/**",
"arc-zephyr-elf/bin/**",
]) + [":arc_stdlib"],
)
cc_tool(
name = "arc-objcopy",
src = "//:bin/arc-zephyr-elf-objcopy",
)
cc_tool(
name = "arc-objdump",
src = "//:bin/arc-zephyr-elf-objdump",
)
cc_tool(
name = "arc-strip",
src = "//:bin/arc-zephyr-elf-strip",
)