-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMakefile
49 lines (37 loc) · 912 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
NAME := vinbero
#brunch name version
VERSION := $(shell git rev-parse --abbrev-ref HEAD)
PKG_NAME=$(shell basename `pwd`)
LDFLAGS := -ldflags="-s -w -X \"github.com/takehaya/vinbero/pkg/version.Version=$(VERSION)\" -extldflags \"-static\""
SRCS := $(shell find . -type f -name '*.go')
.DEFAULT_GOAL := build
build: $(SRCS) gen
go build $(LDFLAGS) -o ./bin/$(NAME) ./cmd/$(NAME)
.PHONY: gtp
gtp:
go build $(LDFLAGS) -o ./bin/gtptools ./cmd/gtptools
.PHONY: run
run:
go run $(LDFLAGS) ./cmd/$(NAME)
.PHONY: test
test:
go test -v ./integration
## lint
.PHONY: lint
lint:
@for pkg in $$(go list ./...): do \
golint --set_exit_status $$pkg || exit $$?; \
done
.PHONY: codecheck
codecheck:
test -z "$(gofmt -s -l . | tee /dev/stderr)"
go vet ./...
.PHONY: clean
clean:
rm -rf bin
.PHONY: install
install:
go install $(LDFLAGS) ./cmd/$(NAME)
.PHONY: gen
gen:
go generate pkg/coreelf/elf.go