-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMakefile
32 lines (23 loc) · 900 Bytes
/
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
export VERSION ?= 0.1~dev
VARIANTS := $(patsubst configs/%,%,$(wildcard configs/*-*-*))
ARCHS := arm64
TARGETS := $(foreach arch,$(ARCHS),$(patsubst %,%-$(VERSION)-$(arch).tar.xz,$(VARIANTS)))
all: $(TARGETS)
keyring:
bash -c 'dpkg -s ubuntu-keyring &>/dev/null || \
( wget -c http://mirrors.kernel.org/ubuntu/pool/main/u/ubuntu-keyring/ubuntu-keyring_2021.03.26_all.deb && \
dpkg -i ubuntu-keyring_2021.03.26_all.deb && \
rm ubuntu-keyring_2021.03.26_all.deb )'
info:
@echo $(VARIANTS)
targets:
@echo $(TARGETS)
%.xz: %
xz -T 0 -f -3 $<
%.tar:
eatmydata -- bash build.sh "$@" \
"$(word 1,$(subst -, , $@))-$(word 2,$(subst -, , $@))-$(word 3,$(subst -, , $@))" \
"$(word 1,$(subst -, , $@))" \
"$(word 2,$(subst -, , $@))" \
"$(lastword $(subst -, , $(basename $@)))"
$(foreach arch,$(ARCHS),$(addsuffix -$(arch), $(VARIANTS)): %-$(arch): %-$(VERSION)-$(arch).tar.xz)