-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
79 lines (57 loc) · 1.29 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
export DOCKER_BUILDKIT := 1
export DOCKER_BUILDKIT
SHELL := /usr/bin/env bash
DOCKER_BUILDX ?= docker buildx
ifeq ($(V), 1)
PROGRESS := --progress=plain
endif
export V
OUTPUT ?= $(CURDIR)/bundles
export OUTPUT
COMPONENT_TARGETS = $(wildcard moby-*)
all:
docker buildx bake all
.PHONY: clean
clean:
if [ -n "$(DISTRO)" ]; then \
$(MAKE) -C tests clean DISTRO=$(DISTRO); \
rm -rf $(OUTPUT)/$(DISTRO); \
else \
$(MAKE) -C tests clean; \
rm -rf {bin,bundles}; \
fi
.PHONY: $(COMPONENT_TARGETS)
ifdef CROSS
export CROSS
endif
ifdef TARGETARCH
export TARGETARCH
endif
ifdef GO_IMAGE
export GO_IMAGE
endif
ifdef BUILDKIT_MULTI_PLATFORM
export BUILDKIT_MULTI_PLATFORM
endif
ifdef TARGETARCH
export TARGETARCH
endif
PULL ?= true
$(COMPONENT_TARGETS):
if [ "$(UPDATE)" = "1" ]; then (cd $@ && ./update.sh); fi
$(DOCKER_BUILDX) bake $(PROGRESS) $@
_LOCAL_PKG_DIR := $(OUTPUT)/$(DISTRO)
ifneq ($(wildcard $(_LOCAL_PKG_DIR)/linux_*),)
_LOCAL_PKG_DIR := $(wildcard $(_LOCAL_PKG_DIR)/linux_*)
endif
ifneq ($(wildcard $(_LOCAL_PKG_DIR)/*),)
export LOCAL_PKG_DIR ?= $(_LOCAL_PKG_DIR)
endif
.PHONY: test
test:
$(MAKE) -s -C tests test DISTRO=$(DISTRO) LOCAL_PKG_DIR=$(LOCAL_PKG_DIR)
.PHONY: test/%
test/%:
$(MAKE) -s -C tests $* DISTRO=$(DISTRO) LOCAL_PKG_DIR=$(LOCAL_PKG_DIR)
update:
@ ./update.sh