forked from NetApp/netappdvp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
41 lines (32 loc) · 903 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
# Copyright 2016 NetApp, Inc. All Rights Reserved.
GOOS=linux
GOARCH=amd64
GOGC=""
# BUILD_TAG is intended to be an optional environment variable that uniquely
# identifies the build instance. It is intended to enable concurrent builds
# on the same machine.
GO_PATH_VOLUME="netappdvp_go_path_$(BUILD_TAG)"
GO=docker run --rm \
-e GOOS=$(GOOS) \
-e GOARCH=$(GOARCH) \
-e GOGC=$(GOGC) \
-v $(GO_PATH_VOLUME):/go \
-v "$(PWD)":/go/src/github.com/netapp/netappdvp \
-w /go/src/github.com/netapp/netappdvp \
golang:1.6 go
.PHONY=clean default fmt get install test
default: build
clean:
rm -f $(PWD)/bin/netappdvp
docker volume rm $(GO_PATH_VOLUME) || true
fmt:
@$(GO) fmt ./...
get:
@$(GO) get -v
build: get *.go
@mkdir -p $(PWD)/bin
@$(GO) build -x -o /go/src/github.com/netapp/netappdvp/bin/netappdvp
install: build
@$(GO) install
test:
@$(GO) test github.com/netapp/netappdvp/...