blob: ef6cffabda123cac9fc5ba906d24b578ce7801c3 (
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
57
58
59
60
61
62
63
64
65
66
67
68
|
GO ?= go
ifdef DTAIL_USE_ACL
GO_TAGS=linuxacl
endif
ifdef DTAIL_USE_PROPRIETARY
GO_TAGS+=proprietary
endif
all: build
# Display available targets
help:
@echo "Available Makefile targets:"
@echo " all - Build all binaries (default)"
@echo " build - Build all binaries"
@echo " clean - Remove built binaries"
@echo " test - Run all unit tests"
@echo " vet - Run go vet on all packages"
@echo " lint - Run golint on all packages"
@echo " install - Install all binaries to \$$GOPATH/bin"
@echo " pgo - Run Performance Guided Optimization for dgrep"
@echo ""
@echo "Individual binary targets:"
@echo " dserver, dcat, dgrep, dmap, dtail, dtailhealth"
build: dserver dcat dgrep dmap dtail dtailhealth
dserver:
${GO} build ${GO_FLAGS} -tags '${GO_TAGS}' -o dserver ./cmd/dserver/main.go
dcat:
${GO} build ${GO_FLAGS} -tags '${GO_TAGS}' -o dcat ./cmd/dcat/main.go
dgrep:
${GO} build ${GO_FLAGS} -tags '${GO_TAGS}' -o dgrep ./cmd/dgrep/main.go
dmap:
${GO} build ${GO_FLAGS} -tags '${GO_TAGS}' -o dmap ./cmd/dmap/main.go
dtail:
${GO} build ${GO_FLAGS} -tags '${GO_TAGS}' -o dtail ./cmd/dtail/main.go
dtailhealth:
${GO} build ${GO_FLAGS} -tags '${GO_TAGS}' -o dtailhealth ./cmd/dtailhealth/main.go
install:
${GO} install -tags '${GO_TAGS}' ./cmd/dserver/main.go
${GO} install -tags '${GO_TAGS}' ./cmd/dcat/main.go
${GO} install -tags '${GO_TAGS}' ./cmd/dgrep/main.go
${GO} install -tags '${GO_TAGS}' ./cmd/dmap/main.go
${GO} install -tags '${GO_TAGS}' ./cmd/dtail/main.go
${GO} install -tags '${GO_TAGS}' ./cmd/dtailhealth/main.go
clean:
ls ./cmd/ | while read cmd; do \
test -f $$cmd && rm $$cmd; \
done
vet:
find . -type d | egrep -v '(./examples|./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
set -e; find . -name '*_test.go' | while read file; do dirname $$file; done | \
sort -u | while read dir; do ${GO} test -tags '${GO_TAGS}' --race -v -failfast $$dir || exit 2; done
# Performance Guided Optimization (PGO) target for dgrep
pgo: clean build
@./scripts/pgo.sh
|