External Build Systems
Jake can detect and run targets from Makefile and Justfile in the same directory. This lets you gradually migrate to Jake or use them together.
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)jake make.install PREFIX=/usr/localHow 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>
The original tool handles all the execution logic.
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:
task build: @description "New Jake build" # Can still call old make targets make legacy-step echo "New build steps..."- Remove Makefile when migration is complete