PROJECT_NAME := smtp2shoutrrr CGO_ENABLED := 0 DIST_PATH := ./dist TEST_OPTIONS := -v -failfast -race -bench=. -benchtime=100000x -cover -coverprofile=coverage.out GOLANGCI_LINT_VERSION := v2.13.2 .DEFAULT_GOAL := help ## help: Display this help message .PHONY: help help: @echo "Available targets:" @grep -E '^## ' $(MAKEFILE_LIST) | sed 's/## / /' | sort ## build: Build project using goreleaser (snapshot) .PHONY: build build: goreleaser build --snapshot --clean ## quick-run: Execute project directly using go run .PHONY: quick-run quick-run: CGO_ENABLED=$(CGO_ENABLED) go run ./cmd/$(PROJECT_NAME) ## run: Build and execute the local binary .PHONY: run run: build $(DIST_PATH)/$(PROJECT_NAME) ## format: Format code and tidy modules .PHONY: format format: go fmt ./... go mod tidy ## check: Validate the goreleaser configuration .PHONY: check check: goreleaser check ## ci-lint: Run golangci-lint (installs if missing) .PHONY: ci-lint ci-lint: @which golangci-lint > /dev/null 2>&1 || go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION) golangci-lint run ./... ## lint: Run linters .PHONY: lint lint: ci-lint ## test: Run tests with coverage .PHONY: test test: CGO_ENABLED=1 go test $(TEST_OPTIONS) -timeout 1m ./... ## clean: Remove build artifacts .PHONY: clean clean: rm -rf $(DIST_PATH) go clean -cache -testcache