The example provided here is one of the simplest executable images that can be run on the target. To assemble, compile and link everything together, we can use a simple makefile that automates all the steps and allows us to focus on our software life cycle.
When the image is ready, we can transfer it to the real target, or alternatively, run it using an emulator.
A very basic makefile to build our startup application describes the final target (image.bin
) and the intermediate steps required to build it. Makefile syntax is in general very vast, and covering all the functions provided by Make is outside the scope of this book. However, the few concepts explained here should be sufficient to get up and running on automating the build process.
The typical syntax to define a target
in the makefile is:
target: dependencies recipe
A target
is the name of the output file being built, followed by :
. Dependencies are input files, expected to be found,...