-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
55 lines (42 loc) · 842 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# Copyright 2020 John Cramb. All rights reserved.
# Licensed under the MIT License. See LICENSE in the project root
# for license information.
# tools
GO = go
GOMOD = $(GO) mod
GOLINT = golint
GOLIST = $(shell $(GO) list ./... | grep -v vendor)
# bins
CMD = cedict
# src
REPO = github.com/jcramb/cedict
LDFLAGS= -ldflags="-s -w"
.PHONY: all
all: install cedict
.PHONY: install
install:
$(GO) install $(LDFLAGS) ./...
.PHONY: build
build:
$(GO) build $(LDFLAGS) ./...
.PHONY: $(CMD)
$(CMD):
$(GO) build $(LDFLAGS) ./cmd/$@
.PHONY: fmt
fmt:
$(GO) fmt ./...
.PHONY: vet
vet:
$(GO) vet ./...
.PHONY: lint
lint: $(GOLINT)
$(GOLINT) .
.PHONY: test
test:
$(GO) test -race -v -covermode atomic -coverprofile=profile.cov ./...
.PHONY: clean
clean:
rm -f $(CMD)
rm -rf ./testdata
$(GOLINT):
go get -u golang.org/x/lint/golint