Makefile To Justfile Migration

Supporting reference for just.

On this page Overview

Use this when a repo has both Makefile and justfile, or when the user wants to migrate commands from make to just.

Fast Mapping

MakeJustNotes
.PHONY: targetnot neededjust does not track file timestamps
.DEFAULT_GOAL := helpput the default recipe first or use [default]first public recipe is the default
target: dep1 dep2target: dep1 dep2dependency syntax is similar
@command@commandsuppress command echo
$(VAR) / ${VAR}{{var}}just interpolation
$$VAR$VARshell vars do not use double-dollar escaping
VAR := valuevar := "value"quote strings in just
VAR ?= defaultvar := env('VAR', 'default')env fallback pattern
$(shell cmd)`cmd`capture command output
export VAR := valueexport var := "value" or set exportexport explicitly or globally
include file.mkimport 'file.just'import another file

Differences That Matter

Shell Variables

In make, literal shell variables use $$. In just, use $ directly.

target:
	echo $$HOME
target:
	echo $HOME

Recipe Execution Model

Like make, each line runs in a separate shell. Use a shebang recipe when the body must run as one script.

check:
    #!/usr/bin/env bash
    if [ -f .env ]; then
        echo "found"
    fi

Documentation

make often needs a custom help target. In just, the single # comment immediately above a recipe is used by just --list. Keep that documentation as one line; a second comment line above the recipe breaks the preview text.

[private]
default:
    @just --list --unsorted

# Run unit tests
test:
    cargo test

Arguments

just supports recipe arguments directly.

recreate resource:
    terraform apply -replace "{{resource}}"

Migration Checklist

  1. Read the existing Makefile before rewriting anything.
  2. Keep both files during migration if the repo still depends on make.
  3. Convert variables, then recipes, then dependencies.
  4. Replace $$ shell variables with $.
  5. Use a single-line comment above each recipe so just --list stays useful.
  6. Add [confirm] to destructive recipes if the old flow relied on manual care.
  7. Verify migrated commands with just --show <recipe> and targeted dry runs.

Agent Guardrails

  • Do not suggest migration until you confirm the repo is using just as a real command surface rather than as an experiment.
  • Watch for make-specific behavior that may not carry over cleanly, such as pattern rules, file-based dependency graphs, or job parallelism.
  • If both files exist, prefer the one the repo actually documents and uses.