Replace hardcoded /usr/local/go/bin/go with dynamic PATH lookup. The previous hardcoded path failed on any system where Go is installed elsewhere (e.g., /usr/bin/go, ~/go/bin/go). Uses conditional assignment (GO ?=) so users can still override with GO=/custom/path make build when needed. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
35 lines
557 B
Makefile
35 lines
557 B
Makefile
GO ?= $(shell command -v go)
|
|
BIN := cburn
|
|
|
|
.PHONY: build install lint test test-race bench fuzz clean
|
|
|
|
## Build & install
|
|
build:
|
|
$(GO) build -o $(BIN) .
|
|
|
|
install:
|
|
$(GO) install .
|
|
|
|
## Quality
|
|
lint:
|
|
golangci-lint run ./...
|
|
|
|
test:
|
|
$(GO) test ./...
|
|
|
|
test-race:
|
|
$(GO) test -race ./...
|
|
|
|
bench:
|
|
$(GO) test -bench=. -benchmem ./internal/pipeline/
|
|
|
|
## Fuzz (run for 30s by default, override with FUZZ_TIME=2m)
|
|
FUZZ_TIME ?= 30s
|
|
fuzz:
|
|
$(GO) test -fuzz=Fuzz -fuzztime=$(FUZZ_TIME) ./internal/source/
|
|
|
|
## Housekeeping
|
|
clean:
|
|
rm -f $(BIN)
|
|
$(GO) clean -testcache
|