-
Notifications
You must be signed in to change notification settings - Fork 309
/
Makefile
42 lines (32 loc) · 982 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
ifeq ($(OS),Windows_NT)
EXECUTABLE_EXTENSION := .exe
else
EXECUTABLE_EXTENSION :=
endif
GO_FILES = $(shell find . -type f -name '*.go')
TEST_MODULES ?=
all: zgrab2
.PHONY: all clean integration-test integration-test-clean docker-runner gofmt test
# Test currently only runs on the modules folder because some of the
# third-party libraries in lib (e.g. http) are failing.
test:
cd lib/output/test && go test -v ./...
cd modules && go test -v ./...
lint:
gofmt -s -w $(shell find . -type f -name '*.go'| grep -v "/.template/")
zgrab2: $(GO_FILES)
cd cmd/zgrab2 && go build && cd ../..
rm -f zgrab2
ln -s cmd/zgrab2/zgrab2$(EXECUTABLE_EXTENSION) zgrab2
docker-runner: clean
make -C docker-runner
integration-test: docker-runner
rm -rf zgrab-output
TEST_MODULES=$(TEST_MODULES) ./integration_tests/test.sh
integration-test-clean:
rm -rf zgrab-output
./integration_tests/cleanup.sh
make -C docker-runner clean
clean:
cd cmd/zgrab2 && go clean
rm -f zgrab2