Makefile architecture concepts
Explore Make and its surrounding shell, toolchain, and repository practices by subject instead of commit order. Each section begins with a free foundation, followed by deeper explanations included with full access.
Concepts
Read a section in order, or open a concept exactly when a lesson references it.
Concept library
16 concepts
Section 01
5 concepts
Makefiles and parsing
Understand what a makefile describes and how GNU Make finds the file it reads.
- 1.1Concept 1.1FreeMakefilesUnderstand the file that tells `make` how to build a project and run other project tasks.
- 1.2Concept 1.2FreeMakefile discoverySee how `make` searches for a makefile when no arguments are provided.
- 1.3Concept 1.3Full accessIncluded makefiles and path anchorsResolve included makefiles from a stable anchor instead of depending on the invocation directory.
- 1.4Concept 1.4Full accessVariable scope and expansion timingChoose when a Make variable expands and understand why included files share one parsed namespace.
- 1.5Concept 1.5Full accessMAKEFILES and recursive stateUse `MAKEFILES` as a scoped bootstrap while keeping recursive Make state from leaking into a fresh invocation.
Section 02
4 concepts
Rules and targets
Understand the parts of a rule and the special targets used to name build behavior.
- 2.1Concept 2.1FreeRule anatomySee how a rule connects a target, its prerequisites, and the recipe that can update it.
- 2.2Concept 2.2Full accessPhony targetsUse phony targets for named build behavior that must never be confused with a file.
- 2.3Concept 2.3Full accessPattern rules and automatic variablesUse `%` to describe a family of targets and automatic variables to refer to each concrete match.
- 2.4Concept 2.4Full accessPrerequisites and freshnessModel what makes a target stale while separating real inputs from prerequisites needed only for ordering.
Section 03
2 concepts
Goals and execution
Follow how selected goals lead Make through the dependency graph in a particular run.
Section 04
2 concepts
Recipes and shells
See where Make expansion ends and the recipe shell's variables, processes, and sourced state begin.
- 4.1Concept 4.1FreeThe Make-to-shell boundaryTrace dollar signs, variables, and environment values across Make's recipe expansion and the shell that executes it.
- 4.2Concept 4.2Full accessSourced shell stateTreat sourced POSIX shell code as shared state and use naming conventions to make collisions visible.
Section 05
2 concepts
Managed installations
Build reproducible tool installations from verified artifacts, immutable releases, and stable command paths.
- 5.1Concept 5.1FreeStaged tool installationDownload into a temporary area, verify the artifact, and expose it only after the complete result is ready.
- 5.2Concept 5.2Full accessVersioned releases and stable symlinksKeep installed releases additive and select one through stable symlink paths instead of overwriting it in place.
Section 06
1 concept
Repository practice
Keep repository instructions and review boundaries explicit as conventions grow across languages and areas.
Not sure where Concepts fit? See how the learning views work.