-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
57 lines (47 loc) · 1.67 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
.PHONY: all
all: linux
.PHONY: win
win:
GIT_COMMIT=`git rev-list -1 HEAD 2>/dev/null || echo ""` && \
GIT_DATE=`git log -1 --date=short --pretty=format:%ct 2>/dev/null || echo ""` && \
go build \
-ldflags "-s -w -X github.com/giticicb/cmd/galaxy/launcher.gitCommit=$${GIT_COMMIT} -X github.com/giticicb/cmd/galaxy/launcher.gitDate=$${GIT_DATE}" \
-o build/galaxy.exe \
./cmd/galaxy
linux:
GIT_COMMIT=`git rev-list -1 HEAD 2>/dev/null || echo ""` && \
GIT_DATE=`git log -1 --date=short --pretty=format:%ct 2>/dev/null || echo ""` && \
go build \
-ldflags "-s -w -X github.com/giticicb/cmd/galaxy/launcher.gitCommit=$${GIT_COMMIT} -X github.com/giticicb/cmd/galaxy/launcher.gitDate=$${GIT_DATE}" \
-o build/galaxy \
./cmd/galaxy
.PHONY: mac
mac:
GIT_COMMIT=`git rev-list -1 HEAD 2>/dev/null || echo ""` && \
GIT_DATE=`git log -1 --date=short --pretty=format:%ct 2>/dev/null || echo ""` && \
go build \
-o build/galaxy\
./cmd/galaxy
TAG ?= "latest"
.PHONY: galaxy-image
galaxy-image:
docker build \
--network=host \
--build-arg GOPROXY=$(GOPROXY) \
-f ./docker/Dockerfile.galaxy -t "galaxy:$(TAG)" .
.PHONY: test
test:
go test ./...
.PHONY: coverage
coverage:
go test -coverprofile=cover.prof $$(go list ./... | grep -v '/gossip/contract/' | grep -v '/gossip/emitter/mock' | xargs)
go tool cover -func cover.prof | grep -e "^total:"
.PHONY: fuzz
fuzz:
CGO_ENABLED=1 \
mkdir -p ./fuzzing && \
go run github.com/dvyukov/go-fuzz/go-fuzz-build -o=./fuzzing/gossip-fuzz.zip ./gossip && \
go run github.com/dvyukov/go-fuzz/go-fuzz -workdir=./fuzzing -bin=./fuzzing/gossip-fuzz.zip
.PHONY: clean
clean:
rm -fr ./build/*