Carlos Chinchilla | e8275d3 | 2021-12-08 09:46:35 -0800 | [diff] [blame] | 1 | # Copyright 2021 The Pigweed Authors |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); you may not |
| 4 | # use this file except in compliance with the License. You may obtain a copy of |
| 5 | # the License at |
| 6 | # |
| 7 | # https://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 12 | # License for the specific language governing permissions and limitations under |
| 13 | # the License. |
| 14 | |
Carlos Chinchilla | ecf3d80 | 2021-12-08 12:35:54 -0800 | [diff] [blame] | 15 | load( |
| 16 | "//pw_build:pigweed.bzl", |
Armando Montanez | 2c042f9 | 2021-12-15 14:55:36 -0800 | [diff] [blame] | 17 | "pw_cc_binary", |
Carlos Chinchilla | ecf3d80 | 2021-12-08 12:35:54 -0800 | [diff] [blame] | 18 | "pw_cc_library", |
| 19 | ) |
| 20 | |
Carlos Chinchilla | e8275d3 | 2021-12-08 09:46:35 -0800 | [diff] [blame] | 21 | package(default_visibility = ["//visibility:public"]) |
| 22 | |
| 23 | licenses(["notice"]) |
Carlos Chinchilla | ecf3d80 | 2021-12-08 12:35:54 -0800 | [diff] [blame] | 24 | |
Armando Montanez | ce59a87 | 2022-03-16 11:14:28 -0700 | [diff] [blame] | 25 | # WARNING: Many of the dependencies in this file are missing and need to be |
| 26 | # added/updated. This is provided as a starting point, but currently does not |
| 27 | # work. |
| 28 | |
Carlos Chinchilla | ecf3d80 | 2021-12-08 12:35:54 -0800 | [diff] [blame] | 29 | pw_cc_library( |
| 30 | name = "config", |
| 31 | hdrs = [ |
| 32 | "public/pw_system/config.h", |
| 33 | ], |
| 34 | ) |
| 35 | |
| 36 | pw_cc_library( |
| 37 | name = "log", |
| 38 | srcs = [ |
| 39 | "log.cc", |
| 40 | ], |
| 41 | hdrs = [ |
| 42 | "pw_system_private/log.h", |
| 43 | ], |
Carlos Chinchilla | ecf3d80 | 2021-12-08 12:35:54 -0800 | [diff] [blame] | 44 | deps = [ |
Ewout van Bekkum | 5ddc01d | 2022-03-08 12:50:25 -0800 | [diff] [blame] | 45 | ":config", |
Armando Montanez | ce59a87 | 2022-03-16 11:14:28 -0700 | [diff] [blame] | 46 | ":rpc_server", |
Carlos Chinchilla | ecf3d80 | 2021-12-08 12:35:54 -0800 | [diff] [blame] | 47 | "//pw_log_rpc:log_service", |
| 48 | "//pw_log_rpc:rpc_log_drain", |
| 49 | "//pw_log_rpc:rpc_log_drain_thread", |
Ewout van Bekkum | 5ddc01d | 2022-03-08 12:50:25 -0800 | [diff] [blame] | 50 | "//pw_multisink", |
| 51 | "//pw_sync:lock_annotations", |
| 52 | "//pw_sync:mutex", |
| 53 | ], |
| 54 | ) |
| 55 | |
| 56 | pw_cc_library( |
| 57 | name = "log_backend", |
| 58 | srcs = [ |
| 59 | "log_backend.cc", |
| 60 | ], |
| 61 | deps = [ |
| 62 | ":config", |
| 63 | ":log", |
| 64 | "//pw_bytes", |
| 65 | "//pw_chrono:system_clock", |
| 66 | "//pw_log:facade", |
| 67 | "//pw_log:proto_utils", |
| 68 | "//pw_log_string:handler_facade", |
Carlos Chinchilla | ecf3d80 | 2021-12-08 12:35:54 -0800 | [diff] [blame] | 69 | "//pw_log_tokenized:metadata", |
| 70 | "//pw_multisink", |
| 71 | "//pw_result", |
Ewout van Bekkum | 5ddc01d | 2022-03-08 12:50:25 -0800 | [diff] [blame] | 72 | "//pw_string", |
Carlos Chinchilla | ecf3d80 | 2021-12-08 12:35:54 -0800 | [diff] [blame] | 73 | "//pw_sync:interrupt_spin_lock", |
| 74 | "//pw_sync:lock_annotations", |
Carlos Chinchilla | ecf3d80 | 2021-12-08 12:35:54 -0800 | [diff] [blame] | 75 | "//pw_tokenizer", |
| 76 | ], |
| 77 | ) |
| 78 | |
| 79 | pw_cc_library( |
Armando Montanez | ce59a87 | 2022-03-16 11:14:28 -0700 | [diff] [blame] | 80 | name = "rpc_server", |
Carlos Chinchilla | ecf3d80 | 2021-12-08 12:35:54 -0800 | [diff] [blame] | 81 | hdrs = [ |
Armando Montanez | ce59a87 | 2022-03-16 11:14:28 -0700 | [diff] [blame] | 82 | "public/pw_system/rpc_server.h", |
| 83 | ], |
| 84 | includes = ["public"], |
| 85 | deps = [ |
| 86 | ":config", |
| 87 | ":hdlc_rpc_server", |
| 88 | ], |
| 89 | ) |
| 90 | |
| 91 | pw_cc_library( |
| 92 | name = "hdlc_rpc_server", |
| 93 | srcs = [ |
| 94 | "hdlc_rpc_server.cc", |
Carlos Chinchilla | ecf3d80 | 2021-12-08 12:35:54 -0800 | [diff] [blame] | 95 | ], |
| 96 | includes = ["public"], |
| 97 | deps = [ |
| 98 | ":io", |
Armando Montanez | ce59a87 | 2022-03-16 11:14:28 -0700 | [diff] [blame] | 99 | ":rpc_server", |
Carlos Chinchilla | ecf3d80 | 2021-12-08 12:35:54 -0800 | [diff] [blame] | 100 | ":target_io", |
| 101 | "//pw_assert", |
| 102 | "//pw_hdlc:pw_rpc", |
| 103 | "//pw_hdlc:rpc_channel_output", |
Carlos Chinchilla | ecf3d80 | 2021-12-08 12:35:54 -0800 | [diff] [blame] | 104 | "//pw_sync:mutex", |
| 105 | "//pw_thread:thread_core", |
| 106 | ], |
| 107 | ) |
| 108 | |
| 109 | pw_cc_library( |
| 110 | name = "io", |
| 111 | hdrs = [ |
| 112 | "public/pw_system/io.h", |
| 113 | ], |
| 114 | deps = [ |
| 115 | "//pw_stream", |
| 116 | ], |
| 117 | ) |
| 118 | |
| 119 | pw_cc_library( |
| 120 | name = "init", |
| 121 | srcs = [ |
| 122 | "init.cc", |
| 123 | ], |
| 124 | hdrs = [ |
| 125 | "public/pw_system/init.h", |
| 126 | ], |
| 127 | includes = ["public"], |
| 128 | deps = [ |
| 129 | ":log", |
Armando Montanez | ce59a87 | 2022-03-16 11:14:28 -0700 | [diff] [blame] | 130 | ":rpc_server", |
Carlos Chinchilla | ecf3d80 | 2021-12-08 12:35:54 -0800 | [diff] [blame] | 131 | "//pw_rpc/nanopb:echo_service", |
| 132 | "//pw_thread:thread", |
| 133 | ], |
| 134 | ) |
| 135 | |
Armando Montanez | 2c042f9 | 2021-12-15 14:55:36 -0800 | [diff] [blame] | 136 | pw_cc_library( |
| 137 | name = "work_queue", |
| 138 | srcs = [ |
| 139 | "work_queue.cc", |
| 140 | ], |
| 141 | hdrs = [ |
| 142 | "public/pw_system/work_queue.h", |
| 143 | ], |
| 144 | includes = ["public"], |
| 145 | deps = [ |
| 146 | "//pw_work_queue", |
| 147 | ], |
| 148 | ) |
| 149 | |
Carlos Chinchilla | ecf3d80 | 2021-12-08 12:35:54 -0800 | [diff] [blame] | 150 | pw_cc_library( |
| 151 | name = "target_io", |
| 152 | srcs = [ |
| 153 | "target_io.cc", |
| 154 | ], |
| 155 | includes = ["public"], |
| 156 | deps = [ |
| 157 | ":io", |
| 158 | "//pw_stream", |
| 159 | "//pw_stream:sys_io_stream", |
Carlos Chinchilla | ecf3d80 | 2021-12-08 12:35:54 -0800 | [diff] [blame] | 160 | ], |
| 161 | ) |
| 162 | |
Carlos Chinchilla | ecf3d80 | 2021-12-08 12:35:54 -0800 | [diff] [blame] | 163 | pw_cc_library( |
Armando Montanez | 42f2b4d | 2022-01-06 13:19:47 -0800 | [diff] [blame] | 164 | name = "socket_target_io", |
| 165 | srcs = [ |
| 166 | "socket_target_io.cc", |
| 167 | ], |
| 168 | includes = ["public"], |
| 169 | deps = [ |
| 170 | ":config", |
| 171 | ":io", |
| 172 | "//pw_assert", |
| 173 | "//pw_stream", |
| 174 | "//pw_stream:socket_stream", |
| 175 | ], |
| 176 | ) |
| 177 | |
| 178 | pw_cc_library( |
Armando Montanez | 2c042f9 | 2021-12-15 14:55:36 -0800 | [diff] [blame] | 179 | name = "target_hooks", |
Carlos Chinchilla | ecf3d80 | 2021-12-08 12:35:54 -0800 | [diff] [blame] | 180 | hdrs = [ |
Armando Montanez | 2c042f9 | 2021-12-15 14:55:36 -0800 | [diff] [blame] | 181 | "public/pw_system/target_hooks.h", |
Carlos Chinchilla | ecf3d80 | 2021-12-08 12:35:54 -0800 | [diff] [blame] | 182 | ], |
| 183 | includes = ["public"], |
| 184 | deps = [ |
Armando Montanez | 2c042f9 | 2021-12-15 14:55:36 -0800 | [diff] [blame] | 185 | "//pw_thread:thread", |
| 186 | ], |
| 187 | ) |
| 188 | |
| 189 | pw_cc_library( |
| 190 | name = "stl_target_hooks", |
| 191 | srcs = [ |
| 192 | "stl_target_hooks.cc", |
| 193 | ], |
| 194 | deps = [ |
| 195 | "//pw_thread:sleep", |
| 196 | "//pw_thread:thread", |
| 197 | "//pw_thread_stl:thread", |
| 198 | ], |
| 199 | ) |
| 200 | |
| 201 | pw_cc_library( |
| 202 | name = "freertos_target_hooks", |
| 203 | srcs = [ |
| 204 | "freertos_target_hooks.cc", |
| 205 | ], |
| 206 | |
| 207 | # TODO(pwbug/317): This should depend on FreeRTOS but our third parties |
| 208 | # currently do not have Bazel support. |
| 209 | deps = [ |
| 210 | "//pw_thread:thread", |
Carlos Chinchilla | ecf3d80 | 2021-12-08 12:35:54 -0800 | [diff] [blame] | 211 | "//pw_thread_freertos:thread", |
| 212 | ], |
| 213 | ) |
Armando Montanez | 2c042f9 | 2021-12-15 14:55:36 -0800 | [diff] [blame] | 214 | |
| 215 | pw_cc_binary( |
| 216 | name = "system_example", |
| 217 | srcs = ["example_user_app_init.cc"], |
| 218 | deps = [ |
| 219 | ":init", |
| 220 | ":io", |
| 221 | ":target_hooks", |
| 222 | "//pw_stream", |
| 223 | "//pw_stream:sys_io_stream", |
| 224 | ], |
| 225 | ) |