blog.dopana

Back

Every developer has seen this: a Makefile stuffed with targets like test, lint, deploy, format — none of which build anything. Make was designed for compiling C code in 1976. Using it as a task runner is like using a spreadsheet as a word processor. It works, but you’re fighting the tool instead of using it.

Enter just — a modern command runner built for exactly this purpose.

1. The Core Problem: Make Is Not a Task Runner#

Make’s job is simple: given a target file and source files, rebuild the target if any source is newer. That’s it. The entire design revolves around file timestamps.

But developers don’t need file-based builds. They need:

  • make test — run tests
  • make lint — check code style
  • make deploy — push to production
  • make format — auto-format code

None of these produce files. So you end up with .PHONY declarations, awkward variable passing, and cryptic $@ symbols. Make wasn’t designed for this.

[!TIP] If your Makefile has more .PHONY targets than real file targets, you’re using a build system as a task runner. Switch to just.

2. What Is just?#

just is a command runner written in Rust by Casey Rodarmor (creator of ripgrep). It stores commands in a justfile and executes them on demand.

Think of it as a Makefile stripped of everything that makes Make complicated:

  • No file timestamp tracking
  • No .PHONY declarations
  • No tab-vs-space holy wars
  • No cryptic variable syntax

Installation#

# macOS
brew install just

# Ubuntu/Debian
sudo apt install just

# Cargo (any platform)
cargo install just

# Windows
winget install just
bash

A Minimal Justfile#

Run commands with:

just test # run tests
just lint # lint code
just deploy prod # deploy to prod (ENV=prod)
bash

No .PHONY. No tabs required. No cryptic syntax.

3. Head-to-Head Comparison#

FeatureGNU MakeJust
PurposeBuild system (file-based)Command runner
IndentationTabs required (spaces = crash)Spaces or tabs
.PHONYRequired for non-file targetsNot needed
Argumentsmake target VAR=valjust target val
Command listinggrep hack or make -pnjust --list built-in
Cross-platformUnix native; Windows needs WSLSingle binary, works everywhere
Recipe languageShell onlyShell, Python, Node, etc.
Error messagesCrypticClear and specific
.env supportNoneBuilt-in
Parameter defaultsAwkwardFirst-class: ENV="dev"

4. When to Use Make#

Make still wins in specific scenarios:

Incremental Builds#

If you’re compiling C/C++ code, Make’s file-timestamp tracking is exactly what you need. Rebuild only what changed.

Makefile
main: main.c utils.c
	gcc -o main main.c utils.c
makefile

Zero-Dependency Environments#

Make ships with virtually every Unix system. If you’re writing scripts for legacy servers, CI/CD pipelines, or open-source projects where you can’t control what contributors install — Make is the safe choice.

Existing Ecosystem#

The Linux kernel, autotools, CMake, and countless projects use Makefiles. If you’re contributing to these projects, you’ll work with Make regardless.

5. When to Use Just#

Just shines for daily development workflow:

Project Shortcuts#

Store all common commands in one place. New team members run just --list and see everything available.

No .PHONY Headaches#

In Make, if a folder named test exists, make test fails silently or runs the wrong target. You must declare .PHONY: test. Just doesn’t have this problem — it runs commands, not files.

Cross-Platform Teams#

Just works identically on Linux, macOS, and Windows. No WSL, no Cygwin, no path headaches. One binary, same behavior everywhere.

Polyglot Recipes#

Write recipes in any language with shebang syntax:

justfile
# Python recipe
validate:
    #!/usr/bin/env python3
    import json
    with open("config.json") as f:
        json.load(f)
    print("Config valid!")

# Node.js recipe
report:
    #!/usr/bin/env node
    const fs = require("fs");
    const pkg = JSON.parse(fs.readFileSync("package.json"));
    console.log(`Project: ${pkg.name} v${pkg.version}`);
just

First-Class Parameters#

Pass arguments cleanly with defaults:

justfile
# Run migration
migrate ENV="dev" STEPS="1":
    ./manage.py migrate --environment={{ENV}} --steps={{STEPS}}

# Create new resource
resource NAME TYPE="service":
    ./scripts/create-resource.sh {{NAME}} {{TYPE}}
just

Compare to Make’s awkward make migrate ENV=dev STEPS=1.

6. Migration Guide#

Moving from Makefile to justfile is straightforward:

Before (Makefile)#

Makefile
.PHONY: test lint format deploy

test:
	npm test

lint:
	npm run lint

format:
	npx prettier --write .

deploy:
	./scripts/deploy.sh
makefile

After (justfile)#

justfile
test:
    npm test

lint:
    npm run lint

format:
    npx prettier --write .

deploy:
    ./scripts/deploy.sh
just

Key changes:

  • Remove .PHONY declarations
  • Replace tabs with spaces (or keep tabs — both work)
  • Replace $(VAR) with {{VAR}}
  • Add default recipe for just --list

7. Hybrid Approach#

You don’t have to choose exclusively. Many projects use both:

  • Makefile for actual build rules (compilation, bundling, asset generation)
  • justfile for development tasks (test, lint, deploy, format)

This respects Make’s strengths while keeping your daily workflow clean.

justfile
# Use make for builds, just for everything else
build:
    make -C build/

test:
    cargo test

deploy:
    ./scripts/deploy.sh
just

References#