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 15load("@rules_cc//cc:cc_library.bzl", "cc_library") 16load("@rules_python//sphinxdocs:sphinx_docs_library.bzl", "sphinx_docs_library") 17load("//pw_build:compatibility.bzl", "incompatible_with_mcu") 18 19package(default_visibility = ["//visibility:public"]) 20 21licenses(["notice"]) 22 23# Exported because this file may be preprocessed with different defines for 24# different targets (platforms). 25exports_files(["basic_cortex_m.ld"]) 26 27cc_library( 28 name = "pw_boot_cortex_m", 29 srcs = [ 30 "core_init.c", 31 ], 32 hdrs = [ 33 "public/pw_boot_cortex_m/boot.h", 34 ], 35 strip_include_prefix = "public", 36 target_compatible_with = select({ 37 "@platforms//cpu:armv7-m": [], 38 "@platforms//cpu:armv7e-m": [], 39 "@platforms//cpu:armv7e-mf": [], 40 "@platforms//cpu:armv8-m": [], 41 "//conditions:default": ["@platforms//:incompatible"], 42 }), 43 deps = [ 44 "//pw_boot:facade", 45 "//pw_preprocessor", 46 "//pw_preprocessor:cortex_m", 47 ], 48) 49 50# The following targets are deprecated, depend on ":pw_boot_cortex_m" instead. 51cc_library( 52 name = "armv7m", 53 target_compatible_with = select({ 54 "@platforms//cpu:armv7-m": [], 55 "@platforms//cpu:armv7e-m": [], 56 "@platforms//cpu:armv7e-mf": [], 57 "//conditions:default": ["@platforms//:incompatible"], 58 }), 59 deps = [":pw_boot_cortex_m"], 60) 61 62cc_library( 63 name = "armv8m", 64 target_compatible_with = select({ 65 "@platforms//cpu:armv8-m": [], 66 "//conditions:default": ["@platforms//:incompatible"], 67 }), 68 deps = [":pw_boot_cortex_m"], 69) 70 71sphinx_docs_library( 72 name = "docs", 73 srcs = [ 74 "docs.rst", 75 ], 76 prefix = "pw_boot_cortex_m/", 77 target_compatible_with = incompatible_with_mcu(), 78) 79 80filegroup( 81 name = "bloaty_config", 82 srcs = ["bloaty_config.bloaty"], 83) 84