-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
44 lines (34 loc) · 799 Bytes
/
Makefile
File metadata and controls
44 lines (34 loc) · 799 Bytes
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
OUTPUT := goservicetemplate
GOOS := linux # this is a default, changed later
MAINFILE := ./cmd/main.go
ifeq ($(OS),Windows_NT)
OUTPUT := $(OUTPUT).exe
GOOS := windows
else
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
GOOS := linux
endif
ifeq ($(UNAME_S),Darwin)
GOOS := darwin
endif
endif
.PHONY: all clean build test fmt vet
default: all
all: clean fmt vet test build
clean:
rm -rf $(OUTPUT)
godep go clean ./...
bootstrap:
go get github.com/tools/godep
godep restore
build: clean fmt vet
export CGO_ENABLED=0
export GOOS=$(GOOS)
godep go build -a -installsuffix cgo -o ./_dist/$(OUTPUT) $(MAINFILE)
test:
godep go test -race ./... -ginkgo.failOnPending -ginkgo.randomizeAllSpecs -ginkgo.skipMeasurements=true
fmt:
go fmt ./...
vet:
go vet ./...