Many embedded developers, and even entire development teams, exclusively use an IDE to build software. This can be a time-saver on a new project or prototyping effort, because the IDE hides the details from us and allows us to produce a working binary with a single button press.
IDEs are a double-edged sword. Because IDEs hide the details of the software construction process, many developers don’t understand the basics of how software is assembled. Even more troubling, most IDEs do not provide a way to trigger a build using an automated service. Because of this, customer releases are often manually created on a single developer’s machine. That is an error-prone process.
Using an IDE to build software for release is not advised. Developers can forget to clean their build artifacts before producing a customer release build. They might use the wrong branch, or have working changes in place that they’ve forgotten about. They might produce the wrong variant of software. We have seen all these scenarios during our careers.
What we want is to produce software in a consistent and repeatable manner. Ideally, our method is automated and executed by a dedicated build machine. We accomplish this by creating a build system: software tooling used to repeatedly assemble the software and its variants in a correct and reproducible manner.
This introductory course will teach you the basics of the software construction process. You will learn how build systems help us automate the software construction process while avoiding common build-related errors. While we focus on techniques relevant to C and C++ in this course, the same techniques apply to other compiled programming languages.
You will start by learning how to manually use the compiler and linker to produce object files, libraries, and binaries. Once you’ve learned how to use these essential programs, you will automate the process using a homemade build system implemented in Make. We will expose you to many of the real-world build system problems and pain points we’ve experienced during our careers.
Finally, you’ll learn about dedicated build system projects which help you avoid these all-too-common errors, enable you to quickly create new software builds, and allow you to incorporate tooling to create a complex software process.
Understanding how software is constructed (and the common errors encountered during the construction process) will save you countless hours on your embedded adventures.
By the end of this course, you will know how to:
- Compile and link software
- Automate software builds with Make
- Identify, diagnose, and solve common build problems
- Evaluate build systems and select the right one for your needs
- Use Meson and CMake to produce basic libraries and binaries
