summaryrefslogtreecommitdiff
path: root/Makefile
blob: 680cef665c0db81f5c3db3a09b8c061c4b24c89b (plain)
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
GO ?= go
all: build
build: dserver dcat dgrep dmap dtail dtailhealth
dserver:
ifndef DTAIL_USE_ACL
	${GO} build ${GO_FLAGS} -o dserver ./cmd/dserver/main.go
else
	${GO} build ${GO_FLAGS} -tags linuxacl -o dserver ./cmd/dserver/main.go
endif
dcat:
	${GO} build ${GO_FLAGS} -o dcat ./cmd/dcat/main.go
dgrep:
	${GO} build ${GO_FLAGS} -o dgrep ./cmd/dgrep/main.go
dmap:
	${GO} build ${GO_FLAGS} -o dmap ./cmd/dmap/main.go
dtail:
	${GO} build ${GO_FLAGS} -o dtail ./cmd/dtail/main.go
dtailhealth:
	${GO} build ${GO_FLAGS} -o dtailhealth ./cmd/dtailhealth/main.go
install:
ifndef DTAIL_USE_ACL
	${GO} install ./cmd/dserver/main.go
else
	${GO} install -tags linuxacl ./cmd/dserver/main.go
endif
	${GO} install ./cmd/dcat/main.go
	${GO} install ./cmd/dgrep/main.go
	${GO} install ./cmd/dmap/main.go
	${GO} install ./cmd/dtail/main.go
	${GO} install ./cmd/dtailhealth/main.go
clean:
	ls ./cmd/ | while read cmd; do \
	  test -f $$cmd && rm $$cmd; \
	done
vet:
	find . -type d | egrep -v '(./samples|./log|./doc)' | while read dir; do \
	  echo ${GO} vet $$dir; \
	  ${GO} vet $$dir; \
	done
	sh -c 'grep -R NEXT: .'
	sh -c 'grep -R TODO: .'
lint:
	${GO} get golang.org/x/lint/golint
	find . -type d | while read dir; do \
	  echo golint $$dir; \
	  golint $$dir; \
	done | grep -F .go:
test:
	${GO} clean -testcache
ifndef DTAIL_USE_ACL
	set -e; find . -name '*_test.go' | while read file; do dirname $$file; done | \
		sort -u | while read dir; do ${GO} test --race -v $$dir || exit 2; done
else
	set -e;find . -name '*_test.go' | while read file; do dirname $$file; done | \
		sort -u | while read dir; do ${GO} test --tags linuxacl --race -v $$dir || exit 2; done
endif