|
2 | 2 | # Licensed under the Apache License, Version 2.0, see LICENSE for details.
|
3 | 3 | # SPDX-License-Identifier: Apache-2.0
|
4 | 4 |
|
| 5 | +load("@bazel_skylib//rules/directory:directory.bzl", "directory") |
| 6 | +load("@bazel_skylib//rules/directory:subdirectory.bzl", "subdirectory") |
| 7 | +load("@rules_cc//cc/toolchains:tool.bzl", "cc_tool") |
| 8 | + |
| 9 | +package(default_visibility = ["//visibility:public"]) |
| 10 | + |
5 | 11 | exports_files(glob(["**"]))
|
| 12 | + |
| 13 | +# Define certain binaries as `cc_tool`s so they can be used in a toolchain. |
| 14 | +# Each tool has access to all the other libraries and binaries in this repository |
| 15 | +# because some tools execute one another and access various libraries. |
| 16 | +[ |
| 17 | + cc_tool( |
| 18 | + name = tool, |
| 19 | + src = ":bin/riscv32-unknown-elf-{}".format(tool), |
| 20 | + data = [":root"], |
| 21 | + ) |
| 22 | + for tool in [ |
| 23 | + "clang", |
| 24 | + "clang++", |
| 25 | + "ar", |
| 26 | + "objcopy", |
| 27 | + "objdump", |
| 28 | + "strip", |
| 29 | + ] |
| 30 | +] |
| 31 | + |
| 32 | +directory( |
| 33 | + name = "root", |
| 34 | + srcs = glob(["**/*"]), |
| 35 | +) |
| 36 | + |
| 37 | +# System library include directories (for `-isystem`): |
| 38 | + |
| 39 | +subdirectory( |
| 40 | + name = "lib-clang-include", |
| 41 | + parent = ":root", |
| 42 | + path = "lib/clang/16/include", |
| 43 | +) |
| 44 | + |
| 45 | +subdirectory( |
| 46 | + name = "riscv32-unknown-elf-include", |
| 47 | + parent = ":root", |
| 48 | + path = "riscv32-unknown-elf/include", |
| 49 | +) |
| 50 | + |
| 51 | +subdirectory( |
| 52 | + name = "cxx-include", |
| 53 | + parent = ":root", |
| 54 | + path = "riscv32-unknown-elf/include/c++/10.2.0", |
| 55 | +) |
| 56 | + |
| 57 | +subdirectory( |
| 58 | + name = "cxx-backward", |
| 59 | + parent = ":root", |
| 60 | + path = "riscv32-unknown-elf/include/c++/10.2.0/backward", |
| 61 | +) |
| 62 | + |
| 63 | +subdirectory( |
| 64 | + name = "cxx-riscv32-unknown-elf", |
| 65 | + parent = ":root", |
| 66 | + path = "riscv32-unknown-elf/include/c++/10.2.0/riscv32-unknown-elf", |
| 67 | +) |
0 commit comments