forked from raspberrypi/pico-sdk
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathBUILD.bazel
More file actions
153 lines (139 loc) · 5.04 KB
/
BUILD.bazel
File metadata and controls
153 lines (139 loc) · 5.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
load("@rules_cc//cc:cc_library.bzl", "cc_library")
package(
default_visibility = [
"//src/rp2040:__subpackages__",
"//src/rp2_common:__pkg__",
],
)
cc_library(
name = "pico_platform_internal",
hdrs = [
"include/pico/asm_helper.S",
"include/pico/platform.h",
"include/pico/platform/cpu_regs.h",
],
includes = ["include"],
target_compatible_with = ["//bazel/constraint:rp2040"],
# Be extra careful about who references this for now; if users depend on
# this but not `pico_platform` they'll end up with undefined symbols.
# It's generally safe for anything that circularly depends on
# //src/rp2_common:pico_platform to be added to this allowlist because
# that implicitly means the transitive dependencies of pico_platform will
# get linked in.
visibility = [
"//src/rp2_common:__pkg__",
],
deps = [
"//src/rp2040/hardware_regs",
"//src/rp2040/hardware_regs:platform_defs",
"//src/rp2_common/pico_platform_common:pico_platform_common_headers",
"//src/rp2_common/pico_platform_compiler",
"//src/rp2_common/pico_platform_panic:pico_platform_panic_headers",
"//src/rp2_common/pico_platform_sections",
],
)
cc_library(
name = "pico_platform",
srcs = ["platform.c"],
includes = ["include"],
target_compatible_with = ["//bazel/constraint:rp2040"],
deps = [
":pico_platform_internal",
"//src/common/pico_base_headers",
"//src/rp2040/hardware_regs",
"//src/rp2040/hardware_regs:platform_defs",
"//src/rp2_common/hardware_base",
"//src/rp2_common/pico_platform_common",
"//src/rp2_common/pico_platform_compiler",
"//src/rp2_common/pico_platform_panic",
"//src/rp2_common/pico_platform_sections",
"//src/rp2_common/pico_standard_link",
],
)
load("//bazel/util:pico_linker_scripts.bzl", "use_linker_script_file")
exports_files(
[
"memmap_blocked_ram.ld",
"memmap_copy_to_ram.ld",
"memmap_default.ld",
"memmap_no_flash.ld",
],
)
use_linker_script_file(
name = "memmap_default_args",
script = "memmap_default.ld",
)
use_linker_script_file(
name = "memmap_blocked_ram_args",
script = "memmap_blocked_ram.ld",
)
use_linker_script_file(
name = "memmap_copy_to_ram_args",
script = "memmap_copy_to_ram.ld",
)
use_linker_script_file(
name = "memmap_no_flash_args",
script = "memmap_no_flash.ld",
)
cc_library(
name = "default_linker_script",
target_compatible_with = ["//bazel/constraint:rp2040"],
visibility = [
"//src/rp2_common/pico_standard_link:__pkg__",
],
deps = [
"//src/rp2_common/pico_crt0:no_warn_rwx_flag",
"//src/rp2040/pico_platform/script_include:rp2040_linker_scripts",
"//src/rp2_common/pico_standard_link/script_include:rp2_linker_scripts",
"//src/rp2_common/pico_standard_link:default_flash_region",
"memmap_default.ld",
"memmap_default_args",
],
)
# PICO_BUILD_DEFINE: PICO_USE_BLOCKED_RAM, whether this is a 'blocked_ram' build, type=bool, default=0, but dependent on CMake options, group=pico_standard_link
cc_library(
name = "blocked_ram_linker_script",
target_compatible_with = ["//bazel/constraint:rp2040"],
visibility = [
"//src/rp2_common/pico_standard_link:__pkg__",
],
deps = [
"//src/rp2_common/pico_crt0:no_warn_rwx_flag",
"//src/rp2040/pico_platform/script_include:rp2040_linker_scripts",
"//src/rp2_common/pico_standard_link/script_include:rp2_linker_scripts",
"//src/rp2_common/pico_standard_link:default_flash_region",
"memmap_blocked_ram.ld",
"memmap_blocked_ram_args",
],
)
# PICO_BUILD_DEFINE: PICO_COPY_TO_RAM, whether this is a 'copy_to_ram' build, type=bool, default=0, but dependent on CMake options, group=pico_standard_link
cc_library(
name = "copy_to_ram_linker_script",
target_compatible_with = ["//bazel/constraint:rp2040"],
visibility = [
"//src/rp2_common/pico_standard_link:__pkg__",
],
deps = [
"//src/rp2_common/pico_crt0:no_warn_rwx_flag",
"//src/rp2040/pico_platform/script_include:rp2040_linker_scripts",
"//src/rp2_common/pico_standard_link/script_include:rp2_linker_scripts",
"//src/rp2_common/pico_standard_link:default_flash_region",
"memmap_copy_to_ram.ld",
"memmap_copy_to_ram_args",
],
)
# PICO_BUILD_DEFINE: PICO_NO_FLASH, whether this is a 'no_flash' build, type=bool, default=0, but dependent on CMake options, group=pico_standard_link
cc_library(
name = "no_flash_linker_script",
target_compatible_with = ["//bazel/constraint:rp2040"],
visibility = [
"//src/rp2_common/pico_standard_link:__pkg__",
],
deps = [
"//src/rp2_common/pico_crt0:no_warn_rwx_flag",
"//src/rp2040/pico_platform/script_include:rp2040_linker_scripts",
"//src/rp2_common/pico_standard_link/script_include:rp2_linker_scripts",
"memmap_no_flash.ld",
"memmap_no_flash_args",
],
)