-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathMakefile
44 lines (33 loc) · 925 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
BIN_NAME = zerto-exporter
DOCKER_IMAGE_NAME ?= claranet/zerto-exporter
GOPATH = $($pwd)
all: linux darwin windows
linux: prepare
$(eval GOOS=linux)
$(eval GOARCH=amd64)
go build -o ./bin/$(BIN_NAME)
zip ./bin/$(BIN_NAME)-$(GOOS)-$(GOARCH).zip ./bin/$(BIN_NAME)
darwin: prepare
$(eval GOOS=darwin)
$(eval GOARCH=amd64)
go build -o ./bin/$(BIN_NAME)
zip ./bin/$(BIN_NAME)-$(GOOS)-$(GOARCH).zip ./bin/$(BIN_NAME)
windows: prepare
$(eval GOOS=windows)
$(eval GOARCH=amd64)
go build -o ./bin/$(BIN_NAME).exe
zip ./bin/$(BIN_NAME)-$(GOOS)-$(GOARCH).zip ./bin/$(BIN_NAME).exe
docker:
@echo ">> Compile using docker container"
@docker build -t $(DOCKER_IMAGE_NAME):latest .
@docker tag $(DOCKER_IMAGE_NAME):latest $(DOCKER_IMAGE_NAME):v1.0.2
prepare:
@echo "Create output directory ./bin/"
mkdir -p bin/
@echo "GO get dependencies"
go get -d
clean:
@echo "Clean up"
go clean
rm -rf bin/
.PHONY: all