Skip to content
Latchkey

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 test

In 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

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →