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