-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile.BINARIES
63 lines (49 loc) · 1.61 KB
/
Makefile.BINARIES
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
60
61
62
63
SHELL := $(shell which bash)
SELF := $(patsubst %/,%,$(dir $(abspath $(firstword $(MAKEFILE_LIST)))))
PACKER_VERSION ?= 1.11.2
TERRAFORM_VERSION ?= 1.9.8
TERRAGRUNT_VERSION ?= v0.68.14
TARGETS = \
$(SELF)/bin/OVMF.fd \
$(SELF)/bin/OVMF_CODE.fd \
$(SELF)/bin/OVMF_VARS.fd \
$(SELF)/bin/packer \
$(SELF)/bin/terraform \
$(SELF)/bin/terragrunt
define HASHICORP_RELEASE_INSTALL
$(SELF)/bin/$(1): $(SELF)/bin/$(1)-$(2)
rm -f $$@ && ln -s $$< $$@
$(SELF)/bin/$(1)-$(2):
install -d /tmp/$(1)-$(2)/ \
&& curl -fSL https://releases.hashicorp.com/$(1)/$(2)/$(1)_$(2)_linux_amd64.zip \
-o /tmp/$(1)-$(2)/download.zip \
&& unzip -o -d /tmp/$(1)-$(2)/ /tmp/$(1)-$(2)/download.zip \
&& mv /tmp/$(1)-$(2)/$(1)* $$@ \
&& rm -rf /tmp/$(1)-$(2)/ \
&& chmod +x $$@
endef
define GITHUB_RELEASE_INSTALL
$(SELF)/bin/$(2): $(SELF)/bin/$(2)-$(3)
rm -f $$@ && ln -s $$< $$@
$(SELF)/bin/$(2)-$(3):
curl -fSL https://github.com/$(1)/$(2)/releases/download/$(3)/$(2)_linux_amd64 \
-o $$@ \
&& chmod +x $$@
endef
export
.PHONY: all clean
all: $(TARGETS)
clean:
-rm -f $(TARGETS)
$(SELF)/bin/OVMF.fd:
curl -fsSL -o $@ https://retrage.github.io/edk2-nightly/bin/RELEASEX64_OVMF.fd
$(SELF)/bin/OVMF_CODE.fd:
curl -fsSL -o $@ https://retrage.github.io/edk2-nightly/bin/RELEASEX64_OVMF_CODE.fd
$(SELF)/bin/OVMF_VARS.fd:
curl -fsSL -o $@ https://retrage.github.io/edk2-nightly/bin/RELEASEX64_OVMF_VARS.fd
$(eval \
$(call HASHICORP_RELEASE_INSTALL,packer,$(PACKER_VERSION)))
$(eval \
$(call HASHICORP_RELEASE_INSTALL,terraform,$(TERRAFORM_VERSION)))
$(eval \
$(call GITHUB_RELEASE_INSTALL,gruntwork-io,terragrunt,$(TERRAGRUNT_VERSION)))