-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
64 lines (43 loc) · 1.38 KB
/
Copy pathMakefile
File metadata and controls
64 lines (43 loc) · 1.38 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
GOCMD=go
GORUN=$(GOCMD) run
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get
GODOC=$(GOCMD)doc
GOLANGCI=golangci-lint
DUMPCMD=tcpdump
INTERFACE_REAL=eth0
INTERFACE_VIRTUAL=echoman_tun
all: build run
build: ## go build
$(GOCMD) ./cmd/main.go
build/pi: ## go build for armv7l
GOOS=linux GOARCH=arm GOARM=7 $(GOBUILD) ./cmd/main.go
build/pi64: ## go build for aarch64
GOOS=linux GOARCH=arm64 $(GOBUILD) ./cmd/main.go
run: ## go run
$(GORUN) ./cmd/main.go
test: ## go test
$(GOTEST) -v ./...
benchmark: ## go benchmark
$(GOTEST) -bench -v ./...
lint: ## golang-ci lint
$(GOLANGCI) run --config=.golangci.yaml ./...
doc: ## godoc http:6060
$(GODOC) -http=:6060
coverage: ## coverage
go test -coverprofile=cover.out ./...
go tool cover -html=cover.out -o cover.html
dump-real: ## dump packet
$(DUMPCMD) -i ${INTERFACE_REAL}
dump-virtual: ## dump packet
$(DUMPCMD) -i ${INTERFACE_VIRTUAL}
dump-real/out: ## dump packet and output to file
$(DUMPCMD) -i ${INTERFACE_REAL} -w ./debug/dumpfile-client-real.pcapng
dump-virtual/out: ## dump packet and output to file
$(DUMPCMD) -i ${INTERFACE_VIRTUAL} -w ./debug/dumpfile-client-virtual.pcapng
listen: ## check listen port
lsof -i -P
help: ## Display this help screen
@grep -E '^[a-zA-Z/_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'