forked from ayufan-rock64/linux-rootfs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
47 lines (37 loc) · 1.14 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
export VERSION ?= 0.1~dev
VARIANTS := $(patsubst configs/%,%,$(wildcard configs/*-*-*))
all: \
$(patsubst %,%-$(VERSION)-armhf.tar.xz,$(VARIANTS)) \
$(patsubst %,%-$(VERSION)-arm64.tar.xz,$(VARIANTS))
info:
@echo $(VARIANTS)
%.xz: %
pxz -f -3 $<
%.tar:
bash build.sh "$@" \
"$(shell basename "$@" -$(VERSION)-$(BUILD_ARCH).tar)" \
"$(BUILD_MODE)" \
"$(BUILD_SUITE)" \
"$(BUILD_ARCH)"
%-armhf.tar.xz: BUILD_ARCH=armhf
%-arm64.tar.xz: BUILD_ARCH=arm64
$(addsuffix -armhf, $(VARIANTS)): %-armhf: %-$(VERSION)-armhf.tar.xz
$(addsuffix -arm64, $(VARIANTS)): %-arm64: %-$(VERSION)-arm64.tar.xz
ubuntu-%.tar.xz: BUILD_MODE=ubuntu
ubuntu-xenial-%.tar.xz: BUILD_SUITE=xenial
debian-%.tar.xz: BUILD_MODE=debian
debian-jessie-%.tar.xz: BUILD_SUITE=jessie
debian-stretch-%.tar.xz: BUILD_SUITE=stretch
.PHONY: shell # run docker shell to build image
shell:
@echo Building environment...
@docker build -q -t rock64-rootfs:build-environment environment/
@echo Entering shell...
@docker run --rm \
-it \
-e HOME -v $(HOME):$(HOME) \
--privileged \
-h rock64-build-env \
-v $(CURDIR):$(CURDIR) \
-w $(CURDIR) \
rock64-rootfs:build-environment