Ramblings of an aging IT geek
← Ramblings of an aging IT geek
tooling

a makefile is just a list of things i keep forgetting how to do

Why I keep a tiny Makefile in projects that have nothing to do with C, purely as a habitable list of commands.

A keyboard lit by a terminal

People hear "Makefile" and assume you're compiling something. I've got Makefiles in repos that build a Hugo site, lint some YAML, and run a Python script on a schedule. Not a .c in sight. The point isn't compilation. The point is that make is the one command I can type from muscle memory in any directory, and make help tells me what this particular project can do.

The whole value is that I stop reinventing the same six shell incantations per repo. Six months from now I will not remember the exact docker run flags, or which virtualenv this thing wants. A target remembers for me.

.PHONY: build serve lint
build:        ## build the site
	hugo --minify
serve:        ## live preview on :1313
	hugo server -D
lint:         ## check everything
	yamllint . && shellcheck scripts/*.sh

Yes, there are nicer task runners. Just (the command runner) is genuinely lovely and I use it where I can. But make is already installed on every box I touch, the tab-vs-space thing aside it has no surprises, and a colleague who's never seen the repo can run make and get somewhere. That's the bar. It doesn't have to be clever, it has to be there when I've forgotten everything.