.PHONY: help
help: ## Show available targets
@grep -E '^[a-zA-Z0-9_.-]+:.*?## ' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "%-24s %s
", $$1, $$2}'A standard self-documenting help target.
Production-oriented Makefile targets for apps, Docker, Terraform, Python, Node, Go, and deployment workflows.
Targets most projects should expose.
.PHONY: help
help: ## Show available targets
@grep -E '^[a-zA-Z0-9_.-]+:.*?## ' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "%-24s %s
", $$1, $$2}'A standard self-documenting help target.
Install development dependencies and prepare local state.
.PHONY: bootstrap
bootstrap: ## Install local dependencies
pnpm install
pre-commit installAdapt to your stack.
.PHONY: all
all: lint test buildOften paired with `.DEFAULT_GOAL := all` or `help`.
Reusable targets for common stacks.
Lint, test, and build JavaScript or TypeScript projects.
.PHONY: lint test build
lint:
pnpm lint
test:
pnpm test
build:
pnpm buildSimple and team-friendly task aliases.
.PHONY: fmt lint test
fmt:
ruff format .
lint:
ruff check .
test:
pytest -qGreat entry point for Python apps and libraries.
.PHONY: fmt test build
fmt:
go fmt ./...
test:
go test ./...
build:
go build ./...A common pattern in Go repositories.
Wrap build tool commands in stable team-facing targets.
build:
./gradlew build
test:
./gradlew testMake can serve as a repo-level command facade across multiple languages.
Operational targets for containers and cloud workflows.
IMAGE ?= example/app
TAG ?= latest
.PHONY: docker-build
docker-build:
docker build -t $(IMAGE):$(TAG) .Common deployment building block.
docker-push:
docker push $(IMAGE):$(TAG)Often combined with auth/login steps elsewhere.
ENV ?= dev
terraform-plan:
cd infra/$(ENV) && terraform init && terraform plan -out=tfplanA nice wrapper around verbose infra commands.
terraform-apply:
cd infra/$(ENV) && terraform apply tfplanConsider adding approval guards for production.
Sync built files to a bucket and invalidate a CDN.
deploy-web:
aws s3 sync dist/ s3://$(WEB_BUCKET) --delete
aws cloudfront create-invalidation --distribution-id $(DIST_ID) --paths '/*'A realistic cloud deployment target.
Tagging, changelogs, and release preparation.
version.txt:
@printf '%s
' '$(VERSION)' > $@Useful for app metadata and build info.
tag-release:
git tag v$(VERSION)
git push origin v$(VERSION)Pair with required-variable guards.
Capture commit history since the last tag.
changelog:
git log --oneline --decorate $$(git describe --tags --abbrev=0)..HEADDouble-dollar escapes shell command substitution through make.