The Make Process

Make works in two distinct phases:

A project is comprised of things called targets where a target is usually a source file, object file, or executable file.

Reading the makefiles gives Make dependency information — which targets depend on which other targets. You can think of this dependency information as being organized into a tree of dependencies. The tree may be several levels deep. For example, an executable proj.exe may depend on main.obj and io.obj, each of which depend on source files main.c and io.c, respectively.

Make traverses this dependency tree, comparing the timestamp of each target to the timestamp of all its dependencies, rebuilding the target if it is older than any of its dependencies. For each target the tree is traversed down to the bottom, then back up, and the target is rebuilt if it is older than any of its dependencies.