diff options
author | Gordon GECOS <u@adam> | 2023-11-22 17:42:07 -0500 |
---|---|---|
committer | Gordon GECOS <u@adam> | 2023-11-22 17:46:25 -0500 |
commit | 198b40c70815899a67c412e67ffe033b46ec80f0 (patch) | |
tree | 180342c55ca6a61d4d1ee8638961d23cfaa57588 /rootfs | |
parent | e015b8cbe957a1913f178dc5e4ba166972f79320 (diff) |
the cleaner i make it, the cleaner it gets
Diffstat (limited to 'rootfs')
-rw-r--r-- | rootfs/Makefile | 31 |
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 @@ | |||
1 | fsmgr := $(shell command -v fsmgr) | 1 | fsmgr != command -v fsmgr |
2 | |||
3 | ifeq ($(fsmgr),) | 2 | ifeq ($(fsmgr),) |
4 | $(error "no fsmgr") | 3 | $(error "no fsmgr") |
5 | endif | 4 | endif |
6 | 5 | UID != id -u | |
7 | sudo := $(shell [ "$$(id -u)" = 0 ] || echo sudo) | 6 | SUDO != [ 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 |
12 | all: $(addprefix _filesystem/samizdat., seed.btrfs patch.btrfs) | 11 | all: $(addprefix _filesystem/samizdat., seed.btrfs patch.btrfs) |
13 | 12 | ||
14 | _build/%: _build | 13 | subvolumes = _build _filesystem |
15 | _filesystem/%: _filesystem | 14 | $(subvolumes): |
16 | 15 | $(SUDO) btrfs subvolume create $@ | |
17 | _build _filesystem: | ||
18 | $(sudo) btrfs subvolume create $@ | ||
19 | 16 | ||
20 | clean: | 17 | clean: |
21 | btrfs subvolume delete _build | 18 | -$(SUDO) btrfs subvolume delete _build |
22 | cleaner: clean | 19 | destroy: 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 $@ |