-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
71 lines (49 loc) · 1.4 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
.PHONY: all test dist
VERSION ?= dev
ifdef GITHUB_REF_NAME
VERSION = $(GITHUB_REF_NAME)
endif
default: run
all: test
build: build-game build-generator
build-game:
go build -o go-sudoku ./cmd/game
build-generator:
go build -o go-sudoku-generator ./cmd/generator
demo-generator: build-generator
./go-sudoku-generator generate
./go-sudoku-generator -type jigsaw generate
./go-sudoku-generator -type samurai generate
demo-solver: build-generator
./go-sudoku-generator -format csv generate | ./go-sudoku-generator -progress solve
dist: dist-game dist-generator
dist-game:
gox -ldflags="-s -w -X main.version=${VERSION}" \
-os="linux darwin windows" \
-arch="amd64" \
-output="./dist/go-sudoku_{{.OS}}_{{.Arch}}_${VERSION}" \
./cmd/game
dist-generator:
gox -ldflags="-s -w -X main.version=${VERSION}" \
-os="linux darwin windows" \
-arch="amd64" \
-output="./dist/go-sudoku-generator_{{.OS}}_{{.Arch}}_${VERSION}" \
./cmd/generator
fmt: tidy
go fmt $(shell go list ./...)
gen: gen-readme
gen-readme: build
./docs/generate_readme.sh > README.md
get-tools:
go install github.com/mitchellh/[email protected]
go install golang.org/x/lint/golint@latest
lint:
golint -set_exit_status $(shell go list ./...)
run:
go run .
test: gen fmt lint vet build
go test -cover -coverprofile=.coverprofile $(shell go list ./...)
tidy:
go mod tidy
vet:
go vet $(shell go list ./...)