Disable static compilation for osx + minor optimizations

This commit is contained in:
mzack 2022-04-28 14:52:10 +02:00
parent 020e8603a4
commit 48640ec9ca

View File

@ -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