summaryrefslogtreecommitdiff
path: root/rootfs/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'rootfs/Makefile')
-rw-r--r--rootfs/Makefile31
1 files changed, 11 insertions, 20 deletions
diff --git a/rootfs/Makefile b/rootfs/Makefile
index c85132f..017b379 100644
--- a/rootfs/Makefile
+++ b/rootfs/Makefile
@@ -1,32 +1,23 @@
1fsmgr := $(shell command -v fsmgr) 1fsmgr != command -v fsmgr
2
3ifeq ($(fsmgr),) 2ifeq ($(fsmgr),)
4$(error "no fsmgr") 3$(error "no fsmgr")
5endif 4endif
6 5UID != id -u
7sudo := $(shell [ "$$(id -u)" = 0 ] || echo sudo) 6SUDO != [ 0 = "$(UID)" ] || echo sudo
8 7
9.DEFAULT_GOAL = all 8.DEFAULT_GOAL = all
10 9
11.PHONY: all clean cleaner 10.PHONY: all clean cleaner
12all: $(addprefix _filesystem/samizdat., seed.btrfs patch.btrfs) 11all: $(addprefix _filesystem/samizdat., seed.btrfs patch.btrfs)
13 12
14_build/%: _build 13subvolumes = _build _filesystem
15_filesystem/%: _filesystem 14$(subvolumes):
16 15 $(SUDO) btrfs subvolume create $@
17_build _filesystem:
18 $(sudo) btrfs subvolume create $@
19 16
20clean: 17clean:
21 btrfs subvolume delete _build 18 -$(SUDO) btrfs subvolume delete _build
22cleaner: clean 19destroy: clean
23 -$(sudo) btrfs subvolume delete _filesystem 20 -$(SUDO) btrfs subvolume delete _filesystem
24
25_build/%.patch.btrfs: %.seed.btrfs
26
27_build/%.seed.btrfs: %.btrfs
28
29_filesystem/%.btrfs: _build/%.btrfs
30 21
31%.btrfs: 22%.btrfs: | $(subvolumes)
32 $(sudo) $(fsmgr) build $@ 23 $(SUDO) $(fsmgr) build $@