summaryrefslogtreecommitdiff
path: root/rootfs/Makefile
blob: 9e4e15a94df5e759dccf45ba520fefd866702cb2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
fsmgr := $(shell which fsmgr)

ifeq ($(fsmgr),)
$(error "no fsmgr")
endif

sudo := $(shell [ "$$(id -u)" = 0 ] || echo sudo)

rootfs ?= samizdat.btrfs
patchfs ?= samizdat.patch.btrfs

.PHONY: all rootfs patchfs
all: rootfs $(ifneq $(patchfs),,patchfs)

rootfs $(rootfs):
	$(sudo) $(fsmgr) build $(rootfs)
patchfs $(patchfs): $(rootfs)
	$(sudo) $(fsmgr) build $(patchfs)