-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
79 lines (52 loc) · 1.6 KB
/
Makefile
File metadata and controls
79 lines (52 loc) · 1.6 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
GOPATH := $(GOPATH):$(shell pwd)/../../../../
define HG_ERROR
FATAL: you need mercurial (hg) to download datadust dependencies.
Check README.md for details
endef
define GIT_ERROR
FATAL: you need git to download datadust dependencies.
Check README.md for details
endef
define BZR_ERROR
FATAL: you need bazaar (bzr) to download datadust dependencies.
Check README.md for details
endef
.PHONY: all check-path get hg git bzr get-code test
all: check-path get test
build: check-path get _go_test _datadust
# It does not support GOPATH with multiple paths.
check-path:
ifndef GOPATH
@echo "FATAL: you must declare GOPATH environment variable, for more"
@echo " details, please check README.md file and/or"
@echo " http://golang.org/cmd/go/#GOPATH_environment_variable"
@exit 1
endif
@exit 0
get: hg git bzr get-code godep
hg:
$(if $(shell hg), , $(error $(HG_ERROR)))
git:
$(if $(shell git), , $(error $(GIT_ERROR)))
bzr:
$(if $(shell bzr), , $(error $(BZR_ERROR)))
get-code:
go get $(GO_EXTRAFLAGS) -u -d -t -insecure ./...
godep:
go get $(GO_EXTRAFLAGS) github.com/tools/godep
godep restore ./...
_go_test:
# go clean $(GO_EXTRAFLAGS) ./...
# go test $(GO_EXTRAFLAGS) ./...
_datadust:
rm -f datadust
go build $(GO_EXTRAFLAGS) -a github.com/scalegray/datadust
_datadustr:
sudo ./datadust start
# rm -f datadust
test: _go_test _datadust _datadustr
_install_deadcode: git
go get $(GO_EXTRAFLAGS) github.com/remyoudompheng/go-misc/deadcode
deadcode: _install_deadcode
@go list ./... | sed -e 's;github.com/scalegray/datadust/;;' | xargs deadcode
deadc0de: deadcode