-
Notifications
You must be signed in to change notification settings - Fork 12
/
Makefile
37 lines (33 loc) · 1001 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
# Go parameters
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get
BINARY_NAME=terraform-provider-kaleido
BINARY_MAC=${BINARY_NAME}-macos
BINARY_WIN=${BINARY_NAME}-win-x64
BINARY_LIN=${BINARY_NAME}-linux-x64
LDFLAGS="-X main.buildDate=`date -u +\"%Y-%m-%dT%H:%M:%SZ\"` -X main.buildVersion=$(BUILD_VERSION)"
DEPS=https://gmplib.org/download/gmp/gmp-6.0.0a.tar.bz2
TARGETS="windows-10.0/*,darwin-10.10/*"
.PHONY: test
all: deps build test
build:
$(GOBUILD) -o ${BINARY_NAME}
package: build-linux build-mac build-win
test:
$(GOTEST) ./... -cover -coverprofile=coverage.txt -covermode=atomic
clean:
$(GOCLEAN)
rm -f $(BINARY_NAME)-$(BUILD_VERSION)*
deps:
$(GOGET)
build-linux:
GOOS=linux GOARCH=amd64 $(GOBUILD) -o $(BINARY_LIN) -v
build-mac:
GOOS=darwin GOARCH=arm64 $(GOBUILD) -o $(BINARY_MAC) -v
build-mac-legacy:
GOOS=darwin GOARCH=amd64 $(GOBUILD) -o $(BINARY_MAC) -v
build-win:
GOOS=windows GOARCH=amd64 $(GOBUILD) -o $(BINARY_WIN) -v