targets: let specific targets inherit more general targets

This avoids a ton of duplication and makes it easier to change a generic
target (for example, the "cortex-m" target) for all boards that use it.

Also, by making it possible to inherit properties from a parent target
specification, it is easier to support out-of-tree boards that don't
have to be updated so often. A target specification for a
special-purpose board can simply inherit the specification of a
supported chip and override the properites it needs to override (like
the programming interface).
This commit is contained in:
Ayke van Laethem
2018-11-19 21:08:12 +01:00
parent f02766265c
commit 760bc5d0a4
10 changed files with 198 additions and 91 deletions
+2 -21
View File
@@ -1,26 +1,7 @@
{
"llvm-target": "armv6m-none-eabi",
"build-tags": ["microbit", "nrf51822", "nrf51", "nrf", "tinygo.arm", "js", "wasm"],
"linker": "arm-none-eabi-gcc",
"rtlib": "compiler-rt",
"pre-link-args": [
"-nostdlib",
"-nostartfiles",
"-mcpu=cortex-m0",
"-mthumb",
"-T", "targets/nrf51.ld",
"-Wl,--gc-sections",
"-fno-exceptions", "-fno-unwind-tables",
"-ffunction-sections", "-fdata-sections",
"-Os",
"-DNRF51",
"-Ilib/CMSIS/CMSIS/Include",
"lib/nrfx/mdk/system_nrf51.c",
"src/device/nrf/nrf51.s"
],
"objcopy": "arm-none-eabi-objcopy",
"inherits": ["nrf51"],
"build-tags": ["microbit"],
"flash": "openocd -f interface/cmsis-dap.cfg -f target/nrf51.cfg -c 'program {hex} reset exit'",
"ocd-daemon": ["openocd", "-f", "interface/cmsis-dap.cfg", "-f", "target/nrf51.cfg"],
"gdb": "arm-none-eabi-gdb",
"gdb-initial-cmds": ["target remote :3333", "monitor halt", "load", "monitor reset", "c"]
}