forked from elastic/beats
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
70 lines (57 loc) · 1.45 KB
/
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
BIN_PATH?=/usr/bin
CONF_PATH?=/etc/packetbeat
VERSION?=0.5.0
ARCH?=$(shell uname -m)
GOFILES = $(shell find . -type f -name '*.go')
packetbeat: $(GOFILES)
go build
go-daemon/god: go-daemon/god.c
make -C go-daemon
.PHONY: with_pfring
with_pfring:
go build --tags havepfring
.PHONY: deps
deps:
go get -t
# goautotest is used from the Makefile to run tests in a loop
go get github.com/tsg/goautotest
# websocket is needed by the gobeacon tests
go get golang.org/x/net/websocket
.PHONY: install
install: packetbeat go-daemon/god
install -D packetbeat $(DESTDIR)/$(BIN_PATH)/packetbeat
install -D go-daemon/god $(DESTDIR)/$(BIN_PATH)/packetbeat-god
install -m 644 -D packetbeat.conf $(DESTDIR)/$(CONF_PATH)/packetbeat.conf
.PHONY: dist
dist: packetbeat go-daemon/god
mkdir packetbeat-$(VERSION)
cp packetbeat packetbeat-$(VERSION)/
cp go-daemon/god packetbeat-$(VERSION)/packetbeat-god
cp packetbeat.conf packetbeat-$(VERSION)/
tar czvf packetbeat-$(VERSION)-$(ARCH).tar.gz packetbeat-$(VERSION)
.PHONY: gofmt
gofmt:
go fmt ./...
.PHONY: test
test:
go test -short ./...
make -C tests test
.PHONY: autotest
autotest:
goautotest -short ./...
.PHONY: testlong
testlong:
go vet ./...
go test ./...
make -C tests test
.PHONY: cover
cover:
go test -short -coverprofile=coverage.out
go tool cover -html=coverage.out
.PHONY: benchmark
benchmark:
go test -short -bench=. ./...
.PHONY: clean
clean:
rm packetbeat || true
rm -r packetbeat-$(VERSION) || true