make Targets Command Reference
Understand and invoke the named build steps a Makefile defines.
A target is a named node in a Makefile: a file to build or a task to run. CI pipelines invoke targets like build, test, and lint as discrete steps.
What it does
A make target maps a name to a recipe and its prerequisites. You can request several targets in one make invocation; make builds each in order, sharing the dependency graph so common prerequisites build only once.
Common flags and usage
- make A B C: build several targets in one invocation
- -n / --dry-run: print recipes without running them
- --debug=basic: show why a target is or is not rebuilt
- Convention: a help target prints the available targets
Example
shell
# Run lint, build, and test as one ordered invocation
make lint build testIn CI
Expose stable target names (build, test, lint) so the workflow YAML stays simple and the same commands run locally and in CI. Use make -n to preview what a target would run when debugging a pipeline.
Key takeaways
- A target names a recipe plus its prerequisites.
- make A B C builds several targets in one ordered invocation.
- Stable target names keep the same commands working locally and in CI.
Related guides
make Command ReferenceReference for make in CI/CD: how make reads a Makefile, builds the default or a named target, and which envir…
Makefile .PHONY Command ReferenceReference for Makefile .PHONY in CI/CD: declare task targets that are not files so make always runs them, eve…
make -j (Parallel Builds) Command ReferenceReference for make -j in CI/CD: run recipes in parallel, size jobs to runner cores and memory, and avoid the…