From 1ee78d543f040c9a1262ba2e7fb7c4af28d3349c Mon Sep 17 00:00:00 2001 From: Jerome Lambourg Date: Wed, 19 Apr 2017 09:51:39 +0200 Subject: [PATCH] Remove the dependency over embedded-runtimes. This build dependency won't work anymore with the next GNAT release as runtimes will now require being installed into the compiler. This commit also now generates automatically the board projects, to ease the addition of new boards and runtimes, as well as taking into account modifications refactoring of the library. --- .gitmodules | 3 - README.md | 10 -- arch/ARM/Nordic/nrf51.gpr | 2 +- .../demo_l3gd20_dataready_int.gpr | 4 +- .../demo_l3gd20_fifo_int.gpr | 4 +- .../demo_L3GD20_polling/demo_l3gd20.gpr | 4 +- arch/ARM/STM32/stm32f40x.gpr | 2 +- arch/ARM/STM32/stm32f427x.gpr | 2 +- arch/ARM/STM32/stm32f42x.gpr | 2 +- arch/ARM/STM32/stm32f46_79x.gpr | 4 +- arch/ARM/STM32/stm32f7x.gpr | 4 +- arch/ARM/STM32/stm32f7x9.gpr | 4 +- arch/ARM/cortex_m/cortex_m0.gpr | 2 +- arch/ARM/cortex_m/cortex_m4.gpr | 2 +- arch/ARM/cortex_m/cortex_m4f.gpr | 2 +- arch/ARM/cortex_m/cortex_m7.gpr | 2 +- boards/HiFive1/config.gpr | 16 --- boards/Makefile | 6 + boards/MicroBit/config.gpr | 16 --- boards/OpenMV2/config.gpr | 20 ---- boards/{common_config.gpr => config.gpr} | 8 +- boards/crazyflie.gpr | 30 ++--- boards/crazyflie/config.gpr | 20 ---- boards/crazyflie_full.gpr | 23 ++-- boards/crazyflie_sfp.gpr | 24 ++++ boards/gen.py | 113 ++++++++++++++++++ boards/hifive1.gpr | 34 +++--- boards/microbit.gpr | 34 +++--- boards/native.gpr | 20 ++-- boards/native/config.gpr | 14 --- boards/openmv2.gpr | 36 +++--- boards/openmv2_full.gpr | 24 ++++ boards/openmv2_sfp.gpr | 24 ++++ boards/stm32f407_discovery.gpr | 34 +++--- boards/stm32f407_discovery/config.gpr | 20 ---- boards/stm32f407_discovery_full.gpr | 24 ++++ boards/stm32f407_discovery_sfp.gpr | 24 ++++ boards/stm32f429_discovery.gpr | 34 +++--- boards/stm32f429_discovery/config.gpr | 20 ---- boards/stm32f429_discovery_full.gpr | 24 ++++ boards/stm32f429_discovery_sfp.gpr | 24 ++++ boards/stm32f469_discovery.gpr | 34 +++--- boards/stm32f469_discovery/config.gpr | 20 ---- boards/stm32f469_discovery_full.gpr | 24 ++++ boards/stm32f469_discovery_sfp.gpr | 24 ++++ boards/stm32f746_discovery.gpr | 35 +++--- boards/stm32f746_discovery/config.gpr | 20 ---- boards/stm32f746_discovery_full.gpr | 24 ++++ boards/stm32f746_discovery_sfp.gpr | 24 ++++ boards/stm32f769_discovery.gpr | 34 +++--- boards/stm32f769_discovery/config.gpr | 20 ---- boards/stm32f769_discovery_full.gpr | 24 ++++ boards/stm32f769_discovery_sfp.gpr | 24 ++++ embedded-runtimes | 1 - examples/OpenMV2/openmv2_example.gpr | 2 +- examples/shared/common/common.gpr | 10 +- 56 files changed, 639 insertions(+), 400 deletions(-) delete mode 100644 boards/HiFive1/config.gpr create mode 100644 boards/Makefile delete mode 100644 boards/MicroBit/config.gpr delete mode 100644 boards/OpenMV2/config.gpr rename boards/{common_config.gpr => config.gpr} (89%) delete mode 100644 boards/crazyflie/config.gpr create mode 100644 boards/crazyflie_sfp.gpr create mode 100755 boards/gen.py delete mode 100644 boards/native/config.gpr create mode 100644 boards/openmv2_full.gpr create mode 100644 boards/openmv2_sfp.gpr delete mode 100644 boards/stm32f407_discovery/config.gpr create mode 100644 boards/stm32f407_discovery_full.gpr create mode 100644 boards/stm32f407_discovery_sfp.gpr delete mode 100644 boards/stm32f429_discovery/config.gpr create mode 100644 boards/stm32f429_discovery_full.gpr create mode 100644 boards/stm32f429_discovery_sfp.gpr delete mode 100644 boards/stm32f469_discovery/config.gpr create mode 100644 boards/stm32f469_discovery_full.gpr create mode 100644 boards/stm32f469_discovery_sfp.gpr delete mode 100644 boards/stm32f746_discovery/config.gpr create mode 100644 boards/stm32f746_discovery_full.gpr create mode 100644 boards/stm32f746_discovery_sfp.gpr delete mode 100644 boards/stm32f769_discovery/config.gpr create mode 100644 boards/stm32f769_discovery_full.gpr create mode 100644 boards/stm32f769_discovery_sfp.gpr delete mode 160000 embedded-runtimes diff --git a/.gitmodules b/.gitmodules index 8edf78ac8..e69de29bb 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +0,0 @@ -[submodule "embedded-runtimes"] - path = embedded-runtimes - url = https://github.com/AdaCore/embedded-runtimes.git diff --git a/README.md b/README.md index 66efa19c8..d2bc3782d 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,6 @@ [![Build Status](https://travis-ci.org/AdaCore/Ada_Drivers_Library.svg?branch=master)](https://travis-ci.org/AdaCore/Ada_Drivers_Library) [![Build status](https://ci.appveyor.com/api/projects/status/dvay075xkwxgppwm?svg=true)](https://ci.appveyor.com/project/AdaCore/ada-drivers-library) -## Warning! - -This repository uses git submodule, please clone with the `--recursive` option: - -```shell -git clone --recursive https://github.com/AdaCore/Ada_Drivers_Library.git -``` - # 1. Introduction This repository contains Ada source code and complete sample GNAT projects for @@ -30,7 +22,6 @@ are available both for proprietary ("commercial") and non-proprietary use. For details, see the `LICENSE` file in the root directory. - # 4. Requirements The software is written in Ada 2012 and uses, for example, preconditions, @@ -49,7 +40,6 @@ compiler for ARM ELF is one such compiler [(Download it here)](http://libre.adacore.com/download/configurations). A recent GNAT Pro compiler for that target will also suffice. - # 5. Content Initial provision is for the hardware in the STM32F4 family of 32-bit MCUs, as diff --git a/arch/ARM/Nordic/nrf51.gpr b/arch/ARM/Nordic/nrf51.gpr index 4afb55854..7df70115e 100644 --- a/arch/ARM/Nordic/nrf51.gpr +++ b/arch/ARM/Nordic/nrf51.gpr @@ -1,5 +1,5 @@ with "config"; -with "../../hal/HAL"; +with "hal/HAL"; with "../cortex_m/cortex_m0"; library project nRF51 is diff --git a/arch/ARM/STM32/driver_demos/demo_L3GD20_dataready_int/demo_l3gd20_dataready_int.gpr b/arch/ARM/STM32/driver_demos/demo_L3GD20_dataready_int/demo_l3gd20_dataready_int.gpr index f23f1d3a5..0a697a021 100644 --- a/arch/ARM/STM32/driver_demos/demo_L3GD20_dataready_int/demo_l3gd20_dataready_int.gpr +++ b/arch/ARM/STM32/driver_demos/demo_L3GD20_dataready_int/demo_l3gd20_dataready_int.gpr @@ -1,5 +1,5 @@ with "../../../../../boards/common_config.gpr"; -with "../../../../../boards/stm32f429_discovery.gpr"; +with "../../../../../boards/stm32f429_discovery_full.gpr"; project Demo_L3GD20_Dataready_Int extends "../../../../../examples/shared/common/common.gpr" is @@ -8,7 +8,7 @@ project Demo_L3GD20_Dataready_Int extends "../../../../../examples/shared/common for Languages use ("Ada"); for Source_Dirs use ("src"); for Object_Dir use "obj/" & Common_Config.Build; - for Runtime ("Ada") use STM32F429_Discovery'Runtime("Ada"); + for Runtime ("Ada") use STM32F429_Discovery_Full'Runtime("Ada"); -- for Create_Missing_Dirs use "true"; package Builder is diff --git a/arch/ARM/STM32/driver_demos/demo_L3GD20_fifo_int/demo_l3gd20_fifo_int.gpr b/arch/ARM/STM32/driver_demos/demo_L3GD20_fifo_int/demo_l3gd20_fifo_int.gpr index ea8a4a39c..6e8e2679b 100644 --- a/arch/ARM/STM32/driver_demos/demo_L3GD20_fifo_int/demo_l3gd20_fifo_int.gpr +++ b/arch/ARM/STM32/driver_demos/demo_L3GD20_fifo_int/demo_l3gd20_fifo_int.gpr @@ -1,5 +1,5 @@ with "../../../../../boards/common_config.gpr"; -with "../../../../../boards/stm32f429_discovery.gpr"; +with "../../../../../boards/stm32f429_discovery_full.gpr"; project Demo_L3GD20_FIFO_Int extends "../../../../../examples/shared/common/common.gpr" is @@ -7,7 +7,7 @@ project Demo_L3GD20_FIFO_Int extends "../../../../../examples/shared/common/comm for Languages use ("Ada"); for Source_Dirs use ("src"); for Object_Dir use "obj/" & Common_Config.Build; - for Runtime ("Ada") use STM32F429_Discovery'Runtime("Ada"); + for Runtime ("Ada") use STM32F429_Discovery_Full'Runtime("Ada"); -- for Create_Missing_Dirs use "true"; package Builder is diff --git a/arch/ARM/STM32/driver_demos/demo_L3GD20_polling/demo_l3gd20.gpr b/arch/ARM/STM32/driver_demos/demo_L3GD20_polling/demo_l3gd20.gpr index 547a1f217..05a4e738f 100644 --- a/arch/ARM/STM32/driver_demos/demo_L3GD20_polling/demo_l3gd20.gpr +++ b/arch/ARM/STM32/driver_demos/demo_L3GD20_polling/demo_l3gd20.gpr @@ -1,5 +1,5 @@ with "../../../../../boards/common_config.gpr"; -with "../../../../../boards/stm32f429_discovery.gpr"; +with "../../../../../boards/stm32f429_discovery_full.gpr"; project Demo_L3GD20 extends "../../../../../examples/shared/common/common.gpr" is @@ -7,7 +7,7 @@ project Demo_L3GD20 extends "../../../../../examples/shared/common/common.gpr" i for Main use ("demo_l3gd20.adb"); for Languages use ("Ada"); for Object_Dir use "obj/" & Common_Config.Build; - for Runtime ("Ada") use STM32F429_Discovery'Runtime("Ada"); + for Runtime ("Ada") use STM32F429_Discovery_Full'Runtime("Ada"); -- for Create_Missing_Dirs use "true"; package Builder is diff --git a/arch/ARM/STM32/stm32f40x.gpr b/arch/ARM/STM32/stm32f40x.gpr index 5ccd4611b..ff117180e 100644 --- a/arch/ARM/STM32/stm32f40x.gpr +++ b/arch/ARM/STM32/stm32f40x.gpr @@ -1,5 +1,5 @@ with "config"; -with "../../hal/HAL"; +with "hal/HAL"; with "../cortex_m/cortex_m4f"; library project STM32F40x is diff --git a/arch/ARM/STM32/stm32f427x.gpr b/arch/ARM/STM32/stm32f427x.gpr index 0be0c8f1d..cdd3d03ab 100644 --- a/arch/ARM/STM32/stm32f427x.gpr +++ b/arch/ARM/STM32/stm32f427x.gpr @@ -3,7 +3,7 @@ -- directory. with "config"; -with "../../hal/HAL"; +with "hal/HAL"; with "../cortex_m/cortex_m4f"; library project STM32F427x is diff --git a/arch/ARM/STM32/stm32f42x.gpr b/arch/ARM/STM32/stm32f42x.gpr index 70bd45170..2c7f96e2b 100644 --- a/arch/ARM/STM32/stm32f42x.gpr +++ b/arch/ARM/STM32/stm32f42x.gpr @@ -1,5 +1,5 @@ with "config"; -with "../../hal/HAL"; +with "hal/HAL"; with "../cortex_m/cortex_m4f"; library project STM32F42x is diff --git a/arch/ARM/STM32/stm32f46_79x.gpr b/arch/ARM/STM32/stm32f46_79x.gpr index 7d8e4c804..5976da37e 100644 --- a/arch/ARM/STM32/stm32f46_79x.gpr +++ b/arch/ARM/STM32/stm32f46_79x.gpr @@ -1,6 +1,6 @@ with "config"; -with "../../hal/HAL"; -with "../../middleware/sdmmc"; +with "hal/HAL"; +with "middleware/sdmmc"; with "../cortex_m/cortex_m4f"; library project STM32F46_79x is diff --git a/arch/ARM/STM32/stm32f7x.gpr b/arch/ARM/STM32/stm32f7x.gpr index d0f7d18ed..74450cf5d 100644 --- a/arch/ARM/STM32/stm32f7x.gpr +++ b/arch/ARM/STM32/stm32f7x.gpr @@ -1,6 +1,6 @@ with "config"; -with "../../hal/HAL"; -with "../../middleware/sdmmc"; +with "hal/HAL"; +with "middleware/sdmmc"; with "../cortex_m/cortex_m7"; library project STM32F7x is diff --git a/arch/ARM/STM32/stm32f7x9.gpr b/arch/ARM/STM32/stm32f7x9.gpr index 3162e48bc..d3a0e3ca6 100644 --- a/arch/ARM/STM32/stm32f7x9.gpr +++ b/arch/ARM/STM32/stm32f7x9.gpr @@ -1,6 +1,6 @@ with "config"; -with "../../hal/HAL"; -with "../../middleware/sdmmc"; +with "hal/HAL"; +with "middleware/sdmmc"; with "../cortex_m/cortex_m7"; library project STM32F7x9 is diff --git a/arch/ARM/cortex_m/cortex_m0.gpr b/arch/ARM/cortex_m/cortex_m0.gpr index 982fc70e9..aa8e7d255 100644 --- a/arch/ARM/cortex_m/cortex_m0.gpr +++ b/arch/ARM/cortex_m/cortex_m0.gpr @@ -1,5 +1,5 @@ with "config"; -with "../../hal/HAL"; +with "hal/HAL"; library project Cortex_M0 is diff --git a/arch/ARM/cortex_m/cortex_m4.gpr b/arch/ARM/cortex_m/cortex_m4.gpr index 24a050a32..ea3ce446f 100644 --- a/arch/ARM/cortex_m/cortex_m4.gpr +++ b/arch/ARM/cortex_m/cortex_m4.gpr @@ -1,5 +1,5 @@ with "config"; -with "../../hal/HAL"; +with "hal/HAL"; library project Cortex_M4 is diff --git a/arch/ARM/cortex_m/cortex_m4f.gpr b/arch/ARM/cortex_m/cortex_m4f.gpr index 2bd4594b2..f4d18639c 100644 --- a/arch/ARM/cortex_m/cortex_m4f.gpr +++ b/arch/ARM/cortex_m/cortex_m4f.gpr @@ -1,5 +1,5 @@ with "config"; -with "../../hal/HAL"; +with "hal/HAL"; library project Cortex_M4F is diff --git a/arch/ARM/cortex_m/cortex_m7.gpr b/arch/ARM/cortex_m/cortex_m7.gpr index a317e64e4..5bdb6834d 100644 --- a/arch/ARM/cortex_m/cortex_m7.gpr +++ b/arch/ARM/cortex_m/cortex_m7.gpr @@ -1,5 +1,5 @@ with "config"; -with "../../hal/HAL"; +with "hal/HAL"; library project Cortex_M7 is diff --git a/boards/HiFive1/config.gpr b/boards/HiFive1/config.gpr deleted file mode 100644 index c7a172012..000000000 --- a/boards/HiFive1/config.gpr +++ /dev/null @@ -1,16 +0,0 @@ --- Version of the projects configuration for Micro:Bit board. - -abstract project Config extends "../common_config" is - - RTS := "zfp-hifive1"; - Build := Common_Config.Build; - - Object_Subdir := "hifive1/" & RTS & "/" & Build; - - -- Need that for abstract projects - for Source_Dirs use (); - - package Compiler renames Common_Config.Compiler; - package Builder renames Common_Config.Builder; - -end Config; diff --git a/boards/Makefile b/boards/Makefile new file mode 100644 index 000000000..f2d51cd45 --- /dev/null +++ b/boards/Makefile @@ -0,0 +1,6 @@ +all: + for gpr in *.gpr; do \ + echo Building $$gpr; \ + gprbuild -q -j0 -XPLATFORM_BUILD=Debug -P $$gpr -p; \ + gprbuild -q -j0 -XPLATFORM_BUILD=Production -P $$gpr -p; \ + done diff --git a/boards/MicroBit/config.gpr b/boards/MicroBit/config.gpr deleted file mode 100644 index 8cd2f1285..000000000 --- a/boards/MicroBit/config.gpr +++ /dev/null @@ -1,16 +0,0 @@ --- Version of the projects configuration for Micro:Bit board. - -abstract project Config extends "../common_config" is - - RTS := "zfp-nRF51"; - Build := Common_Config.Build; - - Object_Subdir := "microbit/" & RTS & "/" & Build; - - -- Need that for abstract projects - for Source_Dirs use (); - - package Compiler renames Common_Config.Compiler; - package Builder renames Common_Config.Builder; - -end Config; diff --git a/boards/OpenMV2/config.gpr b/boards/OpenMV2/config.gpr deleted file mode 100644 index c8d5e0980..000000000 --- a/boards/OpenMV2/config.gpr +++ /dev/null @@ -1,20 +0,0 @@ --- Version of the projects configuration for OpenMV2 board. - --- Include the run-time project files to have them compiled -with "../../embedded-runtimes/ravenscar-openmv2/ravenscar_build"; -with "../../embedded-runtimes/ravenscar-openmv2/runtime_build"; - -abstract project Config extends "../common_config" is - - RTS := Runtime_Build.RTS; - Build := Common_Config.Build; - - Object_Subdir := "openmv2/" & RTS & "/" & Build; - - -- Need that for abstract projects - for Source_Dirs use (); - - package Compiler renames Common_Config.Compiler; - package Builder renames Common_Config.Builder; - -end Config; diff --git a/boards/common_config.gpr b/boards/config.gpr similarity index 89% rename from boards/common_config.gpr rename to boards/config.gpr index a43625257..875cc2a86 100644 --- a/boards/common_config.gpr +++ b/boards/config.gpr @@ -1,6 +1,6 @@ -- This abstract project defines common scenario variables and switches used -- all over the library. -abstract project Common_Config is +abstract project Config is for Languages use ("Ada"); for Source_Dirs use (); @@ -9,6 +9,9 @@ abstract project Common_Config is ("Debug", "Production"); Build : BUILD_Type := external ("PLATFORM_BUILD", "Debug"); + RTS := external ("RTS_Profile", "ravenscar-sfp"); + Object_Subdir := external ("Obj_Suffix", ""); + -- Target architecture Target := Project'Target; @@ -21,6 +24,7 @@ abstract project Common_Config is Callgraph_Switch := ("-fcallgraph-info=su"); end case; + package Compiler is case Build is when "Production" => @@ -38,4 +42,4 @@ abstract project Common_Config is package Builder is end Builder; -end Common_Config; +end Config; diff --git a/boards/crazyflie.gpr b/boards/crazyflie.gpr index d088aca84..fd5524ee4 100644 --- a/boards/crazyflie.gpr +++ b/boards/crazyflie.gpr @@ -1,26 +1,26 @@ aggregate library project Crazyflie is - Build := external ("BUILD", "Debug"); + Board := "crazyflie"; - type RTS_Type is ("ravenscar-sfp", "ravenscar-full"); - RTS : RTS_Type := External ("RTS", "ravenscar-sfp"); + type RTS_Profile_Type is ("ravenscar-sfp", "ravenscar-full"); + RTS_Profile : RTS_Profile_Type := + external ("RTS_Profile", "ravenscar-sfp"); + + type Build_Type is ("Debug", "Production"); + Build : Build_Type := external ("PLATFORM_BUILD", "Production"); - RTS_Base := Project'Project_Dir & - "../embedded-runtimes/ravenscar-stm32f407disco"; for Target use "arm-eabi"; + for Runtime ("Ada") use RTS_Profile & "-stm32f4"; - case RTS is - when "ravenscar-sfp" => - for Runtime ("Ada") use RTS_Base & "/sfp"; - when "ravenscar-full" => - for Runtime ("Ada") use RTS_Base & "/full"; - end case; + Obj_Suffix := Board & "/" & RTS_Profile & "/" & Build; - for Project_Path use ("crazyflie"); + for Library_Name use Board; + for Library_Dir use "lib/" & Obj_Suffix; + for external ("Obj_Suffix") use Obj_Suffix; + for external ("RTS_Profile") use RTS_Profile; + for Project_Path use + (Project'Project_Dir, Project'Project_Dir & ".."); for Project_Files use ("crazyflie/board.gpr"); - for Library_Dir use "lib/crazyflie/" & RTS & "/" & Build; - for Library_Name use "crazyflie"; - end Crazyflie; diff --git a/boards/crazyflie/config.gpr b/boards/crazyflie/config.gpr deleted file mode 100644 index 50c6ad0f5..000000000 --- a/boards/crazyflie/config.gpr +++ /dev/null @@ -1,20 +0,0 @@ --- Version of the projects configuration for STM32F407-Discovery board. - --- Include the run-time project files to have them compiled -with "../../embedded-runtimes/ravenscar-stm32f407disco/ravenscar_build"; -with "../../embedded-runtimes/ravenscar-stm32f407disco/runtime_build"; - -abstract project Config extends "../common_config" is - - RTS := Runtime_Build.RTS; - Build := Common_Config.Build; - - Object_Subdir := "stm32f407disco/" & RTS & "/" & Build; - - -- Need that for abstract projects - for Source_Dirs use (); - - package Compiler renames Common_Config.Compiler; - package Builder renames Common_Config.Builder; - -end Config; diff --git a/boards/crazyflie_full.gpr b/boards/crazyflie_full.gpr index fffc889e9..790b024fc 100644 --- a/boards/crazyflie_full.gpr +++ b/boards/crazyflie_full.gpr @@ -1,19 +1,24 @@ aggregate library project Crazyflie_Full is - Build := external ("BUILD", "Debug"); - for External ("RTS") use "ravenscar-full"; + Board := "crazyflie"; + + RTS_Profile := "ravenscar-full"; + + type Build_Type is ("Debug", "Production"); + Build : Build_Type := external ("PLATFORM_BUILD", "Production"); - RTS_Base := Project'Project_Dir & - "../embedded-runtimes/ravenscar-stm32f407disco"; for Target use "arm-eabi"; + for Runtime ("Ada") use RTS_Profile & "-stm32f4"; - for Runtime ("Ada") use RTS_Base & "/full"; + Obj_Suffix := Board & "/" & RTS_Profile & "/" & Build; - for Project_Path use ("crazyflie"); + for Library_Name use Board; + for Library_Dir use "lib/" & Obj_Suffix; + for external ("Obj_Suffix") use Obj_Suffix; + for external ("RTS_Profile") use RTS_Profile; + for Project_Path use + (Project'Project_Dir, Project'Project_Dir & ".."); for Project_Files use ("crazyflie/board.gpr"); - for Library_Dir use "lib/crazyflie/ravenscar-full/" & Build; - for Library_Name use "crazyflie"; - end Crazyflie_Full; diff --git a/boards/crazyflie_sfp.gpr b/boards/crazyflie_sfp.gpr new file mode 100644 index 000000000..ca4367bb9 --- /dev/null +++ b/boards/crazyflie_sfp.gpr @@ -0,0 +1,24 @@ +aggregate library project Crazyflie_SFP is + + Board := "crazyflie"; + + RTS_Profile := "ravenscar-sfp"; + + type Build_Type is ("Debug", "Production"); + Build : Build_Type := external ("PLATFORM_BUILD", "Production"); + + for Target use "arm-eabi"; + for Runtime ("Ada") use RTS_Profile & "-stm32f4"; + + Obj_Suffix := Board & "/" & RTS_Profile & "/" & Build; + + for Library_Name use Board; + for Library_Dir use "lib/" & Obj_Suffix; + + for external ("Obj_Suffix") use Obj_Suffix; + for external ("RTS_Profile") use RTS_Profile; + for Project_Path use + (Project'Project_Dir, Project'Project_Dir & ".."); + for Project_Files use ("crazyflie/board.gpr"); + +end Crazyflie_SFP; diff --git a/boards/gen.py b/boards/gen.py new file mode 100755 index 000000000..f67644859 --- /dev/null +++ b/boards/gen.py @@ -0,0 +1,113 @@ +#!/usr/bin/env python + +BOARDS = {'Crazyflie': ['ravenscar-sfp', 'ravenscar-full'], + 'HiFive1': ['zfp'], + 'MicroBit': ['zfp'], + 'Native': None, + 'OpenMV2': ['ravenscar-sfp', 'ravenscar-full'], + 'STM32F407Disco': ['ravenscar-sfp', 'ravenscar-full'], + 'STM32F429Disco': ['ravenscar-sfp', 'ravenscar-full'], + 'STM32F469Disco': ['ravenscar-sfp', 'ravenscar-full'], + 'STM32F746Disco': ['ravenscar-sfp', 'ravenscar-full'], + 'STM32F769Disco': ['ravenscar-sfp', 'ravenscar-full']} + +FOLDERS = {'Crazyflie': 'crazyflie', + 'HiFive1': 'hifive1', + 'MicroBit': 'microbit', + 'Native': 'native', + 'OpenMV2': 'openmv2', + 'STM32F407Disco': 'stm32f407_discovery', + 'STM32F429Disco': 'stm32f429_discovery', + 'STM32F469Disco': 'stm32f469_discovery', + 'STM32F746Disco': 'stm32f746_discovery', + 'STM32F769Disco': 'stm32f769_discovery'} + + +def gen_project(board, rts): + assert board is not None, "board is undefined" + project_name = FOLDERS[board].title() + + if rts == 'zfp': + suffix = 'ZFP' + elif rts == 'ravenscar-sfp': + suffix = 'SFP' + elif rts == 'ravenscar-full': + suffix = 'Full' + elif rts is None: + suffix = None + else: + assert False, "Unexpected runtime %s" % rts + + if suffix is not None: + project_name = '%s_%s' % (project_name, suffix) + + cnt = 'aggregate library project %s is\n' % project_name + cnt += '\n' + lower = board.lower() + cnt += ' Board := "%s";\n\n' % lower + + if BOARDS[board] is not None: + # Do not use a RTS Profile for the native project + if len(BOARDS[board]) == 1: + # Only one rts defined for the board, do not make it a user option + rts = BOARDS[board][0] + if rts is not None: + # Runtime profile is forced for this project + cnt += ' RTS_Profile := "%s";\n' % rts + else: + # Runtime profile is for the user to choose + cnt += ' type RTS_Profile_Type is ("%s");\n' % \ + '", "'.join(BOARDS[board]) + cnt += ' RTS_Profile : RTS_Profile_Type :=\n' + cnt += ' external ("RTS_Profile", "%s");\n' % \ + BOARDS[board][0] + cnt += '\n' + + cnt += ' type Build_Type is ("Debug", "Production");\n' + cnt += ' Build : Build_Type := external ("PLATFORM_BUILD", "Production");\n' + cnt += '\n' + + # definition of the Target + if lower == 'native': + pass + else: + cnt += ' for Target use "arm-eabi";\n' + # definition of Runtime ("Ada") + if lower == 'native': + pass + elif lower in ('crazyflie', 'stm32f407disco'): + # Both use the stm32f4 runtime + cnt += ' for Runtime ("Ada") use RTS_Profile & "-stm32f4";\n' + else: + cnt += ' for Runtime ("Ada") use RTS_Profile & "-" & Board;\n' + cnt += '\n' + + # Object subdirectories. + if lower == 'native': + cnt += ' Obj_Suffix := "native-" & Build;\n' + else: + cnt += ' Obj_Suffix := Board & "/" & RTS_Profile & "/" & Build;\n' + cnt += '\n' + cnt += ' for Library_Name use Board;\n' + cnt += ' for Library_Dir use "lib/" & Obj_Suffix;\n' + cnt += '\n' + cnt += ' for external ("Obj_Suffix") use Obj_Suffix;\n' + if lower != 'native': + cnt += ' for external ("RTS_Profile") use RTS_Profile;\n' + + cnt += ' for Project_Path use \n' + cnt += ' (Project\'Project_Dir, Project\'Project_Dir & "..");\n' + cnt += ' for Project_Files use ("%s/board.gpr");\n' % FOLDERS[board] + cnt += '\n' + cnt += 'end %s;\n' % project_name + + print "creating %s.gpr" % project_name.lower() + with open('%s.gpr' % project_name.lower(), 'w') as fp: + fp.write(cnt) + +if __name__ == "__main__": + for b in BOARDS: + gen_project(b, None) + if BOARDS[b] is not None and len(BOARDS[b]) > 1: + for rts in BOARDS[b]: + gen_project(b, rts) diff --git a/boards/hifive1.gpr b/boards/hifive1.gpr index 13042d047..4147d892b 100644 --- a/boards/hifive1.gpr +++ b/boards/hifive1.gpr @@ -1,26 +1,24 @@ -aggregate library project HiFive1 is +aggregate library project Hifive1 is - Build := external ("BUILD", "Debug"); + Board := "hifive1"; - type RTS_Type is ("ravenscar-sfp", "ravenscar-full"); - RTS : RTS_Type := External ("RTS", "ravenscar-sfp"); + RTS_Profile := "zfp"; - RTS_Base := Project'Project_Dir & - "../embedded-runtimes/zfp-hifive1"; - for Target use "riscv32-unknown-elf"; + type Build_Type is ("Debug", "Production"); + Build : Build_Type := external ("PLATFORM_BUILD", "Production"); - case RTS is - when "ravenscar-sfp" => - for Runtime ("Ada") use RTS_Base & "/sfp"; - when "ravenscar-full" => - for Runtime ("Ada") use RTS_Base & "/full"; - end case; + for Target use "arm-eabi"; + for Runtime ("Ada") use RTS_Profile & "-" & Board; - for Project_Path use ("HiFive1"); + Obj_Suffix := Board & "/" & RTS_Profile & "/" & Build; - for Project_Files use ("HiFive1/board.gpr"); + for Library_Name use Board; + for Library_Dir use "lib/" & Obj_Suffix; - for Library_Dir use "lib/hifive1/" & RTS & "/" & Build; - for Library_Name use "hifive1"; + for external ("Obj_Suffix") use Obj_Suffix; + for external ("RTS_Profile") use RTS_Profile; + for Project_Path use + (Project'Project_Dir, Project'Project_Dir & ".."); + for Project_Files use ("hifive1/board.gpr"); -end HiFive1; +end Hifive1; diff --git a/boards/microbit.gpr b/boards/microbit.gpr index 15ac87bab..9766fbeef 100644 --- a/boards/microbit.gpr +++ b/boards/microbit.gpr @@ -1,26 +1,24 @@ -aggregate library project MicroBit is +aggregate library project Microbit is - Build := external ("BUILD", "Debug"); + Board := "microbit"; - type RTS_Type is ("ravenscar-sfp", "ravenscar-full"); - RTS : RTS_Type := External ("RTS", "ravenscar-sfp"); + RTS_Profile := "zfp"; - RTS_Base := Project'Project_Dir & - "../embedded-runtimes/zfp-nRF51"; - for Target use "arm-eabi"; + type Build_Type is ("Debug", "Production"); + Build : Build_Type := external ("PLATFORM_BUILD", "Production"); - case RTS is - when "ravenscar-sfp" => - for Runtime ("Ada") use RTS_Base & "/sfp"; - when "ravenscar-full" => - for Runtime ("Ada") use RTS_Base & "/full"; - end case; + for Target use "arm-eabi"; + for Runtime ("Ada") use RTS_Profile & "-" & Board; - for Project_Path use ("OpenMV2"); + Obj_Suffix := Board & "/" & RTS_Profile & "/" & Build; - for Project_Files use ("MicroBit/board.gpr"); + for Library_Name use Board; + for Library_Dir use "lib/" & Obj_Suffix; - for Library_Dir use "lib/microbit/" & RTS & "/" & Build; - for Library_Name use "microbit"; + for external ("Obj_Suffix") use Obj_Suffix; + for external ("RTS_Profile") use RTS_Profile; + for Project_Path use + (Project'Project_Dir, Project'Project_Dir & ".."); + for Project_Files use ("microbit/board.gpr"); -end MicroBit; +end Microbit; diff --git a/boards/native.gpr b/boards/native.gpr index 5236041ab..4e371922b 100644 --- a/boards/native.gpr +++ b/boards/native.gpr @@ -1,15 +1,19 @@ aggregate library project Native is - Build := external ("BUILD", "Debug"); + Board := "native"; - for Project_Path use ("native"); + type Build_Type is ("Debug", "Production"); + Build : Build_Type := external ("PLATFORM_BUILD", "Production"); - for Project_Files use ("../hal/HAL.gpr", - "../components/components.gpr", - "../middleware/middleware.gpr", - "native/board.gpr"); - for Library_Dir use "lib/native/" & Build; - for Library_Name use "native"; + Obj_Suffix := "native-" & Build; + + for Library_Name use Board; + for Library_Dir use "lib/" & Obj_Suffix; + + for external ("Obj_Suffix") use Obj_Suffix; + for Project_Path use + (Project'Project_Dir, Project'Project_Dir & ".."); + for Project_Files use ("native/board.gpr"); end Native; diff --git a/boards/native/config.gpr b/boards/native/config.gpr deleted file mode 100644 index f24fe4bcf..000000000 --- a/boards/native/config.gpr +++ /dev/null @@ -1,14 +0,0 @@ -abstract project Config extends "../common_config" is - - RTS := "native"; - Build := Common_Config.Build; - - Object_Subdir := Build; - - -- Need that for abstract projects - for Source_Dirs use (); - - package Compiler renames Common_Config.Compiler; - package Builder renames Common_Config.Builder; - -end Config; diff --git a/boards/openmv2.gpr b/boards/openmv2.gpr index b3ef9445c..cb87af9e7 100644 --- a/boards/openmv2.gpr +++ b/boards/openmv2.gpr @@ -1,26 +1,26 @@ -aggregate library project OpenMV2 is +aggregate library project Openmv2 is - Build := external ("BUILD", "Debug"); + Board := "openmv2"; - type RTS_Type is ("ravenscar-sfp", "ravenscar-full"); - RTS : RTS_Type := External ("RTS", "ravenscar-sfp"); + type RTS_Profile_Type is ("ravenscar-sfp", "ravenscar-full"); + RTS_Profile : RTS_Profile_Type := + external ("RTS_Profile", "ravenscar-sfp"); - RTS_Base := Project'Project_Dir & - "../embedded-runtimes/ravenscar-openmv2"; - for Target use "arm-eabi"; + type Build_Type is ("Debug", "Production"); + Build : Build_Type := external ("PLATFORM_BUILD", "Production"); - case RTS is - when "ravenscar-sfp" => - for Runtime ("Ada") use RTS_Base & "/sfp"; - when "ravenscar-full" => - for Runtime ("Ada") use RTS_Base & "/full"; - end case; + for Target use "arm-eabi"; + for Runtime ("Ada") use RTS_Profile & "-" & Board; - for Project_Path use ("OpenMV2"); + Obj_Suffix := Board & "/" & RTS_Profile & "/" & Build; - for Project_Files use ("OpenMV2/board.gpr"); + for Library_Name use Board; + for Library_Dir use "lib/" & Obj_Suffix; - for Library_Dir use "lib/openmv2/" & RTS & "/" & Build; - for Library_Name use "openmv2"; + for external ("Obj_Suffix") use Obj_Suffix; + for external ("RTS_Profile") use RTS_Profile; + for Project_Path use + (Project'Project_Dir, Project'Project_Dir & ".."); + for Project_Files use ("openmv2/board.gpr"); -end OpenMV2; +end Openmv2; diff --git a/boards/openmv2_full.gpr b/boards/openmv2_full.gpr new file mode 100644 index 000000000..9dbdaf2f5 --- /dev/null +++ b/boards/openmv2_full.gpr @@ -0,0 +1,24 @@ +aggregate library project Openmv2_Full is + + Board := "openmv2"; + + RTS_Profile := "ravenscar-full"; + + type Build_Type is ("Debug", "Production"); + Build : Build_Type := external ("PLATFORM_BUILD", "Production"); + + for Target use "arm-eabi"; + for Runtime ("Ada") use RTS_Profile & "-" & Board; + + Obj_Suffix := Board & "/" & RTS_Profile & "/" & Build; + + for Library_Name use Board; + for Library_Dir use "lib/" & Obj_Suffix; + + for external ("Obj_Suffix") use Obj_Suffix; + for external ("RTS_Profile") use RTS_Profile; + for Project_Path use + (Project'Project_Dir, Project'Project_Dir & ".."); + for Project_Files use ("openmv2/board.gpr"); + +end Openmv2_Full; diff --git a/boards/openmv2_sfp.gpr b/boards/openmv2_sfp.gpr new file mode 100644 index 000000000..da14fd53e --- /dev/null +++ b/boards/openmv2_sfp.gpr @@ -0,0 +1,24 @@ +aggregate library project Openmv2_SFP is + + Board := "openmv2"; + + RTS_Profile := "ravenscar-sfp"; + + type Build_Type is ("Debug", "Production"); + Build : Build_Type := external ("PLATFORM_BUILD", "Production"); + + for Target use "arm-eabi"; + for Runtime ("Ada") use RTS_Profile & "-" & Board; + + Obj_Suffix := Board & "/" & RTS_Profile & "/" & Build; + + for Library_Name use Board; + for Library_Dir use "lib/" & Obj_Suffix; + + for external ("Obj_Suffix") use Obj_Suffix; + for external ("RTS_Profile") use RTS_Profile; + for Project_Path use + (Project'Project_Dir, Project'Project_Dir & ".."); + for Project_Files use ("openmv2/board.gpr"); + +end Openmv2_SFP; diff --git a/boards/stm32f407_discovery.gpr b/boards/stm32f407_discovery.gpr index 00f060eef..06a7a133f 100644 --- a/boards/stm32f407_discovery.gpr +++ b/boards/stm32f407_discovery.gpr @@ -1,26 +1,26 @@ -aggregate library project STM32F407_Discovery is +aggregate library project Stm32F407_Discovery is - Build := external ("BUILD", "Debug"); + Board := "stm32f407disco"; - type RTS_Type is ("ravenscar-sfp", "ravenscar-full"); - RTS : RTS_Type := External ("RTS", "ravenscar-sfp"); + type RTS_Profile_Type is ("ravenscar-sfp", "ravenscar-full"); + RTS_Profile : RTS_Profile_Type := + external ("RTS_Profile", "ravenscar-sfp"); + + type Build_Type is ("Debug", "Production"); + Build : Build_Type := external ("PLATFORM_BUILD", "Production"); - RTS_Base := Project'Project_Dir & - "../embedded-runtimes/ravenscar-stm32f407disco"; for Target use "arm-eabi"; + for Runtime ("Ada") use RTS_Profile & "-stm32f4"; - case RTS is - when "ravenscar-sfp" => - for Runtime ("Ada") use RTS_Base & "/sfp"; - when "ravenscar-full" => - for Runtime ("Ada") use RTS_Base & "/full"; - end case; + Obj_Suffix := Board & "/" & RTS_Profile & "/" & Build; - for Project_Path use ("stm32f407_discovery"); + for Library_Name use Board; + for Library_Dir use "lib/" & Obj_Suffix; + for external ("Obj_Suffix") use Obj_Suffix; + for external ("RTS_Profile") use RTS_Profile; + for Project_Path use + (Project'Project_Dir, Project'Project_Dir & ".."); for Project_Files use ("stm32f407_discovery/board.gpr"); - for Library_Dir use "lib/stm32f407disco/" & RTS & "/" & Build; - for Library_Name use "stm32f407disco"; - -end STM32F407_Discovery; +end Stm32F407_Discovery; diff --git a/boards/stm32f407_discovery/config.gpr b/boards/stm32f407_discovery/config.gpr deleted file mode 100644 index 50c6ad0f5..000000000 --- a/boards/stm32f407_discovery/config.gpr +++ /dev/null @@ -1,20 +0,0 @@ --- Version of the projects configuration for STM32F407-Discovery board. - --- Include the run-time project files to have them compiled -with "../../embedded-runtimes/ravenscar-stm32f407disco/ravenscar_build"; -with "../../embedded-runtimes/ravenscar-stm32f407disco/runtime_build"; - -abstract project Config extends "../common_config" is - - RTS := Runtime_Build.RTS; - Build := Common_Config.Build; - - Object_Subdir := "stm32f407disco/" & RTS & "/" & Build; - - -- Need that for abstract projects - for Source_Dirs use (); - - package Compiler renames Common_Config.Compiler; - package Builder renames Common_Config.Builder; - -end Config; diff --git a/boards/stm32f407_discovery_full.gpr b/boards/stm32f407_discovery_full.gpr new file mode 100644 index 000000000..263f56a29 --- /dev/null +++ b/boards/stm32f407_discovery_full.gpr @@ -0,0 +1,24 @@ +aggregate library project Stm32F407_Discovery_Full is + + Board := "stm32f407disco"; + + RTS_Profile := "ravenscar-full"; + + type Build_Type is ("Debug", "Production"); + Build : Build_Type := external ("PLATFORM_BUILD", "Production"); + + for Target use "arm-eabi"; + for Runtime ("Ada") use RTS_Profile & "-stm32f4"; + + Obj_Suffix := Board & "/" & RTS_Profile & "/" & Build; + + for Library_Name use Board; + for Library_Dir use "lib/" & Obj_Suffix; + + for external ("Obj_Suffix") use Obj_Suffix; + for external ("RTS_Profile") use RTS_Profile; + for Project_Path use + (Project'Project_Dir, Project'Project_Dir & ".."); + for Project_Files use ("stm32f407_discovery/board.gpr"); + +end Stm32F407_Discovery_Full; diff --git a/boards/stm32f407_discovery_sfp.gpr b/boards/stm32f407_discovery_sfp.gpr new file mode 100644 index 000000000..d10972dac --- /dev/null +++ b/boards/stm32f407_discovery_sfp.gpr @@ -0,0 +1,24 @@ +aggregate library project Stm32F407_Discovery_SFP is + + Board := "stm32f407disco"; + + RTS_Profile := "ravenscar-sfp"; + + type Build_Type is ("Debug", "Production"); + Build : Build_Type := external ("PLATFORM_BUILD", "Production"); + + for Target use "arm-eabi"; + for Runtime ("Ada") use RTS_Profile & "-stm32f4"; + + Obj_Suffix := Board & "/" & RTS_Profile & "/" & Build; + + for Library_Name use Board; + for Library_Dir use "lib/" & Obj_Suffix; + + for external ("Obj_Suffix") use Obj_Suffix; + for external ("RTS_Profile") use RTS_Profile; + for Project_Path use + (Project'Project_Dir, Project'Project_Dir & ".."); + for Project_Files use ("stm32f407_discovery/board.gpr"); + +end Stm32F407_Discovery_SFP; diff --git a/boards/stm32f429_discovery.gpr b/boards/stm32f429_discovery.gpr index d8087827d..8984e9307 100644 --- a/boards/stm32f429_discovery.gpr +++ b/boards/stm32f429_discovery.gpr @@ -1,26 +1,26 @@ -aggregate library project STM32F429_Discovery is +aggregate library project Stm32F429_Discovery is - Build := external ("BUILD", "Debug"); + Board := "stm32f429disco"; - type RTS_Type is ("ravenscar-sfp", "ravenscar-full"); - RTS : RTS_Type := External ("RTS", "ravenscar-sfp"); + type RTS_Profile_Type is ("ravenscar-sfp", "ravenscar-full"); + RTS_Profile : RTS_Profile_Type := + external ("RTS_Profile", "ravenscar-sfp"); + + type Build_Type is ("Debug", "Production"); + Build : Build_Type := external ("PLATFORM_BUILD", "Production"); - RTS_Base := Project'Project_Dir & - "../embedded-runtimes/ravenscar-stm32f429disco"; for Target use "arm-eabi"; + for Runtime ("Ada") use RTS_Profile & "-" & Board; - case RTS is - when "ravenscar-sfp" => - for Runtime ("Ada") use RTS_Base & "/sfp"; - when "ravenscar-full" => - for Runtime ("Ada") use RTS_Base & "/full"; - end case; + Obj_Suffix := Board & "/" & RTS_Profile & "/" & Build; - for Project_Path use ("stm32f429_discovery"); + for Library_Name use Board; + for Library_Dir use "lib/" & Obj_Suffix; + for external ("Obj_Suffix") use Obj_Suffix; + for external ("RTS_Profile") use RTS_Profile; + for Project_Path use + (Project'Project_Dir, Project'Project_Dir & ".."); for Project_Files use ("stm32f429_discovery/board.gpr"); - for Library_Dir use "lib/stm32f429disco/" & RTS & "/" & Build; - for Library_Name use "stm32f429disco"; - -end STM32F429_Discovery; +end Stm32F429_Discovery; diff --git a/boards/stm32f429_discovery/config.gpr b/boards/stm32f429_discovery/config.gpr deleted file mode 100644 index b43c8031d..000000000 --- a/boards/stm32f429_discovery/config.gpr +++ /dev/null @@ -1,20 +0,0 @@ --- Version of the projects configuration for STM32F429-Discovery board. - --- Include the run-time project files to have them compiled -with "../../embedded-runtimes/ravenscar-stm32f429disco/ravenscar_build"; -with "../../embedded-runtimes/ravenscar-stm32f429disco/runtime_build"; - -abstract project Config extends "../common_config" is - - RTS := Runtime_Build.RTS; - Build := Common_Config.Build; - - Object_Subdir := "stm32f429disco/" & RTS & "/" & Build; - - -- Need that for abstract projects - for Source_Dirs use (); - - package Compiler renames Common_Config.Compiler; - package Builder renames Common_Config.Builder; - -end Config; diff --git a/boards/stm32f429_discovery_full.gpr b/boards/stm32f429_discovery_full.gpr new file mode 100644 index 000000000..1b28efc66 --- /dev/null +++ b/boards/stm32f429_discovery_full.gpr @@ -0,0 +1,24 @@ +aggregate library project Stm32F429_Discovery_Full is + + Board := "stm32f429disco"; + + RTS_Profile := "ravenscar-full"; + + type Build_Type is ("Debug", "Production"); + Build : Build_Type := external ("PLATFORM_BUILD", "Production"); + + for Target use "arm-eabi"; + for Runtime ("Ada") use RTS_Profile & "-" & Board; + + Obj_Suffix := Board & "/" & RTS_Profile & "/" & Build; + + for Library_Name use Board; + for Library_Dir use "lib/" & Obj_Suffix; + + for external ("Obj_Suffix") use Obj_Suffix; + for external ("RTS_Profile") use RTS_Profile; + for Project_Path use + (Project'Project_Dir, Project'Project_Dir & ".."); + for Project_Files use ("stm32f429_discovery/board.gpr"); + +end Stm32F429_Discovery_Full; diff --git a/boards/stm32f429_discovery_sfp.gpr b/boards/stm32f429_discovery_sfp.gpr new file mode 100644 index 000000000..b4715fe20 --- /dev/null +++ b/boards/stm32f429_discovery_sfp.gpr @@ -0,0 +1,24 @@ +aggregate library project Stm32F429_Discovery_SFP is + + Board := "stm32f429disco"; + + RTS_Profile := "ravenscar-sfp"; + + type Build_Type is ("Debug", "Production"); + Build : Build_Type := external ("PLATFORM_BUILD", "Production"); + + for Target use "arm-eabi"; + for Runtime ("Ada") use RTS_Profile & "-" & Board; + + Obj_Suffix := Board & "/" & RTS_Profile & "/" & Build; + + for Library_Name use Board; + for Library_Dir use "lib/" & Obj_Suffix; + + for external ("Obj_Suffix") use Obj_Suffix; + for external ("RTS_Profile") use RTS_Profile; + for Project_Path use + (Project'Project_Dir, Project'Project_Dir & ".."); + for Project_Files use ("stm32f429_discovery/board.gpr"); + +end Stm32F429_Discovery_SFP; diff --git a/boards/stm32f469_discovery.gpr b/boards/stm32f469_discovery.gpr index a9b3f6b9a..e76baa155 100644 --- a/boards/stm32f469_discovery.gpr +++ b/boards/stm32f469_discovery.gpr @@ -1,26 +1,26 @@ -aggregate library project STM32F469_Discovery is +aggregate library project Stm32F469_Discovery is - Build := external ("BUILD", "Debug"); + Board := "stm32f469disco"; - type RTS_Type is ("ravenscar-sfp", "ravenscar-full"); - RTS : RTS_Type := External ("RTS", "ravenscar-sfp"); + type RTS_Profile_Type is ("ravenscar-sfp", "ravenscar-full"); + RTS_Profile : RTS_Profile_Type := + external ("RTS_Profile", "ravenscar-sfp"); + + type Build_Type is ("Debug", "Production"); + Build : Build_Type := external ("PLATFORM_BUILD", "Production"); - RTS_Base := Project'Project_Dir & - "../embedded-runtimes/ravenscar-stm32f469disco"; for Target use "arm-eabi"; + for Runtime ("Ada") use RTS_Profile & "-" & Board; - case RTS is - when "ravenscar-sfp" => - for Runtime ("Ada") use RTS_Base & "/sfp"; - when "ravenscar-full" => - for Runtime ("Ada") use RTS_Base & "/full"; - end case; + Obj_Suffix := Board & "/" & RTS_Profile & "/" & Build; - for Project_Path use ("stm32f469_discovery"); + for Library_Name use Board; + for Library_Dir use "lib/" & Obj_Suffix; + for external ("Obj_Suffix") use Obj_Suffix; + for external ("RTS_Profile") use RTS_Profile; + for Project_Path use + (Project'Project_Dir, Project'Project_Dir & ".."); for Project_Files use ("stm32f469_discovery/board.gpr"); - for Library_Dir use "lib/stm32f469disco/" & RTS & "/" & Build; - for Library_Name use "stm32f469disco"; - -end STM32F469_Discovery; +end Stm32F469_Discovery; diff --git a/boards/stm32f469_discovery/config.gpr b/boards/stm32f469_discovery/config.gpr deleted file mode 100644 index 297824792..000000000 --- a/boards/stm32f469_discovery/config.gpr +++ /dev/null @@ -1,20 +0,0 @@ --- Version of the projects configuration for STM32F469-Discovery board. - --- Include the run-time project files to have them compiled -with "../../embedded-runtimes/ravenscar-stm32f469disco/ravenscar_build"; -with "../../embedded-runtimes/ravenscar-stm32f469disco/runtime_build"; - -abstract project Config extends "../common_config" is - - RTS := Runtime_Build.RTS; - Build := Common_Config.Build; - - Object_Subdir := "stm32f469disco/" & RTS & "/" & Build; - - -- Need that for abstract projects - for Source_Dirs use (); - - package Compiler renames Common_Config.Compiler; - package Builder renames Common_Config.Builder; - -end Config; diff --git a/boards/stm32f469_discovery_full.gpr b/boards/stm32f469_discovery_full.gpr new file mode 100644 index 000000000..c00cc1eaf --- /dev/null +++ b/boards/stm32f469_discovery_full.gpr @@ -0,0 +1,24 @@ +aggregate library project Stm32F469_Discovery_Full is + + Board := "stm32f469disco"; + + RTS_Profile := "ravenscar-full"; + + type Build_Type is ("Debug", "Production"); + Build : Build_Type := external ("PLATFORM_BUILD", "Production"); + + for Target use "arm-eabi"; + for Runtime ("Ada") use RTS_Profile & "-" & Board; + + Obj_Suffix := Board & "/" & RTS_Profile & "/" & Build; + + for Library_Name use Board; + for Library_Dir use "lib/" & Obj_Suffix; + + for external ("Obj_Suffix") use Obj_Suffix; + for external ("RTS_Profile") use RTS_Profile; + for Project_Path use + (Project'Project_Dir, Project'Project_Dir & ".."); + for Project_Files use ("stm32f469_discovery/board.gpr"); + +end Stm32F469_Discovery_Full; diff --git a/boards/stm32f469_discovery_sfp.gpr b/boards/stm32f469_discovery_sfp.gpr new file mode 100644 index 000000000..890bb66b6 --- /dev/null +++ b/boards/stm32f469_discovery_sfp.gpr @@ -0,0 +1,24 @@ +aggregate library project Stm32F469_Discovery_SFP is + + Board := "stm32f469disco"; + + RTS_Profile := "ravenscar-sfp"; + + type Build_Type is ("Debug", "Production"); + Build : Build_Type := external ("PLATFORM_BUILD", "Production"); + + for Target use "arm-eabi"; + for Runtime ("Ada") use RTS_Profile & "-" & Board; + + Obj_Suffix := Board & "/" & RTS_Profile & "/" & Build; + + for Library_Name use Board; + for Library_Dir use "lib/" & Obj_Suffix; + + for external ("Obj_Suffix") use Obj_Suffix; + for external ("RTS_Profile") use RTS_Profile; + for Project_Path use + (Project'Project_Dir, Project'Project_Dir & ".."); + for Project_Files use ("stm32f469_discovery/board.gpr"); + +end Stm32F469_Discovery_SFP; diff --git a/boards/stm32f746_discovery.gpr b/boards/stm32f746_discovery.gpr index 2e4c4c290..107b6baad 100644 --- a/boards/stm32f746_discovery.gpr +++ b/boards/stm32f746_discovery.gpr @@ -1,27 +1,26 @@ -aggregate library project STM32F746_Discovery is +aggregate library project Stm32F746_Discovery is - Build := external ("BUILD", "Debug"); + Board := "stm32f746disco"; - type RTS_Type is ("ravenscar-sfp", "ravenscar-full"); - RTS : RTS_Type := External ("RTS", "ravenscar-sfp"); + type RTS_Profile_Type is ("ravenscar-sfp", "ravenscar-full"); + RTS_Profile : RTS_Profile_Type := + external ("RTS_Profile", "ravenscar-sfp"); + + type Build_Type is ("Debug", "Production"); + Build : Build_Type := external ("PLATFORM_BUILD", "Production"); - RTS_Base := Project'Project_Dir & - "../embedded-runtimes/ravenscar-stm32f746disco"; for Target use "arm-eabi"; + for Runtime ("Ada") use RTS_Profile & "-" & Board; - case RTS is - when "ravenscar-sfp" => - for Runtime ("Ada") use RTS_Base & "/sfp"; - when "ravenscar-full" => - for Runtime ("Ada") use RTS_Base & "/full"; - end case; + Obj_Suffix := Board & "/" & RTS_Profile & "/" & Build; - for Project_Path use ("stm32f746_discovery"); + for Library_Name use Board; + for Library_Dir use "lib/" & Obj_Suffix; + for external ("Obj_Suffix") use Obj_Suffix; + for external ("RTS_Profile") use RTS_Profile; + for Project_Path use + (Project'Project_Dir, Project'Project_Dir & ".."); for Project_Files use ("stm32f746_discovery/board.gpr"); - for Library_Dir use - "lib/stm32f746disco/" & RTS & "/" & Build; - for Library_Name use "stm32f746disco"; - -end STM32F746_Discovery; +end Stm32F746_Discovery; diff --git a/boards/stm32f746_discovery/config.gpr b/boards/stm32f746_discovery/config.gpr deleted file mode 100644 index 2db1551fd..000000000 --- a/boards/stm32f746_discovery/config.gpr +++ /dev/null @@ -1,20 +0,0 @@ --- Version of the projects configuration for STM32F746G-Discovery board. - --- Include the run-time project files to have them compiled -with "../../embedded-runtimes/ravenscar-stm32f746disco/ravenscar_build"; -with "../../embedded-runtimes/ravenscar-stm32f746disco/runtime_build"; - -abstract project Config extends "../common_config" is - - RTS := Runtime_Build.RTS; - Build := Common_Config.Build; - - Object_Subdir := "stm32f746disco/" & RTS & "/" & Build; - - -- Need that for abstract projects - for Source_Dirs use (); - - package Compiler renames Common_Config.Compiler; - package Builder renames Common_Config.Builder; - -end Config; diff --git a/boards/stm32f746_discovery_full.gpr b/boards/stm32f746_discovery_full.gpr new file mode 100644 index 000000000..7a6ef7307 --- /dev/null +++ b/boards/stm32f746_discovery_full.gpr @@ -0,0 +1,24 @@ +aggregate library project Stm32F746_Discovery_Full is + + Board := "stm32f746disco"; + + RTS_Profile := "ravenscar-full"; + + type Build_Type is ("Debug", "Production"); + Build : Build_Type := external ("PLATFORM_BUILD", "Production"); + + for Target use "arm-eabi"; + for Runtime ("Ada") use RTS_Profile & "-" & Board; + + Obj_Suffix := Board & "/" & RTS_Profile & "/" & Build; + + for Library_Name use Board; + for Library_Dir use "lib/" & Obj_Suffix; + + for external ("Obj_Suffix") use Obj_Suffix; + for external ("RTS_Profile") use RTS_Profile; + for Project_Path use + (Project'Project_Dir, Project'Project_Dir & ".."); + for Project_Files use ("stm32f746_discovery/board.gpr"); + +end Stm32F746_Discovery_Full; diff --git a/boards/stm32f746_discovery_sfp.gpr b/boards/stm32f746_discovery_sfp.gpr new file mode 100644 index 000000000..103419e9c --- /dev/null +++ b/boards/stm32f746_discovery_sfp.gpr @@ -0,0 +1,24 @@ +aggregate library project Stm32F746_Discovery_SFP is + + Board := "stm32f746disco"; + + RTS_Profile := "ravenscar-sfp"; + + type Build_Type is ("Debug", "Production"); + Build : Build_Type := external ("PLATFORM_BUILD", "Production"); + + for Target use "arm-eabi"; + for Runtime ("Ada") use RTS_Profile & "-" & Board; + + Obj_Suffix := Board & "/" & RTS_Profile & "/" & Build; + + for Library_Name use Board; + for Library_Dir use "lib/" & Obj_Suffix; + + for external ("Obj_Suffix") use Obj_Suffix; + for external ("RTS_Profile") use RTS_Profile; + for Project_Path use + (Project'Project_Dir, Project'Project_Dir & ".."); + for Project_Files use ("stm32f746_discovery/board.gpr"); + +end Stm32F746_Discovery_SFP; diff --git a/boards/stm32f769_discovery.gpr b/boards/stm32f769_discovery.gpr index 481216f85..bf4ee069b 100644 --- a/boards/stm32f769_discovery.gpr +++ b/boards/stm32f769_discovery.gpr @@ -1,26 +1,26 @@ -aggregate library project STM32F769_Discovery is +aggregate library project Stm32F769_Discovery is - Build := external ("BUILD", "Debug"); + Board := "stm32f769disco"; - type RTS_Type is ("ravenscar-sfp", "ravenscar-full"); - RTS : RTS_Type := External ("RTS", "ravenscar-sfp"); + type RTS_Profile_Type is ("ravenscar-sfp", "ravenscar-full"); + RTS_Profile : RTS_Profile_Type := + external ("RTS_Profile", "ravenscar-sfp"); + + type Build_Type is ("Debug", "Production"); + Build : Build_Type := external ("PLATFORM_BUILD", "Production"); - RTS_Base := Project'Project_Dir & - "../embedded-runtimes/ravenscar-stm32f769disco"; for Target use "arm-eabi"; + for Runtime ("Ada") use RTS_Profile & "-" & Board; - case RTS is - when "ravenscar-sfp" => - for Runtime ("Ada") use RTS_Base & "/sfp"; - when "ravenscar-full" => - for Runtime ("Ada") use RTS_Base & "/full"; - end case; + Obj_Suffix := Board & "/" & RTS_Profile & "/" & Build; - for Project_Path use ("stm32f769_discovery"); + for Library_Name use Board; + for Library_Dir use "lib/" & Obj_Suffix; + for external ("Obj_Suffix") use Obj_Suffix; + for external ("RTS_Profile") use RTS_Profile; + for Project_Path use + (Project'Project_Dir, Project'Project_Dir & ".."); for Project_Files use ("stm32f769_discovery/board.gpr"); - for Library_Dir use "lib/stm32f769disco/" & RTS & "/" & Build; - for Library_Name use "stm32f769disco"; - -end STM32F769_Discovery; +end Stm32F769_Discovery; diff --git a/boards/stm32f769_discovery/config.gpr b/boards/stm32f769_discovery/config.gpr deleted file mode 100644 index 2e92963fe..000000000 --- a/boards/stm32f769_discovery/config.gpr +++ /dev/null @@ -1,20 +0,0 @@ --- Version of the projects configuration for STM32F769-Discovery board. - --- Include the run-time project files to have them compiled -with "../../embedded-runtimes/ravenscar-stm32f769disco/ravenscar_build"; -with "../../embedded-runtimes/ravenscar-stm32f769disco/runtime_build"; - -abstract project Config extends "../common_config" is - - RTS := Runtime_Build.RTS; - Build := Common_Config.Build; - - Object_Subdir := "stm32f769disco/" & RTS & "/" & Build; - - -- Need that for abstract projects - for Source_Dirs use (); - - package Compiler renames Common_Config.Compiler; - package Builder renames Common_Config.Builder; - -end Config; diff --git a/boards/stm32f769_discovery_full.gpr b/boards/stm32f769_discovery_full.gpr new file mode 100644 index 000000000..9a87ca507 --- /dev/null +++ b/boards/stm32f769_discovery_full.gpr @@ -0,0 +1,24 @@ +aggregate library project Stm32F769_Discovery_Full is + + Board := "stm32f769disco"; + + RTS_Profile := "ravenscar-full"; + + type Build_Type is ("Debug", "Production"); + Build : Build_Type := external ("PLATFORM_BUILD", "Production"); + + for Target use "arm-eabi"; + for Runtime ("Ada") use RTS_Profile & "-" & Board; + + Obj_Suffix := Board & "/" & RTS_Profile & "/" & Build; + + for Library_Name use Board; + for Library_Dir use "lib/" & Obj_Suffix; + + for external ("Obj_Suffix") use Obj_Suffix; + for external ("RTS_Profile") use RTS_Profile; + for Project_Path use + (Project'Project_Dir, Project'Project_Dir & ".."); + for Project_Files use ("stm32f769_discovery/board.gpr"); + +end Stm32F769_Discovery_Full; diff --git a/boards/stm32f769_discovery_sfp.gpr b/boards/stm32f769_discovery_sfp.gpr new file mode 100644 index 000000000..6fd6e3899 --- /dev/null +++ b/boards/stm32f769_discovery_sfp.gpr @@ -0,0 +1,24 @@ +aggregate library project Stm32F769_Discovery_SFP is + + Board := "stm32f769disco"; + + RTS_Profile := "ravenscar-sfp"; + + type Build_Type is ("Debug", "Production"); + Build : Build_Type := external ("PLATFORM_BUILD", "Production"); + + for Target use "arm-eabi"; + for Runtime ("Ada") use RTS_Profile & "-" & Board; + + Obj_Suffix := Board & "/" & RTS_Profile & "/" & Build; + + for Library_Name use Board; + for Library_Dir use "lib/" & Obj_Suffix; + + for external ("Obj_Suffix") use Obj_Suffix; + for external ("RTS_Profile") use RTS_Profile; + for Project_Path use + (Project'Project_Dir, Project'Project_Dir & ".."); + for Project_Files use ("stm32f769_discovery/board.gpr"); + +end Stm32F769_Discovery_SFP; diff --git a/embedded-runtimes b/embedded-runtimes deleted file mode 160000 index 5cca89013..000000000 --- a/embedded-runtimes +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 5cca89013958a14831ac029c60636c7c56bf8f5f diff --git a/examples/OpenMV2/openmv2_example.gpr b/examples/OpenMV2/openmv2_example.gpr index b78fffc42..abb0bcb8a 100644 --- a/examples/OpenMV2/openmv2_example.gpr +++ b/examples/OpenMV2/openmv2_example.gpr @@ -1,5 +1,5 @@ with "../../boards/openmv2"; -with "../../boards/OpenMV2/config"; +with "../../boards/config"; project OpenMV2_Example is diff --git a/examples/shared/common/common.gpr b/examples/shared/common/common.gpr index f38cada61..c22123cdf 100644 --- a/examples/shared/common/common.gpr +++ b/examples/shared/common/common.gpr @@ -1,4 +1,4 @@ -with "../../../boards/common_config"; +with "../../../boards/config"; project Common is @@ -7,7 +7,7 @@ project Common is LOADER : LOADER_Type := external ("LOADER", "ROM"); type RTS_Type is ("ravenscar-sfp", "ravenscar-full"); - RTS : RTS_Type := External ("RTS", "ravenscar-sfp"); + RTS : RTS_Type := External ("RTS_Profile", "ravenscar-sfp"); type LCH_Type is ("led", "lcd"); LCH : LCH_Type := external ("LCH", "led"); @@ -35,12 +35,12 @@ project Common is end case; end case; - package Compiler renames Common_Config.Compiler; - package Builder renames Common_Config.Builder; + package Compiler renames Config.Compiler; + package Builder renames Config.Builder; package Linker is for Default_Switches ("Ada") use - ("-Wl,--defsym=__stack_size=32768", + ("-Wl,--defsym=__stack_size=32768", "-Wl,--gc-sections", "-Wl,--print-memory-usage"); end Linker;