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.
Automatic Detection
Section titled “Automatic Detection”Jake automatically detects these files:
Makefile variants (in priority order):
GNUmakefileMakefilemakefile
Justfile variants (in priority order):
justfileJustfile.justfile
Recipe Naming
Section titled “Recipe Naming”External recipes get a prefix to avoid conflicts:
| Source | Prefix | Example |
|---|---|---|
| Makefile | make. | make.build, make.clean |
| Justfile | just. | just.test, just.deploy |
Listing External Recipes
Section titled “Listing External Recipes”# List all recipes including externaljake --list
# List only external recipesjake --external
# List only Makefile targetsjake --external make
# List only Justfile recipesjake --external just
# Hide external recipes from listingjake --list --no-externalRunning External Recipes
Section titled “Running External Recipes”Run them like any other recipe:
# Run a Makefile targetjake make.build
# Run a Justfile recipejake just.test
# With arguments passed through to the delegated tooljake make.install PREFIX=/usr/localjake just.deploy production us-east-1
# External discovery also follows the selected Jakefilejake -f tools/Jakefile make.buildHow It Works
Section titled “How It Works”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.
Private Targets
Section titled “Private Targets”Targets starting with _ are treated as private:
# Makefile_helper: # Hidden from jake --list echo "helper"
build: _helper echo "building"Example: Mixed Project
Section titled “Example: Mixed Project”Directory structure:
project/├── Jakefile # Jake recipes├── Makefile # Legacy build└── justfile # Additional tooling# See everythingjake --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 linterGradual Migration
Section titled “Gradual Migration”Use external support to migrate incrementally:
- Create a Jakefile alongside your Makefile
- Move recipes one at a time
- 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..."- Remove Makefile when migration is complete