summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorPaul Buetow <pbuetow@mimecast.com>2021-10-21 21:28:49 +0300
committerPaul Buetow <pbuetow@mimecast.com>2021-10-21 21:28:49 +0300
commitf4207a55f71bfbcfdc532d5cdd3befaa3474a157 (patch)
treeea5e4a2d2a67035f645bdee496ae55a52034178a /Makefile
parentd80d6070557e3a800e3a54967af9eced518f116b (diff)
parent739205206d63bf42f4e843b39d04d4c8cd8207c3 (diff)
merge develop
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile42
1 files changed, 28 insertions, 14 deletions
diff --git a/Makefile b/Makefile
index 6d85347..0e66ac4 100644
--- a/Makefile
+++ b/Makefile
@@ -1,17 +1,26 @@
GO ?= go
-all: test build
-build:
-ifndef USE_ACL
- ${GO} build -o dserver ./cmd/dserver/main.go
+# This is so that all the tests don't manipulate ~/.ssh/known_hosts
+DTAIL_SSH_DONT_ADD_HOSTS_TO_KNOWNHOSTS_FILE = yes
+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 -tags linuxacl -o dserver ./cmd/dserver/main.go
+ ${GO} build ${GO_FLAGS} -tags linuxacl -o dserver ./cmd/dserver/main.go
endif
- ${GO} build -o dcat ./cmd/dcat/main.go
- ${GO} build -o dgrep ./cmd/dgrep/main.go
- ${GO} build -o dmap ./cmd/dmap/main.go
- ${GO} build -o dtail ./cmd/dtail/main.go
+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 USE_ACL
+ifndef DTAIL_USE_ACL
${GO} install ./cmd/dserver/main.go
else
${GO} install -tags linuxacl ./cmd/dserver/main.go
@@ -20,6 +29,7 @@ endif
${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; \
@@ -29,15 +39,19 @@ vet:
echo ${GO} vet $$dir; \
${GO} vet $$dir; \
done
+ grep -R TODO: .
lint:
${GO} get golang.org/x/lint/golint
find . -type d | while read dir; do \
echo golint $$dir; \
golint $$dir; \
- done
+ done | grep -F .go:
test:
-ifndef USE_ACL
- ${GO} test ./... -v
+ ${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
- ${GO} test -tags linuxacl ./... -v
+ 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