diff --git a/Makefile b/Makefile index 595230d..102b49d 100644 --- a/Makefile +++ b/Makefile @@ -3,12 +3,17 @@ GOCMD=go GOBUILD=$(GOCMD) build GOMOD=$(GOCMD) mod GOTEST=$(GOCMD) test -GOGET=$(GOCMD) get +GOFLAGS := -v +LDFLAGS := -s -w + +ifneq ($(shell go env GOOS),darwin) +LDFLAGS := -extldflags "-static" +endif all: build build: - $(GOBUILD) -v -ldflags="-extldflags=-static" -o "httpx" cmd/httpx/httpx.go + $(GOBUILD) $(GOFLAGS) -ldflags '$(LDFLAGS)' -o "httpx" cmd/httpx/httpx.go test: - $(GOTEST) -v ./... + $(GOTEST) $(GOFLAGS) ./... tidy: - $(GOMOD) tidy + $(GOMOD) tidy