-
Notifications
You must be signed in to change notification settings - Fork 11
/
Makefile
70 lines (56 loc) · 1.54 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
58
59
60
61
62
63
64
65
66
67
68
69
70
NAME := git-ghost
PROJECTROOT := $(shell pwd)
REVISION := $(shell git rev-parse --short HEAD)
OUTDIR ?= $(PROJECTROOT)/dist
RELEASE_TAG ?=
GITHUB_USER := pfnet-research
GITHUB_REPO := git-ghost
GITHUB_REPO_URL := [email protected]:pfnet-research/git-ghost.git
GITHUB_TOKEN ?=
LDFLAGS := -ldflags="-s -w -X \"github.com/pfnet-research/git-ghost/cmd.Revision=$(REVISION)\" -extldflags \"-static\""
.PHONY: build
build:
go build -tags netgo -installsuffix netgo $(LDFLAGS) -o $(OUTDIR)/$(NAME)
.PHONY: install
install:
go install -tags netgo -installsuffix netgo $(LDFLAGS)
.PHONY: build-linux-amd64
build-linux-amd64:
make build \
GOOS=linux \
GOARCH=amd64 \
NAME=git-ghost-linux-amd64
.PHONY: build-linux
build-linux: build-linux-amd64
.PHONY: build-darwin
build-darwin:
make build \
GOOS=darwin \
NAME=git-ghost-darwin-amd64
.PHONY: build-windows
build-windows:
make build \
GOARCH=amd64 \
GOOS=windows \
NAME=git-ghost-windows-amd64.exe
.PHONY: build-all
build-all: build-linux build-darwin build-windows
.PHONY: lint
lint:
golangci-lint run --config golangci.yml
.PHONY: e2e
e2e:
@go test -v $(PROJECTROOT)/test/e2e/e2e_test.go
.PHONY: update-license
update-license:
@python3 ./scripts/license/add.py -v
.PHONY: check-license
check-license:
@python3 ./scripts/license/check.py -v
.PHONY: coverage
coverage:
@go test -tags no_e2e -covermode=count -coverprofile=profile.cov -coverpkg ./pkg/...,./cmd/... $(shell go list ./... | grep -v /vendor/)
@go tool cover -func=profile.cov
.PHONY: clean
clean:
rm -rf $(OUTDIR)/*