-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
47 lines (31 loc) · 835 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
.PHONY: compile build build_all fmt lint test itest vet bootstrap
SOURCE_FOLDER := .
BINARY_PATH ?= ./bin/configo
GOARCH ?= amd64
ifdef GOOS
BINARY_PATH :=$(BINARY_PATH).$(GOOS)-$(GOARCH)
endif
SPECS ?= spec/integration/**
export GO15VENDOREXPERIMENT=1
default: build
build_all: vet fmt
for GOOS in darwin linux windows; do \
$(MAKE) compile GOOS=$$GOOS GOARCH=amd64 ; \
done
compile:
CGO_ENABLED=0 go build -i -v -ldflags '-s' -o $(BINARY_PATH) $(SOURCE_FOLDER)/
build: vet fmt compile
fmt:
go fmt $(glide novendor)
vet:
go vet $(glide novendor)
lint:
go list $(SOURCE_FOLDER)/... | grep -v /vendor/ | xargs -L1 golint
test:
go test $(glide novendor)
itest:
$(MAKE) compile GOOS=linux GOARCH=amd64
bats $(SPECS)
bootstrap:
go get github.com/Masterminds/glide
glide install --use-gopath --cache-gopath