Preview Make Commands with make -n (Dry Run)
Print every recipe make would execute without running any of them — the safe way to audit an unfamiliar Makefile.
Run make -n install to print the commands the install target would run without executing anything, or make -n -B all to force a full-plan print ignoring file timestamps.
01Command
Command
$ make -n install
make -n -B all # pretend nothing is up to date02What it does
The -n flag (--just-print) runs make's full dependency analysis — deciding what's out of date and in what order — but prints recipes instead of executing them. Adding -B (--always-make) pretends every target is stale, so you see the complete build plan rather than the incremental one. Lines that would normally be silenced with @ are still shown, which often reveals hidden commands like rm or ssh you'd want to know about first.
03Risk
!Warning: Recipes using $(shell ...) run even under -n, because make evaluates variables while parsing — a dry run is not guaranteed side-effect-free.
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- make(1) — Linux man pageEvidence: make man page: '-n, --just-print, --dry-run, --recon Don't actually run any recipe; just print them' and -B --always-make.
Last verified: 2026-09-17 · Category: Developer