Wiki › Project

Makefile demo

Article
From Chaipat's knowledge graph

Makefile demo teaches Make in three steps, each a small C project with its own Makefile.

StepWhat it shows
simple/The minimum needed to compile and run a tiny program
normal/A separate build folder, pattern rules, header dependencies and a help target
advanced/Several modules, a static library, generated headers, dependency files, order-only prerequisites, target-specific variables, .ONESHELL, .SECONDEXPANSION, packaging and a test target

A top-level Makefile builds all three, or one with make -C advanced, and shows parallel builds with make -j4. The same practices appear in the Makefile of his mops command-line tool.

See also