-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
43 lines (30 loc) · 942 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
43
TARGET ?= bettercap
PACKAGES ?= core firewall log modules network packets session tls
PREFIX ?= /usr/local
GO ?= go
GOFLAGS ?=
all: build
build: resources
$(GO) $(GOFLAGS) build -o $(TARGET) .
build_with_race_detector: resources
$(GO) $(GOFLAGS) build -race -o $(TARGET) .
resources: network/manuf.go
network/manuf.go:
@python3 ./network/make_manuf.py
install:
@mkdir -p $(PREFIX)/share/bettercap/caplets
@cp bettercap $(PREFIX)/bin/
docker:
@docker build -t bettercap:latest .
test:
$(GO) $(GOFLAGS) test -covermode=atomic -coverprofile=cover.out ./...
html_coverage: test
$(GO) $(GOFLAGS) tool cover -html=cover.out -o cover.out.html
benchmark: server_deps
$(GO) $(GOFLAGS) test -v -run=doNotRunTests -bench=. -benchmem ./...
fmt:
$(GO) fmt -s -w $(PACKAGES)
clean:
$(RM) $(TARGET)
$(RM) -r build
.PHONY: all build build_with_race_detector resources install docker test html_coverage benchmark fmt clean