Building system

Moderators: dhowells, RobertKleczek, Lucretia

Building system

Postby RobertKleczek » Mon Sep 07, 2015 11:06 pm

Hi to everyone,

I've just uploaded to https://github.com/rowsail/AdaForMicrocontrollers into new branch GPL2015 proposition of building scripts. With these scripts after installing Adacore GPL2015 for Arm you can build many different runtimes from one central code repository. You can build zfp, ravenscar-sfp, ravenscar-full and after expanding it other runtimes for many microcontrollers, many implementations etc. The system is expandable. Just copy the "rts" directory to your Adacore runtime path (usually - /usr/gnat/arm-eabi/lib/gnat/ directory for linux), then open runtime script in GPS editor. Select proper scenarios variables, build all & install (I've used "%builder -d %eL -P%PP %X -j6 -s -p" for builder & "gprinstall -p -f -r -P%PP %X" for new install menu item), then runtimes will be installed to your default runtime directory, so can be used just selecting the runtime & target in your end-user project - look at attached examples. All needed files to link & proper compiler option & etc. will be linked automatically through .xml config files. There are three runtime implementation for now (all the same - adacore - original, armada - reserved for me, example - for example ;) ), a lot of microcontrollers definitions but implemented stm32f4XX family, rest partially or non implemented at all, and three runtime profiles zfp, ravenscar-sfp, ravenscar-full. Runtimes for adacore will be installed in one directory (eg. zfp-softfp-thumb-stm32f407ve), the other runtimes implementation will be installed in two directories (one for architecture dependent part, and the another for common cpu/fpu/abi/codeset to be reusable). The building system can concatenate these two directories in invisible way for end-user - just give as a runtime an architecture dependent one - eg. ravenscar-sfp-hard-thumb-stm32f407ve-armada. All sources directories are organized in tree way, so deeper located sources are joined with previous one through the path.
Enjoy. I'm interested in your opinion.
Robert Kłeczek.
RobertKleczek
 
Posts: 10
Joined: Tue Sep 02, 2014 7:28 pm

Re: Building system

Postby dhowells » Tue Sep 08, 2015 11:36 pm

Excellent! I'm going to post a link on the Linked In website to promote this.
dhowells
Site Admin
 
Posts: 11
Joined: Tue Sep 02, 2014 1:04 am

Re: Building system

Postby RobertKleczek » Wed Sep 09, 2015 10:01 am

Here comes some explanation of used directory & files structure
Code: Select all
test >|
      |> demo_led_stm32f4 >| main project files, defs.gpr for select loader
      |                    |
      |                    |> exec >| - regular executable
      |                    |        |
      |                    |        |>  debug <or other> - executable if you select runtime with build <or other eg. profile, etc.> support (ending with -debug, -profile if implemented)
      |                    |
      |                    |> obj   | - regular object files
      |                    |        |
      |                    |        |>  debug <or other> - executable if you select runtime with build <or other eg. profile, etc.> support (ending with -debug, -profile if implemented)
      |                    |
      |                    |> src source files
      |
      |> demo_led_tms570 > as above


gnat >|
      |> rts >| main building system files
              | runtime.gpr   - main build project file to be loaded by GPS
              | gnat.gpr      - build gnat library
              | gnarl.gpr     - build gnarls library if exists
              | types.gpr     - abstract project with used common types definitions (expand it if you want new profiles, implementations, cpus etc.)
              | mpu_list.gpr  - abstract project with all known microcontrollers
              | mpu_specs.gpr - abstract project for family & architecture definitions for microcontrollers
              | scenarios.gpr - abstract project for user available build scenarios (expand in the case of new implemented profiles)
              | specs.gpr     - abstract project defines all needed variables used by library building project files (should stay unchanged)
              |
              |> adainclude >|> TEMPLATE - (with subdirectories) - template for implementation system
              |              |
              |              |  {adacore}
              |              |> {armada } >| definitions for implementations systems
              |              |  {example}  |
              |              |             |> gnarl >| common part of gnarl sources
              |              |             |         |
              |              |             |         |> zfp - zfp gnarl part of sources (is anyone?)
              |              |             |         |
              |              |             |         |> ravenscar >| common ravenscar part of gnarl sources
              |              |             |                       |
              |              |             |                       |> sfp  - sfp part of gnarl sources
              |              |             |                       |
              |              |             |                       |> full - full part of gnarl sources
              |              |             |
              |              |             |> gnat >| common part of gnat sources
              |              |             |        |
              |              |             |        |> zfp - zfp gnat part of sources
              |              |             |        |
              |              |             |        |> ravenscar >| common ravenscar part of gnat sources
              |              |             |                      |
              |              |             |                      |> sfp  - sfp part of gnat sources
              |              |             |                      |
              |              |             |                      |> full - full part of gnat sources
              |              |             |
              |              |             |> specs >| common for given implementation runtime build definitions
              |              |                       | binder.xml         - Binder receipes (for concatenate separate parts of runtime)
              |              |                       | compiler.xml       - Compiler switches (& includes used for concatenate runtimes)
              |              |                       | implementation.xml - name of implementation
              |              |                       | link.xml           - receipes for Linker (also used for concatenate separate runtimes)
              |              |
              |              |> mpu >| architecture (for common group of microcontrollers) dependent sources & definitions
              |                      |
              |                      |> TEMPLATE - (with subdirectories) - template for microcontroller family definitions
              |                      |
              |                      |  { lm4f  }
              |                      |> {stmf407} >|  {adacore}
              |                         {.......}  |> {armada } >| definitions of mcu part of implementation systems
              |                                    |  {example}  |
              |                                    |             |> gnarl >| mcu common part of gnarl sources - good place for common mcu start files
              |                                    |             |         |
              |                                    |             |         |> zfp - zfp gnarl sources (is anyone?)
              |                                    |             |         |
              |                                    |             |         |> ravenscar >| common part of mcu ravenscar gnarl sources (s-bbsosu, s-bbpara, a-intnam [maybe different for each MCU?])
              |                                    |             |                       |
              |                                    |             |                       |> sfp - sfp part of mcu gnarl sources
              |                                    |             |                       |
              |                                    |             |                       |> full - full part of mcu gnarl sources
              |                                    |             |
              |                                    |             |> gnat >| mcu common part of gnat sources - good place for common mcu start files
              |                                    |             |        |
              |                                    |             |        |> zfp - zfp gnat sources - here comes zfp system.ads
              |                                    |             |        |
              |                                    |             |        |> ravenscar >| common part of mcu ravenscar gnat sources
              |                                    |             |                      |
              |                                    |             |                      |> sfp - sfp part of mcu gnat sources - here comes ravenscar-sfp system.ads
              |                                    |             |                      |
              |                                    |             |                      |> full - full part of mcu gnat sources - here comes ravenscar-full system.ads
              |                                    |             |
              |                                    |             |> specs >| specific mcu implementation definitions files
              |                                    |                       | for now here goes common linker template files
              |                                    |
              |                                    |> specs >| architecture.xml - define cpu/fpu/endianes & linker page size for this group
              |                                              | ide.xml          - IDE properties for builded runtime (eg. debug method)
              |                                              | mcu.xml          - microcontroller full name
              |                                              | mcu.def          - memory space definitions - to be linked with linker template files & then copied to runtime as linker .ld file
              |
              |> adalib - temporary directory for builded libraries
              |
              |> obj - temporary directory for compiled sources
              |
              |> specs >| configuration files to be copied for selected runtimes
                        |
                        |> build - definitions for all implemented optional buildings (production, debug, ...)
                        |
                        |> code - supported instruction sets
                        |
                        |> float - supported float eabi implementations
                        |
                        |> profile - supported Ada profiles


Robert Kłeczek
RobertKleczek
 
Posts: 10
Joined: Tue Sep 02, 2014 7:28 pm

Re: Building system

Postby RobertKleczek » Wed Sep 23, 2015 9:40 am

Hi again,

I've extend building scripts, and now they can be used to build runtimes in GNAT GPL as well as in GCC FSF environment. Some bugs was removed. Some scripts moved from MCU's to common directories to be easier modifiable. Supported multilib versions are now explicitly given in gnat/rts/specs/libgcc directories (because of various behavior multilib implementations, even within GCC FSF). If you are using GPS, Gprbuild, Gprconfig system (recommended) you must update some gprconfig scripts (look into gprbuild directory). One non official gprconfig variable is used "gcc_version", so if you don't agree with this, please change it in link.xml template - comment given.

Comment are welcome.
Robert Kłeczek
RobertKleczek
 
Posts: 10
Joined: Tue Sep 02, 2014 7:28 pm


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron