Summary
In Chapter 24, Working with Multi-File Programs, we saw how to break a single C file into multiple files each with one or more headers. In this chapter, we extended our ability to reliably and easily build multi-file projects with the help of the GNU make
utility. This utility allows us to set macro values and create build rules, where each rule has a target, dependencies, and actions to be performed when the target is out of date (or non-existent). We created two utility rules to make working with files easier. We saw how to use make’s special macros, a basic pattern rule, and two built-in string functions. From this, we have a general makefile for use in any simple source code project.
In the next chapter, we will use parts of the dealer
source code files along with the continued use of make
to build two rudimentary interactive card games – Blackjack and one-handed Solitaire.