Skip to content

External Build Systems

Jake can detect and run targets from Makefile and Justfile in the same directory as the active Jakefile. This lets you gradually migrate to Jake or use them together.

If you select a Jakefile with -f, external detection and delegation follow that Jakefile’s directory instead of your shell’s starting directory.

Jake automatically detects these files:

Makefile variants (in priority order):

  • GNUmakefile
  • Makefile
  • makefile

Justfile variants (in priority order):

  • justfile
  • Justfile
  • .justfile

External recipes get a prefix to avoid conflicts:

SourcePrefixExample
Makefilemake.make.build, make.clean
Justfilejust.just.test, just.deploy
Terminal window
# List all recipes including external
jake --list
# List only external recipes
jake --external
# List only Makefile targets
jake --external make
# List only Justfile recipes
jake --external just
# Hide external recipes from listing
jake --list --no-external

Run them like any other recipe:

Terminal window
# Run a Makefile target
jake make.build
# Run a Justfile recipe
jake just.test
# With arguments passed through to the delegated tool
jake make.install PREFIX=/usr/local
jake just.deploy production us-east-1
# External discovery also follows the selected Jakefile
jake -f tools/Jakefile make.build

When you run an external recipe, Jake delegates to the underlying tool:

  • Makefile: Runs make -f <file> <target>
  • Justfile: Runs just --justfile <file> <recipe>

Any extra positional arguments after the external recipe are forwarded to the delegated tool.

The delegated process runs from the external file’s directory, so relative paths behave the same way they do when you invoke that Makefile or Justfile directly from its own directory.

Targets starting with _ are treated as private:

# Makefile
_helper: # Hidden from jake --list
echo "helper"
build: _helper
echo "building"

Directory structure:

project/
├── Jakefile # Jake recipes
├── Makefile # Legacy build
└── justfile # Additional tooling
Terminal window
# See everything
jake --list
# Output:
# Available recipes:
# build Build the project
# test Run tests
#
# Makefile (Makefile):
# make.all
# make.clean
#
# Justfile (justfile):
# just.fmt Format code
# just.lint Run linter

Use external support to migrate incrementally:

  1. Create a Jakefile alongside your Makefile
  2. Move recipes one at a time
  3. Have Jake recipes call make targets during transition:
@description "New Jake build"
task build:
# Can still call old make targets
make legacy-step
echo "New build steps..."
  1. Remove Makefile when migration is complete