TAGS := ncruces modernc mattn tailscale

BENCH_OPTS := -benchmem -benchtime 1s -count 3
BENCH_PATTERN := .

.PHONY: all
all: $(TAGS)

.PHONY: $(TAGS)
$(TAGS):
	go test -tags $@ -bench $(BENCH_PATTERN) $(BENCH_OPTS) | tee $@.txt

.PHONY: compare
compare:
	@if command -v benchstat >/dev/null 2>&1; then \
		benchstat $(addsuffix .txt,$(TAGS)); \
	else \
		echo "benchstat tool not found. Install with: go install golang.org/x/perf/cmd/benchstat@latest"; \
	fi

.PHONY: clean
clean:
	rm -f $(addsuffix .txt,$(TAGS))
