Disable static compilation for osx + minor optimizations

dev
mzack 2022-04-28 14:46:20 +02:00
parent 8b7e5535f8
commit 29a53353bb
1 changed files with 9 additions and 3 deletions

View File

@ -3,11 +3,17 @@ GOCMD=go
GOBUILD=$(GOCMD) build GOBUILD=$(GOCMD) build
GOMOD=$(GOCMD) mod GOMOD=$(GOCMD) mod
GOTEST=$(GOCMD) test GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get GOFLAGS := -v
# This should be disabled if the binary uses pprof
LDFLAGS := -s -w
ifneq ($(shell go env GOOS),darwin)
LDFLAGS := -extldflags "-static"
endif
all: build all: build
build: build:
$(GOBUILD) -v -ldflags="-extldflags=-static" -o "nuclei" cmd/nuclei/main.go $(GOBUILD) $(GOFLAGS) -ldflags '$(LDFLAGS)' -o "nuclei" cmd/nuclei/main.go
docs: docs:
if ! which dstdocgen > /dev/null; then if ! which dstdocgen > /dev/null; then
echo -e "Command not found! Install? (y/n) \c" echo -e "Command not found! Install? (y/n) \c"
@ -17,7 +23,7 @@ docs:
$(GOBUILD) -o "cmd/docgen/docgen" cmd/docgen/docgen.go $(GOBUILD) -o "cmd/docgen/docgen" cmd/docgen/docgen.go
./cmd/docgen/docgen docs.md nuclei-jsonschema.json ./cmd/docgen/docgen docs.md nuclei-jsonschema.json
test: test:
$(GOTEST) -v ./... $(GOTEST) $(GOFLAGS) ./...
integration: integration:
bash ../integration_tests/run.sh bash ../integration_tests/run.sh
functional: functional: