summaryrefslogtreecommitdiff
path: root/rootfs
diff options
context:
space:
mode:
authorGordon GECOS <u@adam>2023-11-22 17:42:07 -0500
committerGordon GECOS <u@adam>2023-11-22 17:46:25 -0500
commit198b40c70815899a67c412e67ffe033b46ec80f0 (patch)
tree180342c55ca6a61d4d1ee8638961d23cfaa57588 /rootfs
parente015b8cbe957a1913f178dc5e4ba166972f79320 (diff)
the cleaner i make it, the cleaner it gets
Diffstat (limited to 'rootfs')
-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 $@