diff options
Diffstat (limited to 'rootfs/Makefile')
-rw-r--r-- | rootfs/Makefile | 29 |
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 | ||
7 | sudo := $(shell [ "$$(id -u)" = 0 ] || echo sudo) | 7 | sudo := $(shell [ "$$(id -u)" = 0 ] || echo sudo) |
8 | 8 | ||
9 | rootfs ?= samizdat.seed.btrfs | ||
10 | patchfs ?= 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 |
15 | all: $(rootfs) $(patchfs) | 12 | all: $(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 | ||
20 | clean = $(patchfs) $(rootfs) $(rootfs:%.seed.btrfs=%.btrfs) | ||
21 | clean := $(clean) $(clean:%=%.tmp) | ||
22 | |||
23 | clean: | 20 | clean: |
24 | rm -f $(clean) | 21 | btrfs subvolume delete _build |
25 | cleaner: clean | 22 | cleaner: clean |
26 | -$(sudo) btrfs subvolume delete _filesystem | 23 | -$(sudo) btrfs subvolume delete _filesystem |
27 | 24 | ||
28 | rootfs: $(rootfs) | 25 | _build/%.patch.btrfs: %.seed.btrfs |
29 | patchfs: $(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 $@ | ||