-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathMakefile
57 lines (40 loc) · 1.5 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
all: build
.PHONY: install-tools
install-tools:
go install google.golang.org/protobuf/cmd/[email protected]
go install golang.org/x/tools/cmd/stringer@latest
.PHONY: protoc
protoc:
protoc --proto_path=. --go_out=. gdxsv/proto/*.proto
cd ./flycast/core/gdxsv && protoc --proto_path=../../../gdxsv/proto --cpp_out=. gdxsv.proto
cd ./pcsx2/pcsx2/windows/VCprojects/gdxsv && protoc --proto_path=../../../../../gdxsv/proto --cpp_out=. gdxsv.proto
.PHONY: build
build:
mkdir -p bin
go generate ./gdxsv
CGO_ENABLED=1 go build -ldflags "-X main.gdxsvVersion=$(shell git describe --tags --abbrev=0) -X main.gdxsvRevision=$(shell git rev-parse --short HEAD)" -o bin/gdxsv ./gdxsv
.PHONY: test
test:
go test -race -v ./...
.PHONY: lint
lint:
golangci-lint run
.PHONY: fmt
fmt:
go fmt ./...
.PHONY: race
race:
mkdir -p bin
go generate ./gdxsv
go build -race -ldflags "-X main.gdxsvVersion=$(shell git describe --tags --abbrev=0) -X main.gdxsvRevision=$(shell git rev-parse --short HEAD)" -o bin/gdxsv ./gdxsv
.PHONY: ci
ci:
mkdir -p bin
go generate ./gdxsv
go build -ldflags "-X main.gdxsvVersion=$(shell git describe --tags --abbrev=0) -X main.gdxsvRevision=$(shell git rev-parse --short HEAD)" -o bin/gdxsv ./gdxsv
go test -race -v -coverprofile=coverage.txt -covermode=atomic ./...
.PHONY: release
release:
mkdir -p bin
go generate ./gdxsv
go build -ldflags "-X main.gdxsvVersion=$(shell git describe --tags --abbrev=0) -X main.gdxsvRevision=$(shell git rev-parse --short HEAD)" -o bin/gdxsv ./gdxsv