-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
75 lines (54 loc) · 1.56 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
71
72
73
74
75
.PHONY: build build-arm build-debian run
.PHONY: test-all test-watcher test-watcher-observe test-event test-utils test-cmd lint-all vet-all
VERSION := test-build
BUILD := $$(git log -1 --pretty=%h)
BUILD_TIME := $$(date -u +"%Y%m%d.%H%M%S")
build:
@go build \
-ldflags "-X main.Version=${VERSION} -X main.Build=${BUILD} -X main.BuildTime=${BUILD_TIME}" \
-o ./bin/switchboard ./cmd
build-debian:
@GOOS=linux GOARCH=amd64 go build \
-ldflags "-X main.Version=${VERSION} -X main.Build=${BUILD} -X main.BuildTime=${BUILD_TIME}" \
-o ./bin/switchboard ./cmd
build-arm:
@GOOS=linux GOARCH=arm GOARM=5 go build \
-ldflags "-X main.Version=${VERSION} -X main.Build=${BUILD} -X main.BuildTime=${BUILD_TIME}" \
-o ./bin/switchboard ./cmd
run:
@go run ./cmd/main.go
test-watcher:
@gotest -v ./watcher
test-watcher-observe:
@gotest -v ./watcher -test.run TestObserve
test-event:
@gotest -v ./event
test-utils:
@gotest -v ./utils
test-cmd:
@gotest -v ./cmd
test-all: test-all test-watcher test-watcher-observe test-event test-utils test-cmd
lint-watcher:
@golint ./watcher
lint-event:
@golint ./event
lint-utils:
@golint ./utils
lint-cmd:
@golint ./cmd
lint-all: lint-watcher lint-event lint-utils lint-cmd
vet-watcher:
@go vet ./watcher/watcher.go
@go vet ./watcher/watcher_test.go
vet-event:
@go vet ./event/event.go
@go vet ./event/event_test.go
vet-utils:
@go vet ./utils/utils.go
@go vet ./utils/utils_test.go
vet-cmd:
@go vet ./cmd/main.go
@go vet ./cmd/watch.go
vet-all: vet-watcher vet-event vet-utils vet-cmd
test-format-all:
@gofmt -l -d .