johannh.me
← writing
/ #tools

My Makefile is my README

Every project I start now gets a Makefile before it gets a README. Not because I love Make — I don’t, particularly — but because a Makefile is a README that can’t lie.

.PHONY: dev test build deploy

dev:       ## Run the local server
	npm run dev

test:      ## Run the test suite
	npm test

build:     ## Produce a production build
	npm run build

make with no arguments prints the targets and their descriptions. New contributors run three commands and they’re oriented. When the build steps change, the file that documents them is the file that runs them, so drift is impossible.

A README describes intentions. A Makefile describes what actually happens.