# Makefile for the finance backend application # Variables BINARY_NAME=finance-backend GO=go GOTEST=$(GO) test GOVET=$(GO) vet GOBUILD=$(GO) build .PHONY: all build clean test vet run lint # Default target all: test build # Build the application build: $(GOBUILD) -o $(BINARY_NAME) ./cmd/api/main.go # Clean build files clean: rm -f $(BINARY_NAME) # Run the application run: build ./$(BINARY_NAME) # Run all tests with verbose output test: $(GOTEST) -v ./... # Test only the handlers test-handlers: $(GOTEST) -v ./handlers/... # Run code vetting vet: $(GOVET) ./... # Run linting (requires golint) lint: @command -v golint >/dev/null 2>&1 || { echo >&2 "golint not installed. Installing..."; $(GO) install golang.org/x/lint/golint@latest; } golint ./... # Run tests with coverage report test-coverage: $(GOTEST) -coverprofile=coverage.out ./... $(GO) tool cover -html=coverage.out