forked from DataReply/korgi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·39 lines (29 loc) · 833 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
PROJECT_NAME:=korgi
GOFILES:=$(shell find . -name '*.go' | grep -v -E '(./vendor)')
OS := $(shell uname | tr '[:upper:]' '[:lower:]')
ARCH := amd64
LDFLAGS := -w -s
SRC := $(shell find . -type f -name '*.go' -print)
REPO := github.com/DataReply/korgi
run:
go run main.go
all: clean check bin
bin: $(GOFILES)
mkdir -p bin/${OS}/
GOOS=${OS} GOARCH=${ARCH} go build -a -tags musl -ldflags "$(LDFLAGS)" -o bin/${OS}/korgi main.go
gofmt:
gofmt -w -s pkg/
gofmt -w -s cmd/
test:
GOOS=${OS} GOARCH=${ARCH} go test ./...
check:
@find . -name vendor -prune -o -name '*.go' -exec gofmt -s -d {} +
@go vet $(shell go list ./... | grep -v '/vendor/')
@go test -v $(shell go list ./... | grep -v '/vendor/')
dep:
go get -d -v
clean:
rm -rf bin
run:
go run main.go
.PHONY: all