-
Notifications
You must be signed in to change notification settings - Fork 12
/
Makefile
73 lines (53 loc) · 2.04 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
GO=go
#GO=/code/go15/bin/go
REDISSERV=redis-server
REDISCLI=redis-cli
INTSOCK=/tmp/redis-test.sock
VER=0.3.3.2
BUILDFLAGS=-ldflags "-X github.com/salesforce/rmux.version=$(VER)"
all: clean test build-dev build
clean:
rm -f ./build/*
test:
$(GO) test ./...
test-dev:
$(GO) test -v -tags 'dev' ./...
test-integration:
$(REDISSERV) $(PWD)/example/redis.conf
sleep 1
$(REDISCLI) -s $(INTSOCK) flushall
$(GO) test -tags 'integration' ./...
kill -TERM $$(cat /tmp/redis-test-instance-for-rmux.pid)
test-integration-dev:
$(REDISSERV) $(PWD)/example/redis.conf
sleep 1
$(REDISCLI) -s $(INTSOCK) flushall
$(GO) test -tags 'integration dev' ./...
kill -TERM $$(cat /tmp/redis-test-instance-for-rmux.pid)
fmt:
$(GO) fmt ./...
mkbuild:
mkdir -p ./build
build: mkbuild
$(GO) build $(BUILDFLAGS) -o build/rmux ./main
build-all: mkbuild build build-linux-amd64 build-linux-386 build-darwin
build-linux-amd64: mkbuild
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 $(GO) build $(BUILDFLAGS) -o build/rmux.amd64 ./main
build-linux-386: mkbuild
GOOS=linux GOARCH=386 CGO_ENABLED=0 $(GO) build $(BUILDFLAGS) -o build/rmux.386 ./main
build-darwin: mkbuild
GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 $(GO) build $(BUILDFLAGS) -o build/rmux.osx ./main
build-dev: mkbuild
$(GO) build $(BUILDFLAGS) -tags 'dev' -o build/rmux-dev ./main
build-all-dev: mkbuild build-dev
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 $(GO) build $(BUILDFLAGS) -tags 'dev' -o build/rmux-linux-amd64-dev ./main
GOOS=linux GOARCH=386 CGO_ENABLED=0 $(GO) build $(BUILDFLAGS) -tags 'dev' -o build/rmux-linux-386-dev ./main
run-example: build
./build/rmux -config=./example/config.json -graphite=localhost:8125 -timing
run-example-dev: build-dev
./build/rmux-dev -config=./example/config.json
run-profile: build
./build/rmux -config=./example/config.json -cpuProfile=./build/profile.prof
run-example-mux: build
./build/rmux -config=./example/config-mux.json
.PHONY: clean test test-dev mkbuild build build-all build-dev build-all-dev fmt run-example run-example-dev run-profile test-integration test-integration-dev