Skip to content

Commit

Permalink
Disable static compilation for osx (#194)
Browse files Browse the repository at this point in the history
* Disable static compilation for osx + minor optimizations

* using goflags in test
  • Loading branch information
Mzack9999 authored Apr 29, 2022
1 parent 7a54fca commit 6d1b7df
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 "dnsx" cmd/dnsx/dnsx.go
$(GOBUILD) $(GOFLAGS) -ldflags '$(LDFLAGS)' -o "dnsx" cmd/dnsx/dnsx.go
test:
$(GOTEST) -v ./...
$(GOTEST) $(GOFLAGS) ./...
tidy:
$(GOMOD) tidy
$(GOMOD) tidy

0 comments on commit 6d1b7df

Please sign in to comment.