forked from XiaoMi/Gaea
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·31 lines (23 loc) · 870 Bytes
/
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
ROOT:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
GAEA_OUT:=$(ROOT)/bin/gaea
GAEA_CC_OUT:=$(ROOT)/bin/gaea-cc
PKG:=$(shell go list -m)
.PHONY: all build gaea gaea-cc parser clean test build_with_coverage
all: build test
build: parser gaea gaea-cc
gaea:
go build -o $(GAEA_OUT) $(shell bash gen_ldflags.sh $(GAEA_OUT) $(PKG)/core $(PKG)/cmd/gaea)
gaea-cc:
go build -o $(GAEA_CC_OUT) $(shell bash gen_ldflags.sh $(GAEA_CC_OUT) $(PKG)/core $(PKG)/cmd/gaea-cc)
parser:
cd parser && make && cd ..
clean:
@rm -rf bin
@rm -f .coverage.out .coverage.html
test:
go test -coverprofile=.coverage.out ./...
go tool cover -func=.coverage.out -o .coverage.func
tail -1 .coverage.func
go tool cover -html=.coverage.out -o .coverage.html
build_with_coverage:
go test -c cmd/gaea/main.go cmd/gaea/main_test.go -coverpkg ./... -covermode=count -o bin/gaea