forked from cortezaproject/corteza
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.inc
91 lines (65 loc) · 2.3 KB
/
Makefile.inc
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
GO = go
GOINSTALL = $(GO) install
GOFLAGS ?= -trimpath
GOPATH ?= $(HOME)/go
ROOT_DIR = $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
CGO_ENABLED = 1
export GOFLAGS
export CGO_ENABLED
########################################################################################################################
# Tool bins
GOCRITIC = $(GOPATH)/bin/gocritic
MOCKGEN = $(GOPATH)/bin/mockgen
GOTEST = $(GOPATH)/bin/gotest
STATICCHECK = $(GOPATH)/bin/staticcheck
PROTOGEN = $(GOPATH)/bin/protoc-gen-go
PROTOGEN_GRPC = $(GOPATH)/bin/protoc-gen-go-grpc
GIN = $(GOPATH)/bin/gin
STATIK = $(GOPATH)/bin/statik
MODOUTDATED = $(GOPATH)/bin/go-mod-outdated
CUE = $(GOPATH)/bin/cue
CODEGEN = $(GOPATH)/bin/corteza-codegen
JSONTPLEXEC = $(GOPATH)/bin/corteza-json-tpl-exec
PROTOC = /usr/local/bin/protoc
FSWATCH = /usr/local/bin/fswatch
# fswatch is intentionally left out...
BINS = $(GOCRITIC) $(MOCKGEN) $(GOTEST) $(STATICCHECK) $(PROTOGEN) $(GIN) $(STATIK)
# Corteza's tools
CORTEZA_BINS = $(CODEGEN) $(JSONTPLEXEC)
########################################################################################################################
# Go Toolset
$(GOCRITIC):
$(GOINSTALL) github.com/go-critic/go-critic@latest
$(MOCKGEN):
$(GOINSTALL) github.com/golang/mock/mockgen@latest
$(STATICCHECK):
$(GOINSTALL) honnef.co/go/tools/cmd/staticcheck@latest
$(PROTOGEN):
$(GOINSTALL) github.com/golang/protobuf/protoc-gen-go@latest
$(PROTOGEN_GRPC):
$(GOINSTALL) google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
$(GIN):
$(GOINSTALL) github.com/codegangsta/gin@latest
$(GOTEST):
$(GOINSTALL) github.com/rakyll/gotest@latest
$(STATIK):
$(GOINSTALL) github.com/goware/statik@latest
$(MODOUTDATED):
$(GOINSTALL) github.com/psampaz/go-mod-outdated@latest
$(CUE):
$(GOINSTALL) cuelang.org/go/cmd/cue@latest
$(CODEGEN):
$(GO) build -o $@ $(ROOT_DIR)/cmd/codegen/main.go
$(JSONTPLEXEC):
$(GO) build -o $@ $(ROOT_DIR)/codegen/tool
clean-tools:
rm -f $(BINS)
clean-corteza-tools:
rm -f $(CORTEZA_BINS)
########################################################################################################################
COLOUR_GREEN=\033[0;32m
COLOUR_YELLOW=\033[0;33m
COLOUR_RED=\033[0;31m
COLOUR_BLUE=\033[0;34m
COLOUR_END=\033[0m
#