This repository has been archived by the owner on Sep 22, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 26
/
Makefile
59 lines (44 loc) · 1.38 KB
/
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
ALL_TARGETS += darwin_amd64 \
linux_amd64 \
windows_amd64
VERSION ?= dev
export ACME_SERVER_URL ?= https://acme-staging-v02.api.letsencrypt.org/directory
.PHONY: test
test:
go test . ./acme
.PHONY: testacc
testacc:
TF_ACC=1 go test -v ./acme $(TESTARGS) -timeout 240m
.PHONY: debugacc
debugacc:
TF_ACC=1 dlv test ./acme -- -test.v $(TESTARGS) -test.timeout 240m
pkg/darwin_amd64/terraform-provider-acme:
@echo "==> Building $@..."
@CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 \
go build -o "$@"
pkg/linux_amd64/terraform-provider-acme:
@echo "==> Building $@..."
@CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \
go build -o "$@"
pkg/windows_amd64/terraform-provider-acme:
@echo "==> Building $@..."
@CGO_ENABLED=0 GOOS=windows GOARCH=amd64 \
go build -o "$@.exe"
# Define package targets for each of the build targets we actually have on this system
define makePackageTarget
pkg/$(1).zip: pkg/$(1)/terraform-provider-acme
@echo "==> Packaging for $(1)..."
@mkdir -p pkg/dist
@zip -j pkg/dist/terraform-provider-acme_$(VERSION)_$(1).zip pkg/$(1)/*
endef
# Reify the package targets
$(foreach t,$(ALL_TARGETS),$(eval $(call makePackageTarget,$(t))))
.PHONY: release
release: clean $(foreach t,$(ALL_TARGETS),pkg/$(t).zip) ## Build all release packages which can be built on this platform.
@echo "==> Results:"
@tree --dirsfirst pkg
.PHONY: build
build: release
.PHONY: clean
clean:
rm -rf pkg/