CMSIS-Build  Version 0.9.0 (beta)
Tools, software frameworks, and work flows for productivity with CMSIS based projects
 All Pages
cbuild.sh: Build Invocation

The cbuild.sh script starts the build process. It is called from the Bash command line with the following syntax:

$ cbuild.sh <ProjectFile>.cprj [--toolchain=<Toolchain> --output=<OutputPath> <MakefileTarget>]

Where:

cbuild.sh is the name of the script.

<ProjectFile> specifies the project file in CMSIS project format.

Optional:

<Toolchain> specifies the selected toolchain for projects that support multiple compilers.

<OutputPath> specifies the output directory.

<MakefileTarget> specifies the <target> option for make.

The cbuild.sh: Build Invocation script implements the build flow by chaining the utilities cbuildgen, ccmerge, and Make. It replicates the build steps of CMSIS-Pack aware IDEs and also updates configuration files if necessary. The script can be adopted to project specific requirements.

The build flow of the cbuild.sh: Build Invocation script is:

  1. Call cbuildgen: Build Process Manager with command packlist to list the URLs of missing software packs.
  2. Call cp_install.sh: Install Packs to download and install missing software packs.
  3. Call cbuildgen: Build Process Manager with command make to generate Make files.
  4. Call make: GNU Make to update configuration files using ccmerge: Config File Updater.
  5. Call make: GNU Make to compile the project source code into the binary image.

Usage Example

$ cbuild.sh Simulation.cprj
(cbuild.sh): Build Invocation 0.9.0 (C) 2020 ARM
Simulation.cprj validates
(cbuildgen): Build Process Manager 0.9.0 (C) 2020 ARM
M650: Config command completed successfully.
(cbuildgen): Build Process Manager 0.9.0 (C) 2020 ARM
M651: Generated makefile for merging config files: 'Simulation_cfg.mak'
M652: Generated makefile for project build:'Simulation.mak'
mkdir -p "/c/Examples/Blinky/Objects/RTE/CMSIS/RTOS2/Keil RTX5/Library"
mkdir -p "/c/Examples/Blinky/Objects/RTE/Compiler/IO/STDOUT/ITM"
mkdir -p "/c/Examples/Blinky/Objects/RTE/Device/Startup/C Startup"
mkdir -p "/c/Examples/Blinky/Objects/Source Files"
"/C/Keil_v5/ARM/ARMCLANG/bin/armclang" @"/c/Examples/Blinky/Objects/RTE/CMSIS/RTOS2/Keil RTX5/Library/RTX_Config.o._cc"
"/C/Keil_v5/ARM/ARMCLANG/bin/armclang" @"/c/Examples/Blinky/Objects/RTE/CMSIS/RTOS2/Keil RTX5/Library/rtx_lib.o._cc"
"/C/Keil_v5/ARM/ARMCLANG/bin/armclang" @"/c/Examples/Blinky/Objects/RTE/Compiler/IO/STDOUT/ITM/retarget_io.o._cc"
"/C/Keil_v5/ARM/ARMCLANG/bin/armclang" @"/c/Examples/Blinky/Objects/RTE/Device/Startup/C Startup/startup_ARMCM3.o._cc"
"/C/Keil_v5/ARM/ARMCLANG/bin/armclang" @"/c/Examples/Blinky/Objects/RTE/Device/Startup/C Startup/system_ARMCM3.o._cc"
"/C/Keil_v5/ARM/ARMCLANG/bin/armclang" @"/c/Examples/Blinky/Objects/Source Files/Blinky.o._cc"
"/C/Keil_v5/ARM/ARMCLANG/bin/armlink" --via="/c/Examples/Blinky/Objects/Blinky.axf._ld"
Program Size: Code=7516 RO-data=1264 RW-data=168 ZI-data=9084
cbuild.sh finished successfully!

Error Messages

Type Message Action
ERROR error: missing required argument <project>.cprj See usage and correct the argument.
ERROR error: CMSIS_BUILD_ROOT environment variable not set Set Environment Variables.
ERROR make ${output}${project}_cfg.mak failed! Check make error messages.
ERROR make ${output}${project}.mak failed! Check make error messages.
INFO cbuild.sh finished successfully! For information only.