2021-03-28 17:13:46 +00:00
|
|
|
# Go parameters
|
|
|
|
GOCMD=go
|
|
|
|
GOBUILD=$(GOCMD) build
|
|
|
|
GOMOD=$(GOCMD) mod
|
|
|
|
GOTEST=$(GOCMD) test
|
2022-04-28 12:46:20 +00:00
|
|
|
GOFLAGS := -v
|
|
|
|
# This should be disabled if the binary uses pprof
|
|
|
|
LDFLAGS := -s -w
|
|
|
|
|
|
|
|
ifneq ($(shell go env GOOS),darwin)
|
|
|
|
LDFLAGS := -extldflags "-static"
|
|
|
|
endif
|
2021-03-28 17:13:46 +00:00
|
|
|
|
|
|
|
all: build
|
|
|
|
build:
|
2022-04-28 12:46:20 +00:00
|
|
|
$(GOBUILD) $(GOFLAGS) -ldflags '$(LDFLAGS)' -o "nuclei" cmd/nuclei/main.go
|
2021-08-03 17:03:50 +00:00
|
|
|
docs:
|
2021-09-15 12:18:33 +00:00
|
|
|
if ! which dstdocgen > /dev/null; then
|
|
|
|
echo -e "Command not found! Install? (y/n) \c"
|
|
|
|
go get -v github.com/projectdiscovery/yamldoc-go/cmd/docgen/dstdocgen
|
|
|
|
fi
|
|
|
|
$(GOCMD) generate pkg/templates/templates.go
|
|
|
|
$(GOBUILD) -o "cmd/docgen/docgen" cmd/docgen/docgen.go
|
|
|
|
./cmd/docgen/docgen docs.md nuclei-jsonschema.json
|
|
|
|
test:
|
2022-04-28 12:46:20 +00:00
|
|
|
$(GOTEST) $(GOFLAGS) ./...
|
2021-11-24 17:10:17 +00:00
|
|
|
integration:
|
2022-12-01 22:27:00 +00:00
|
|
|
cd ../integration_tests; bash run.sh
|
2021-11-24 17:10:17 +00:00
|
|
|
functional:
|
2022-12-01 22:27:00 +00:00
|
|
|
cd cmd/functional-test; bash run.sh
|
2021-03-28 17:13:46 +00:00
|
|
|
tidy:
|
2022-12-01 22:27:00 +00:00
|
|
|
$(GOMOD) tidy
|