BINARY ?= proxy
GO ?= go
GOFMT ?= gofmt

.DEFAULT_GOAL := all

.PHONY: fmt clean build test all

fmt:
	@$(GOFMT) -w $(shell find . -name '*.go' -not -path './vendor/*')

clean:
	@$(GO) clean -testcache
	@rm -f $(BINARY)

build:
	@$(GO) build -o $(BINARY) ./cmd/proxy

test:
	@$(GO) test ./...

all: fmt build test
