From 9f025bf631b2e74ad8b76dc37701747e190f3770 Mon Sep 17 00:00:00 2001 From: Mzack9999 Date: Fri, 29 Apr 2022 19:39:35 +0200 Subject: [PATCH] Disable static compilation for osx + minor optimizations (#541) --- v2/Makefile | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/v2/Makefile b/v2/Makefile index c48f6a4..0c708b8 100644 --- a/v2/Makefile +++ b/v2/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 "subfinder" cmd/subfinder/main.go + $(GOBUILD) $(GOFLAGS) -ldflags '$(LDFLAGS)' -o "subfinder" cmd/subfinder/main.go test: - $(GOTEST) -v ./... + $(GOTEST) $(GOFLAGS) ./... tidy: - $(GOMOD) tidy + $(GOMOD) tidy