-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
48 lines (36 loc) · 1.28 KB
/
Makefile
File metadata and controls
48 lines (36 loc) · 1.28 KB
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
GO := GO15VENDOREXPERIMENT=1 go
GOOS ?= $(shell go env GOOS)
GOARCH ?= $(shell go env GOARCH)
ORG := github.com/kameshsampath
REPOPATH ?= $(ORG)/checontroller
ROOT_PACKAGE = $(GOPATH)/$(REPOPATH)
BUILD_DIR ?= ./bin
GLIDE = glide
glide.lock:
glide.yaml | $(ROOT_PACKAGE)
cd $(ROOT_PACKAGE) && $(GLIDE) update -v
@touch $@
vendor:
glide.lock | $(ROOT_PACKAGE)
cd $(ROOT_PACKAGE) && $(GLIDE) --quiet install
@touch $@
bin/checontroller: bin/checontroller-$(GOOS)-$(GOARCH)
cp $(BUILD_DIR)/checontroller-darwin-amd64 $(BUILD_DIR)/checontroller
bin/checontroller-darwin-amd64: gopath
GOARCH=amd64 GOOS=darwin go build -o $(BUILD_DIR)/checontroller-darwin-amd64 main.go
bin/checontroller-linux-amd64: gopath
GOARCH=amd64 GOOS=linux go build -o $(BUILD_DIR)/checontroller-linux-amd64 main.go
bin/checontroller-windows-amd64: gopath
GOARCH=amd64 GOOS=windows go build -o $(BUILD_DIR)/checontroller-windows-amd64.exe main.go
.PHONY: gopath
gopath: $(GOPATH)/src/$(ORG)
.PHONY: clean
clean:
rm -rf $(BUILD_DIR)
.PHONY: build
build: bin/checontroller
.PHONY: allPF
allPF: bin/checontroller bin/checontroller-darwin-amd64 bin/checontroller-linux-amd64 bin/checontroller-windows-amd64
.PHONY: docker
docker: bin/checontroller-linux-amd64
docker build --rm -t "kameshsampath/checontroller:dev" .