-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
51 lines (42 loc) · 864 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
# ref. 改訂2版 みんなのGo言語
NAME := calico-server
VERSION := $(godump show -r)
REVISION := $(shell git rev-parse --short HEAD)
LDFLAGS := "-X main.revision=$(REVISION)"
export GO111MODULE=on
## install dependencies
.PHONY: deps
deps:
go get -v -d
## setup
.PHONY: deps
devel-deps: deps
GO111MODULE=off go get \
github.com/gin-gonic/gin \
github.com/go-sql-driver/mysql \
github.com/Songmu/make2help/cmd/make2help
## test
.PHONY: test
test: deps
go test ./...
## lint
.PHONY: lint
lint: devel-deps
go vet ./...
golint -set_exit_status -min_confidence=0.1 ./...
## build binaries
# bin/%: main.go deps
# go build -ldflags "$(LDFLAGS)" -o $@ $<
## build binary
.PHONY: build
# build: bin/%
build:
go build -o bin/$(NAME)/main -v
# run
.PHONY: run
run: build
bin/$(NAME)/main
## show help
.PHONY: help
help:
@make2help $(MAKEFILE_LIST)