# SPDX-License-Identifier: Apache-2.0
# Copyright 2025 Fibonacci Series Project

# Makefile for Fibonacci Go project

.PHONY: build run test bench clean fmt vet

# Default target
all: build

# Build the application
build:
	go build -o fibonacci fibonacci.go

# Run the application
run:
	go run fibonacci.go

# Run tests
test:
	go test -v

# Run benchmarks
bench:
	go test -bench=. -benchmem

# Clean build artifacts
clean:
	rm -f fibonacci

# Format code
fmt:
	go fmt ./...

# Vet code for potential issues
vet:
	go vet ./...

# Run all checks
check: fmt vet test

# Install dependencies (if any)
deps:
	go mod tidy

# Show help
help:
	@echo "Available targets:"
	@echo "  build  - Build the fibonacci executable"
	@echo "  run    - Run the fibonacci program"
	@echo "  test   - Run all tests"
	@echo "  bench  - Run benchmarks"
	@echo "  clean  - Remove build artifacts"
	@echo "  fmt    - Format Go code"
	@echo "  vet    - Run go vet"
	@echo "  check  - Run fmt, vet, and test"
	@echo "  deps   - Tidy up dependencies"
	@echo "  help   - Show this help message"