-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
44 lines (35 loc) · 847 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
.PHONY: all clean build lint
NAME ?= gateway
SOURCE ?= ./cmd/gateway
GOOS ?= linux
GOARCH ?= amd64
BUILD_DIR ?= bin/$(GOOS).$(GOARCH)
BINARY= $(BUILD_DIR)/$(NAME)
BUILD_FLAGS=
SOURCE_FOLDERS := $(shell go list -f {{.Dir}} ./...)
all: build
clean:
rm -Rf bin/
build:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -v $(BUILD_FLAGS) -o "$(BINARY)" $(SOURCE)
build_windows:
export GOOS=windows
go build -v -o "bin/windows.$(GOARCH)/$(NAME).exe" $(SOURCE)
lint:
golangci-lint run --deadline=30m --disable-all \
--enable=govet \
--enable=staticcheck \
--enable=unused \
--enable=gosimple \
--enable=structcheck \
--enable=varcheck \
--enable=ineffassign \
--enable=deadcode \
--enable=golint \
--enable=unconvert \
--enable=goimports \
--enable=maligned \
--enable=unparam \
--enable=prealloc \
--enable=scopelint \
./...