.PHONY: build clean test lint linux darwin windows all release

BINARY := arcline-audit
LDFLAGS := -s -w
MAIN := ./cmd/arcline-audit

build:
	CGO_ENABLED=0 go build -trimpath -ldflags "$(LDFLAGS)" -o $(BINARY) $(MAIN)

clean:
	rm -f $(BINARY) arcline-audit-*

test:
	go test ./...

lint:
	go vet ./...

# Cross-compile targets
linux:
	GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -trimpath -ldflags "$(LDFLAGS)" -o $(BINARY)-linux-amd64 $(MAIN)

darwin:
	GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 go build -trimpath -ldflags "$(LDFLAGS)" -o $(BINARY)-darwin-amd64 $(MAIN)

windows:
	GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build -trimpath -ldflags "$(LDFLAGS)" -o $(BINARY)-windows-amd64.exe $(MAIN)

# Release builds for all platforms
release: linux darwin windows

