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

the makefile is just a menu

A short note on using a Makefile as the discoverable command menu for a project that has nothing to do with C.

A keyboard beside a terminal

People hear "Makefile" and think C, tab-indented misery, and dependency graphs they don't want. But strip away the compilation machinery and a Makefile is just a list of named commands that's already installed on every box you'll ever touch. For a Go service, a Python project, or a pile of Terraform, that's genuinely useful.

I don't use it for builds. I use it as a menu. make test, make lint, make fmt, make run. The point is that a new person clones the repo, types make, and sees what they're allowed to do, instead of grepping the README or guessing the right npm/cargo/go incantation for this particular project.

.PHONY: test lint run
test: ## run the unit tests
	go test ./...
run: ## start the dev server
	go run ./cmd/server

Mark everything .PHONY because none of these targets produce files, add a ## comment you can grep into a help target, and you're done. It's not clever. It's the lowest-common-denominator command runner, and that's exactly why it's worth reaching for: no tool to install, and everyone already half-knows it.