-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
51 lines (35 loc) · 947 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
MY_ARCH != uname -m
ARCH ?= $(MY_ARCH)
MIRROR := http://dl-cdn.alpinelinux.org/alpine/latest-stable
STATICAPKDIR := apk-tools
CACHEDIR := .cache
DISKDIR := disks
ROOTDIR ?= mnt
OVERLAYDIR := rootfs
STATICAPK_VERSION := 2.6.8-r2
STATICAPK := $(STATICAPKDIR)/sbin/apk.static
DISKIMG := $(DISKDIR)/disk-$(ARCH).raw
DISKSIZE := 8
.PHONY: all clean dist-clean bootstrap mount umount chroot run sync
all: bootstrap
clean: umount
rm -f $(DISKIMG)
dist-clean: clean
rm -rf $(STATICAPKDIR)
sudo rm -rf $(CACHEDIR)/*
mount: | $(CACHEDIR) $(ROOTDIR) $(DISKIMG)
tools/mount $(DISKIMG) $(ROOTDIR) $(CACHEDIR)
umount:
tools/umount $(DISKIMG) $(ROOTDIR)
chroot: | mount $(ROOTDIR)/bin/ash
tools/chroot $(ROOTDIR)
run: | bootstrap umount $(DISKIMG)
tools/run $(DISKIMG)
sync: | mount $(STATICAPK)
tools/sync_overlay $(ROOTDIR) $(OVERLAYDIR) $(STATICAPK)
$(ROOTDIR):
mkdir $@
$(CACHEDIR):
mkdir $@
chmod g+ws $@
include Makefile.d/*.mak