-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
49 lines (40 loc) · 1.36 KB
/
Makefile
File metadata and controls
49 lines (40 loc) · 1.36 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
all: bin/beacon test
SRC=$(shell find ./src -name "*.go")
VERSION_NUMBER=0.0.0
GOPATH:=$(GOPATH):`pwd`
HASH:=$(shell git rev-parse HEAD)
DEBUG_GOOGLE_ID:=$(shell cat debug.id)
RELEASE_GOOGLE_ID:=$(shell cat release.id)
LDFLAGS=-X main.version=$(VERSION_NUMBER) -X main.gitHash=$(HASH) -X main.releaseGoogleID=$(RELEASE_GOOGLE_ID) -X main.debugGoogleID=$(DEBUG_GOOGLE_ID)
bin/beacon: $(SRC)
mkdir -p bin
GOPATH=$(GOPATH) go get gopkg.in/redis.v3
GOPATH=$(GOPATH) go get github.com/nfnt/resize
GOPATH=$(GOPATH) go install -v -ldflags "$(LDFLAGS)" github.com/opus-ua/beacon
.PHONY: test
test:
GOPATH=$(GOPATH) go test github.com/opus-ua/beacon -v --bench .
GOPATH=$(GOPATH) go test github.com/opus-ua/beacon-db -v --bench .
.PHONY: install
install:
cp ./bin/beacon /usr/bin/beacon
cp ./tools/beacon.service /etc/systemd/system/beacon.service
systemctl daemon-reload
systemctl enable beacon
systemctl start beacon
.PHONY: format
format:
GOPATH=$(GOPATH) go fmt src/github.com/opus-ua/beacon/*
GOPATH=$(GOPATH) go fmt src/github.com/opus-ua/beacon-post/*
GOPATH=$(GOPATH) go fmt src/github.com/opus-ua/beacon-db/*
.PHONY: package
package:
mkdir -p ./beacon
cp ./bin/beacon ./beacon/beacon
cp ./tools/beacon.service ./beacon/beacon.service
cp ./tools/install.sh beacon/install.sh
tar czf ./bin/beacon.tar.gz ./beacon
rm -rf ./beacon
.PHONY: clean
clean:
rm -rf bin