summaryrefslogtreecommitdiff
path: root/rootfs/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'rootfs/Makefile')
-rw-r--r--rootfs/Makefile29
1 files changed, 9 insertions, 20 deletions
diff --git a/rootfs/Makefile b/rootfs/Makefile
index ef2921e..c85132f 100644
--- a/rootfs/Makefile
+++ b/rootfs/Makefile
@@ -6,38 +6,27 @@ endif
6 6
7sudo := $(shell [ "$$(id -u)" = 0 ] || echo sudo) 7sudo := $(shell [ "$$(id -u)" = 0 ] || echo sudo)
8 8
9rootfs ?= samizdat.seed.btrfs
10patchfs ?= samizdat.patch.btrfs
11
12.DEFAULT_GOAL = all 9.DEFAULT_GOAL = all
13 10
14.PHONY: all rootfs patchfs clean cleaner 11.PHONY: all clean cleaner
15all: $(rootfs) $(patchfs) 12all: $(addprefix _filesystem/samizdat., seed.btrfs patch.btrfs)
13
14_build/%: _build
15_filesystem/%: _filesystem
16 16
17_build _filesystem: 17_build _filesystem:
18 $(sudo) btrfs subvolume create $@ 18 $(sudo) btrfs subvolume create $@
19 19
20clean = $(patchfs) $(rootfs) $(rootfs:%.seed.btrfs=%.btrfs)
21clean := $(clean) $(clean:%=%.tmp)
22
23clean: 20clean:
24 rm -f $(clean) 21 btrfs subvolume delete _build
25cleaner: clean 22cleaner: clean
26 -$(sudo) btrfs subvolume delete _filesystem 23 -$(sudo) btrfs subvolume delete _filesystem
27 24
28rootfs: $(rootfs) 25_build/%.patch.btrfs: %.seed.btrfs
29patchfs: $(patchfs)
30 26
31%.patch.btrfs: %.seed.btrfs 27_build/%.seed.btrfs: %.btrfs
32 $(sudo) $(fsmgr) build $@
33 28
34%.seed.btrfs: %.btrfs 29_filesystem/%.btrfs: _build/%.btrfs
35 $(sudo) $(fsmgr) build $@
36 30
37%.btrfs: 31%.btrfs:
38 $(sudo) $(fsmgr) build $@ 32 $(sudo) $(fsmgr) build $@
39
40$(patchfs): $(rootfs)
41
42$(patchfs) $(rootfs):
43 $(sudo) REWRITE_SOURCES_LIST=y $(fsmgr) build $@