Makefile Builder

Generate a project Makefile with build, test, lint, and clean targets

Builds a Makefile with phony targets for build, test, lint, format, clean, and deploy, configurable variables, and a self-documenting help target that lists every command from its inline comments.

What does .PHONY do?

PHONY tells make a target is a command, not a file. Without it, a target named test would be skipped if a file called test existed, so all command targets are declared phony.

A clean Makefile without the tab traps

A good Makefile is the single entry point to a project: make test, make build, make deploy. But Make has sharp edges — recipes must start with real tabs, and command targets need .PHONY declarations. This builder generates a correct, self-documenting Makefile so newcomers can run make help and see everything available.

How it works

The output declares variables at the top so paths and binaries are set once. Every command target you enable is added to a .PHONY line and given a recipe that starts with a literal tab, as Make requires. Each target carries a ## description comment, and the help target uses a short grep/awk one-liner to print those descriptions, keeping documentation in sync with the targets. The first declared target is help, so running make with no arguments lists the commands instead of accidentally building.

Tips and example

Choose the Node preset and you get npm run build, npm test, and npm run lint wired into the matching targets. List extra variables like BIN := ./node_modules/.bin and reference them in recipes with $(BIN). Because recipes use tabs, paste the output directly rather than retyping. Run make help first to confirm the command list, then make build.