fsmgr := $(shell which fsmgr) ifeq ($(fsmgr),) $(error "no fsmgr") endif sudo := $(shell [ "$$(id -u)" = 0 ] || echo sudo) rootfs ?= samizdat.seed.btrfs patchfs ?= samizdat.patch.btrfs # gold ?= samizdat-gold.btrfs .DEFAULT_GOAL = all .PHONY: all rootfs patchfs gold all: $(rootfs) $(patchfs) $(gold) clean: rm -f $(rootfs) $(patchfs) $(gold) rootfs: $(rootfs) patchfs: $(patchfs) gold: $(gold) %.patch.btrfs: %.seed.btrfs $(sudo) $(fsmgr) build $@ %.seed.btrfs: %.btrfs $(sudo) $(fsmgr) build $@ %.btrfs: $(sudo) $(fsmgr) build $@ $(gold): $(rootfs) $(sudo) $(fsmgr) build $@ $(patchfs): $(rootfs) $(patchfs) $(rootfs): $(sudo) REWRITE_SOURCES_LIST=y $(fsmgr) build $@