forked from bottlerocket-os/bottlerocket-core-kit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
52 lines (40 loc) · 1.37 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
TOP := $(dir $(abspath $(firstword $(MAKEFILE_LIST))))
TOOLS_DIR := $(TOP)tools
TWOLITER_DIR := $(TOOLS_DIR)/twoliter
TWOLITER := $(TWOLITER_DIR)/twoliter
CARGO_HOME := $(TOP).cargo
TWOLITER_VERSION ?= "0.4.1"
KIT ?= bottlerocket-core-kit
ARCH ?= $(shell uname -m)
VENDOR ?= bottlerocket
export GO_MODULES = ecs-gpu-init host-ctr
all: build
prep:
@mkdir -p $(TWOLITER_DIR)
@mkdir -p $(CARGO_HOME)
@$(TOOLS_DIR)/install-twoliter.sh \
--repo "https://github.com/bottlerocket-os/twoliter" \
--version v$(TWOLITER_VERSION) \
--directory $(TWOLITER_DIR) \
--reuse-existing-install \
--allow-binary-install \
--allow-from-source
update: prep
@$(TWOLITER) update
fetch: prep
@$(TWOLITER) fetch --arch $(ARCH)
build: fetch
@$(TWOLITER) build kit $(KIT) --arch $(ARCH)
publish: prep
@$(TWOLITER) publish kit $(KIT) $(VENDOR)
TWOLITER_MAKE = $(TWOLITER) make --cargo-home $(CARGO_HOME) --arch $(ARCH)
# Treat any targets after "make twoliter" as arguments to "twoliter make".
ifeq (twoliter,$(firstword $(MAKECMDGOALS)))
TWOLITER_MAKE_ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
$(eval $(TWOLITER_MAKE_ARGS):;@:)
endif
# Transform "make twoliter" into "twoliter make", for access to tasks that are
# only available through the embedded Makefile.toml.
twoliter: prep
@$(TWOLITER_MAKE) $(TWOLITER_MAKE_ARGS)
.PHONY: prep update fetch build publish twoliter