forked from Syleron/pulseha
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
53 lines (49 loc) · 1.58 KB
/
Makefile
File metadata and controls
53 lines (49 loc) · 1.58 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
.PHONEY: clean get
VERSION=`git describe`
BUILD=`git rev-parse HEAD`
LDFLAGS=-ldflags "-X main.Version=${VERSION} -X main.Build=${BUILD}"
default: all
all: build cli
build: get
if [ ! -d "./bin/" ]; then mkdir ./bin/; fi
cp config.json ./bin/
env GOOS=linux GOARCH=amd64 go build ${LDFLAGS} -v -o ./bin/pulse ./src/
buildrace: get
if [ ! -d "./bin/" ]; then mkdir ./bin/; fi
cp config.json ./bin/
env GOOS=linux GOARCH=amd64 go build -race ${LDFLAGS} -v -o ./bin/pulse ./src/
macbuild: get
if [ ! -d "./bin/" ]; then mkdir ./bin/; fi
cp config.json ./bin/
env GOOS=darwin GOARCH=amd64 go build ${LDFLAGS} -v -o ./bin/pulse ./src/
get:
go get -d ./src/
go get -d ./cmd/
cli: get
if [ ! -d "./bin/" ]; then mkdir ./bin/; fi
env GOOS=linux GOARCH=amd64 go build ${LDFLAGS} -v -o ./bin/pulseha ./cmd/
maccli: get
if [ ! -d "./bin/" ]; then mkdir ./bin/; fi
env GOOS=darwin GOARCH=amd64 go build ${LDFLAGS} -v -o ./bin/pulseha ./cmd/
protos:
protoc ./proto/pulse.proto --go_out=plugins=grpc:.
test:
go test -timeout 10s -v ./src/
go test -timeout 10s -v ./cmd/
go test -timeout 10s -v ./src/utils/
go test -timeout 10s -v ./src/netUtils/
clean:
go clean
install:
ifneq ($(shell uname),Linux)
echo "Install only available on Linux"
exit 1
endif
cp ./bin/pulseha /usr/local/sbin/
cp ./bin/pulse /usr/local/sbin/
#chmod +x /etc/pulseha/pulse
if [ ! -d "/etc/pulseha/" ]; then mkdir /etc/pulseha/; fi
if [ ! -d "/usr/local/lib/pulseha" ]; then mkdir /usr/local/lib/pulseha; fi
cp config.json /etc/pulseha/
cp pulseha.service /etc/systemd/system/
systemctl daemon-reload