Skip to content

Menu

Makefile Generator

Generate Makefiles for common project types

Runs entirely in your browserDevOpsFree, no sign-up
Loading tool

01What is Makefile Generator?

Most projects end up with a pile of commands people need to remember. A Makefile gives them short names, so make test means the same thing on every laptop and in CI. Makefile Generator hands you a ready-made one for Node.js, Go or Docker. Pick a Project Type, copy, and save it as Makefile at the root of your repo. The Node.js template wraps npm. It has install (npm ci), dev, build, test, test-coverage, lint, lint-fix, typecheck with tsc --noEmit, start, clean and deploy. Deploy depends on build. NODE_ENV and PORT are set with ?= so you can override them per call. The Go template sets BINARY_NAME and derives VERSION from git describe and BUILD_TIME from date in UTC. It stamps both into main.Version and main.BuildTime through -ldflags -X. Build uses CGO_ENABLED=0 and -trimpath. You also get run, tests with -race, coverage to HTML, golangci-lint, gofmt plus goimports, go mod tidy and verify, a docker target, and build-all for linux/amd64, darwin/amd64 and darwin/arm64. The Docker template builds an image under REGISTRY and IMAGE_NAME, tagged with the short commit hash and with latest. Push depends on build. There are run and stop targets, Compose v2 up, down and logs, clean, and a buildx target for linux/amd64 and linux/arm64. All three follow the GNU Make manual's conventions. Every target is listed in .PHONY, so a file called build or test never blocks it. Recipe lines start with a real tab, which Make requires. Each target has a ## comment above it, and make help prints those as a menu. Here's what that looks like. Save the Docker template outside a git repo and run make -n build. You get docker build -t ghcr.io/myorg/myapp:dev -t ghcr.io/myorg/myapp:latest . because TAG falls back to dev when there's no commit hash. Inside a repo, dev is replaced by the short hash. We ran all three templates through GNU Make with make help and make -n to check they parse. A few limits. The output is fixed per project type, with no options for package manager, test runner or paths. The Go build expects your main package at ./cmd/myapp, so edit that path. The build-all target doesn't set CGO_ENABLED=0 the way build does. The help target uses awk, which Windows users only have inside WSL or Git Bash.

Backend and DevOps developers who want a working Makefile for a Node.js, Go or Docker project without writing the boilerplate from scratch. The tool runs entirely in your browser, so your data never leaves your device.

02How to use Makefile Generator

  1. Choose Node.js, Go or Docker in the Project Type dropdown
  2. Read the Makefile panel, starting with the variables at the top
  3. Click Copy and save the text as Makefile in your project root
  4. Edit BINARY_NAME, IMAGE_NAME, REGISTRY or the ./cmd/ path to match your repo
  5. Run make help to list the targets, or make -n build to preview commands without running them

03Worked examples

Input: Project Type: Node.js, then make help
Result: Available targets: install Install dependencies dev Start development server build Build for production test Run tests ... deploy Deploy to production help Show help
Trimmed. The full list has 12 targets, each taken from its ## comment.
Input: Project Type: Node.js, then make -n build
Result: NODE_ENV=production npm run build
The build target always runs with NODE_ENV=production.
Input: Project Type: Go, then make -n build (outside a git repo)
Result: CGO_ENABLED=0 go build -trimpath -ldflags "-X main.Version=dev -X main.BuildTime=2026-11-25T17:21:49Z" -o bin/myapp ./cmd/myapp
VERSION falls back to dev without git. BuildTime is the current UTC time, so yours will differ.
Input: Project Type: Go, then make -n build-all
Result: GOOS=linux GOARCH=amd64 go build -trimpath -ldflags "..." -o bin/myapp-linux-amd64 ./cmd/myapp GOOS=darwin GOARCH=amd64 go build ... -o bin/myapp-darwin-amd64 ./cmd/myapp GOOS=darwin GOARCH=arm64 go build ... -o bin/myapp-darwin-arm64 ./cmd/myapp
Trimmed the repeated ldflags. Note that build-all does not set CGO_ENABLED=0.
Input: Project Type: Docker, then make -n push (outside a git repo)
Result: docker build -t ghcr.io/myorg/myapp:dev -t ghcr.io/myorg/myapp:latest . docker push ghcr.io/myorg/myapp:dev docker push ghcr.io/myorg/myapp:latest
push depends on build, so it builds first. Inside a repo, dev becomes the short commit hash.
Input: Project Type: Docker, then make -n run
Result: docker run -d --name myapp -p 8080:8080 --env-file .env ghcr.io/myorg/myapp:dev
run expects a .env file next to the Makefile.

04Common use cases

  • Giving a new Go service build, test, lint and cross-compile targets with the git version stamped into the binary
  • Wrapping npm scripts so CI runs make test and make lint the same way on every runner
  • Standardising docker build, tag and push steps for an image on GitHub Container Registry
  • Publishing a multi-arch image for linux/amd64 and linux/arm64 with one make build-multi
  • Onboarding a teammate who can run make help and see every task with a one-line description
  • Starting a monorepo convention where each service answers to the same target names

05Tips

  • Make needs a real tab at the start of each recipe line. If your editor turns tabs into spaces on paste, you'll see a missing separator error.
  • Variables set with ?= can be overridden on the command line, like make run PORT=4000 or make push TAG=v1.2.0.
  • make -n target prints the commands without running them. It's a safe way to check what push or deploy will do.
  • To add a target to make help, put a ## description on the line directly above it and add the name to .PHONY.

06Related concepts

GNU Make, .PHONY targets, ldflags, docker buildx, task runner.

Frequently Asked Questions

What is Makefile Generator?

Makefile Generator is a free, browser-based developer tool on AIDToolStack. Generate Makefiles for common project types It requires no installation or sign-up and works entirely in your browser.

Is Makefile Generator free to use?

Yes. No sign-up, no fees and no usage cap.

Does Makefile Generator store my data?

No. It runs in your browser; nothing is uploaded.

Cheat sheet

Reviews and commentsShow

Reviews

Sign in to leave a review.

Loading reviews…

Comments

Sign in to leave a comment.

Loading comments…

What changed in AI dev tools, once a month

Renames, shutdowns, pricing changes and new MCP setups, each with a source.

Subscribe