diff --git a/crates/algorithms/algorithms-c/README.md b/crates/algorithms/algorithms-c/README.md index aa27051..b0539df 100755 --- a/crates/algorithms/algorithms-c/README.md +++ b/crates/algorithms/algorithms-c/README.md @@ -3,3 +3,18 @@ This subproject contains all C Code for the benchmarking. It is built with [ceedling](https://www.throwtheswitch.org/ceedling), a more modern build tool for C projects that also integrates well with the Unity framework. + +## Compiler + +To compile for STM32, you need to crosscompile + +``` +# apt install binutils-arm-none-eabi gcc-arm-none-eabi +``` + +Then, use your tool with an `arm-none-eabi-` prefix: `arm-none-eabi-gcc`. This +project has been configured to use `arm-none-eabi-gcc` to compile modules and to +"link" the object files into a static library with `arm-none-eabi-ar`. + +The unit tests will be compiled with `gcc` to be ran on the host computer, not +on the STM32. diff --git a/crates/algorithms/algorithms-c/project.yml b/crates/algorithms/algorithms-c/project.yml index 8c7e333..dcf9307 100755 --- a/crates/algorithms/algorithms-c/project.yml +++ b/crates/algorithms/algorithms-c/project.yml @@ -340,7 +340,7 @@ # TOOLCHAIN CONFIGURATION ################################################################ -#:tools: +:tools: # Ceedling defaults to using gcc for compiling, linking, etc. # As [:tools] is blank, gcc will be used (so long as it's in your system path) # See documentation to configure a given toolchain for use @@ -380,21 +380,27 @@ # :arguments: [] # :name: # :optional: FALSE -# :release_compiler: -# :executable: -# :arguments: [] -# :name: -# :optional: FALSE -# :release_linker: -# :executable: -# :arguments: [] -# :name: -# :optional: FALSE -# :release_assembler: -# :executable: -# :arguments: [] -# :name: -# :optional: FALSE + :release_compiler: + :executable: arm-none-eabi-gcc + :arguments: + - "-g" + - "-Wall" + - "-c" + - "${1}" + - "-o" + - "${2}" + :optional: FALSE + :release_linker: + :executable: arm-none-eabi-ar + :arguments: + - "-rcs" + - "${2}" + - "${1}" + :optional: FALSE + # :release_assembler: + # :executable: arm-none-eabi-as + # :arguments: ["$@"] + # :optional: FALSE # :release_dependencies_generator: # :executable: # :arguments: []