Skip to content

Commit 6b00382

Browse files
Improve Makefile (#203)
* Improve Makefile * Remove hardcoded references to GOOS and GOARCH * Use `go install` for the `install` target * Unify parentheses versus curly braces * Abstract duplicate path * Restyled by whitespace Co-authored-by: Restyled.io <commits@restyled.io>
1 parent 17f1847 commit 6b00382

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

Makefile

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
11
HOSTNAME=github.com
22
NAMESPACE=iterative
33
NAME=iterative
4-
VERSION=0.6
5-
#OS_ARCH=linux_amd64
6-
OS_ARCH=darwin_amd64
4+
VERSION=0.0.0+development
5+
OS_ARCH=${shell go env GOOS}_${shell go env GOARCH}
76
BINARY=terraform-provider-${NAME}
7+
INSTALL_PATH=~/.terraform.d/plugins/${HOSTNAME}/${NAMESPACE}/${NAME}/${VERSION}/${OS_ARCH}
88

99
default: install
1010

1111
build:
12-
go build -o ${BINARY}
12+
go build
1313

14-
install: build
15-
mkdir -p ~/.terraform.d/plugins/${HOSTNAME}/${NAMESPACE}/${NAME}/${VERSION}/${OS_ARCH}
16-
mv ${BINARY} ~/.terraform.d/plugins/${HOSTNAME}/${NAMESPACE}/${NAME}/${VERSION}/${OS_ARCH}
14+
install:
15+
GOBIN=${INSTALL_PATH} go install
1716

1817
test:
19-
go test ./... $(TESTARGS) -timeout=30s -parallel=4
18+
go test ./... ${TESTARGS} -timeout=30s -parallel=4
2019

2120
testacc:
22-
TF_ACC=1 go test ./... -v $(TESTARGS) -timeout 120m
21+
TF_ACC=1 go test ./... -v ${TESTARGS} -timeout 120m

0 commit comments

Comments
 (0)