1# Copyright 2020 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 15import("//build_overrides/pigweed.gni") 16 17import("$dir_pw_boot/backend.gni") 18import("$dir_pw_boot_cortex_m/toolchain.gni") 19import("$dir_pw_build/linker_script.gni") 20import("$dir_pw_build/target_types.gni") 21import("$dir_pw_docgen/docs.gni") 22import("$dir_pw_unit_test/test.gni") 23 24_boot_backend = "" 25if (pw_boot_BACKEND != "") { 26 _boot_backend = get_label_info(pw_boot_BACKEND, "label_no_toolchain") 27} 28if (_boot_backend != "$dir_pw_boot_cortex_m:pw_boot_cortex_m" && 29 _boot_backend != "$dir_pw_boot_cortex_m:armv7m" && 30 _boot_backend != "$dir_pw_boot_cortex_m:armv8m") { 31 group("pw_boot_cortex_m") { 32 } 33 group("armv7m") { 34 } 35 group("armv8m") { 36 } 37} else { 38 config("default_config") { 39 include_dirs = [ "public" ] 40 } 41 42 pw_linker_script("cortex_m_linker_script") { 43 # pw_boot_cortex_m_LINK_CONFIG_DEFINES is a list of defines provided by the 44 # target. 45 defines = pw_boot_cortex_m_LINK_CONFIG_DEFINES 46 linker_script = "basic_cortex_m.ld" 47 } 48 49 pw_source_set("pw_boot_cortex_m") { 50 public_configs = [ ":default_config" ] 51 public = [ "public/pw_boot_cortex_m/boot.h" ] 52 public_deps = [ "$dir_pw_preprocessor" ] 53 deps = [ 54 "$dir_pw_boot:facade", 55 "$dir_pw_preprocessor:arch", 56 pw_boot_cortex_m_LINKER_SCRIPT, 57 ] 58 sources = [ "core_init.c" ] 59 } 60 61 # These targets are deprecated, use ":pw_boot_cortex_m" directly. 62 group("armv7m") { 63 public_deps = [ ":pw_boot_cortex_m" ] 64 } 65 group("armv8m") { 66 public_deps = [ ":pw_boot_cortex_m" ] 67 } 68} 69 70pw_doc_group("docs") { 71 sources = [ "docs.rst" ] 72} 73 74pw_test_group("tests") { 75} 76