forked from confidential-containers/cloud-api-adaptor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.defaults
43 lines (36 loc) · 2.24 KB
/
Makefile.defaults
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
YQ_COMMAND ?= yq
VERSIONS_SRC := $(abspath $(dir $(lastword $(MAKEFILE_LIST))))/versions.yaml
ifeq (, $(shell command -v $(YQ_COMMAND) 2> /dev/null))
$(error "$(YQ_COMMAND) not found, consider doing snap install yq")
endif
YQ_MAJOR_VERSION := $(shell $(YQ_COMMAND) --version | sed -nE 's/.* v?([0-9]+).*/\1/p')
ifneq (4, $(YQ_MAJOR_VERSION))
$(error "yq major version should be 4, is: $(YQ_MAJOR_VERSION)")
endif
define query
$(or $(shell $(YQ_COMMAND) '.$(1) | select(. != null)' $(VERSIONS_SRC)), \
$(error $(1) is not set, and could not be automatically set from $(VERSIONS_SRC)))
endef
ubuntu_RELEASE ?= focal
centos_RELEASE ?= stream-8
ubuntu_amd64_IMAGE_URL := $(call query,cloudimg.ubuntu.$(ubuntu_RELEASE).amd64.url)
ubuntu_amd64_IMAGE_CHECKSUM := $(call query,cloudimg.ubuntu.$(ubuntu_RELEASE).amd64.checksum)
ubuntu_s390x_IMAGE_URL := $(call query,cloudimg.ubuntu.$(ubuntu_RELEASE).s390x.url)
ubuntu_s390x_IMAGE_CHECKSUM := $(call query,cloudimg.ubuntu.$(ubuntu_RELEASE).s390x.checksum)
centos_amd64_IMAGE_URL := $(call query,cloudimg.centos.$(centos_RELEASE).amd64.url)
centos_amd64_IMAGE_CHECKSUM := $(call query,cloudimg.centos.$(centos_RELEASE).amd64.checksum)
CAA_SRC := $(or $(CAA_SRC),$(call query,git.cloud-api-adaptor.url))
CAA_SRC_REF := $(or $(CAA_SRC_REF),$(call query,git.cloud-api-adaptor.reference))
KATA_SRC := $(or $(KATA_SRC),$(call query,git.kata-containers.url))
KATA_SRC_REF := $(or $(KATA_SRC_REF),$(call query,git.kata-containers.reference))
GO_VERSION := $(or $(GO_VERSION),$(call query,tools.golang))
PROTOC_VERSION := $(or $(PROTOC_VERSION),$(call query,tools.protoc))
RUST_VERSION := $(or $(RUST_VERSION),$(call query,tools.rust))
SKOPEO_REPO := $(or $(SKOPEO_REPO),$(call query,git.skopeo.url))
SKOPEO_VERSION := $(or $(SKOPEO_VERSION),$(call query,git.skopeo.reference))
UMOCI_REPO := $(or $(UMOCI_REPO),$(call query,git.umoci.url))
UMOCI_VERSION := $(or $(UMOCI_VERSION),$(call query,git.umoci.reference))
GUEST_COMPONENTS_REPO := $(or $(GUEST_COMPONENTS_REPO),$(call query,git.guest-components.url))
GUEST_COMPONENTS_VERSION := $(or $(GUEST_COMPONENTS_VERSION),$(call query,git.guest-components.reference))
PAUSE_REPO := $(or $(PAUSE_REPO),$(call query,oci.pause.registry))
PAUSE_VERSION := $(or $(PAUSE_VERSION),$(call query,oci.pause.tag))