-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
66 lines (54 loc) · 1.56 KB
/
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
52
53
54
55
56
57
58
59
60
61
62
63
64
.PHONY: all
GORCON_ENVS := \
-e OS_ARCH_ARG \
-e OS_PLATFORM_ARG \
-e TESTFLAGS \
-e VERBOSE \
-e VERSION
BIND_DIR := "dist"
GIT_BRANCH := $(subst heads/,,$(shell git rev-parse --abbrev-ref HEAD 2>/dev/null))
REPONAME := $(shell echo $(REPO) | tr '[:upper:]' '[:lower:]')
print-%: ; @echo $*=$($*)
default: binary
all: ## validate all checks, build linux binary, run all tests\ncross non-linux binaries
./script/make.sh
binary:
./script/make.sh generate binary
crossbinary: ## cross build the non-linux binaries
./script/make.sh generate crossbinary
validate: ## validate gofmt, golint and go vet
./script/make.sh validate-gofmt validate-govet validate-golint
dist:
mkdir dist
install:
GOBIN=$(GOPATH)/bin GO15VENDOREXPERIMENT=1 go install gorcon-arma/*.go
test:
GO15VENDOREXPERIMENT=1 go test -cover `glide novendor`
vet:
go tool vet .
go tool vet --shadow .
lint:
script/validate-golint
golint -min_confidence 1 ./...
errcheck:
errcheck -ignore '(Close|Write|SetReadDeadline|SetWriteDeadline)' ./...
check: lint vet errcheck
format:
find . -name "*.go" -exec gofmt -w "{}" \;
goimports -w=true .
prepare:
go get -u golang.org/x/tools/cmd/goimports
go get -u github.com/Masterminds/glide
go get -u github.com/golang/lint/golint
go get -u github.com/kisielk/errcheck
go get -u github.com/bborbe/debian_utils/bin/create_debian_package
update:
glide up
clean:
rm -rf var vendor target
package:
cd $(GOPATH) && create_debian_package \
-logtostderr \
-v=2 \
-version=$(VERSION) \
-config=src/github.com/playnet-public/gorcon-arma/deb/create_deb_config.json