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:
|
2023-10-17 12:14:13 +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
|
2023-09-16 10:32:17 +00:00
|
|
|
devtools:
|
|
|
|
$(GOBUILD) $(GOFLAGS) -ldflags '$(LDFLAGS)' -o "bindgen" pkg/js/devtools/bindgen/cmd/bindgen/main.go
|
2024-02-07 16:15:40 +00:00
|
|
|
$(GOBUILD) $(GOFLAGS) -ldflags '$(LDFLAGS)' -o "tsgen" pkg/js/devtools/tsgen/cmd/tsgen/main.go
|
2023-09-16 10:32:17 +00:00
|
|
|
$(GOBUILD) $(GOFLAGS) -ldflags '$(LDFLAGS)' -o "scrapefuncs" pkg/js/devtools/scrapefuncs/main.go
|
2024-02-07 16:15:40 +00:00
|
|
|
jsupdate:
|
|
|
|
$(GOBUILD) $(GOFLAGS) -ldflags '$(LDFLAGS)' -o "bindgen" pkg/js/devtools/bindgen/cmd/bindgen/main.go
|
|
|
|
$(GOBUILD) $(GOFLAGS) -ldflags '$(LDFLAGS)' -o "tsgen" pkg/js/devtools/tsgen/cmd/tsgen/main.go
|
|
|
|
./bindgen -dir pkg/js/libs -out pkg/js/generated
|
|
|
|
./tsgen -dir pkg/js/libs -out pkg/js/generated/ts
|
|
|
|
ts:
|
|
|
|
$(GOBUILD) $(GOFLAGS) -ldflags '$(LDFLAGS)' -o "tsgen" pkg/js/devtools/tsgen/cmd/tsgen/main.go
|
|
|
|
./tsgen -dir pkg/js/libs -out pkg/js/generated/ts
|
2024-03-13 21:38:53 +00:00
|
|
|
fuzzplayground:
|
|
|
|
$(GOBUILD) $(GOFLAGS) -ldflags '$(LDFLAGS)' -o "fuzzplayground" cmd/tools/fuzzplayground/main.go
|
2024-03-01 13:10:18 +00:00
|
|
|
memogen:
|
|
|
|
$(GOBUILD) $(GOFLAGS) -ldflags '$(LDFLAGS)' -o "memogen" cmd/memogen/memogen.go
|
|
|
|
./memogen -src pkg/js/libs -tpl cmd/memogen/function.tpl
|
2024-04-01 13:48:21 +00:00
|
|
|
dsl-docs:
|
|
|
|
rm -f dsl.md scrapefuncs 2>/dev/null
|
|
|
|
$(GOBUILD) $(GOFLAGS) -ldflags '$(LDFLAGS)' -o "scrapefuncs" pkg/js/devtools/scrapefuncs/main.go
|
|
|
|
./scrapefuncs -out dsl.md
|