-fs_DATA = $(APPLIANCE_FILES)
-
-# These are the resulting output files from the whole process:
-# VMLINUZ kernel for the full appliance
-# INITRAMFSIMG initramfs (ie. root fs) for the full appliance
-# For details of the supermin appliance, read the README file:
-# SUPERMINIMG initramfs (ie. partial root fs) for the supermin appliance
-# SUPERMINFILES list of missing files (the ones we will pull out of the
-# host filesystem at runtime) in the supermin appliance
-APPLIANCE_FILES = $(INITRAMFSIMG) $(VMLINUZ)
-if SUPERMIN
-APPLIANCE_FILES += $(SUPERMINIMG) $(SUPERMINFILES) kmod.whitelist
-bin_SCRIPTS = libguestfs-supermin-helper
-endif
-
-# Don't change these names - they must be the same as in '*.sh' scripts.
-INITRAMFSIMG = initramfs.$(REPO).$(host_cpu).img
-VMLINUZ = vmlinuz.$(REPO).$(host_cpu)
-if SUPERMIN
-SUPERMINIMG = initramfs.$(REPO).$(host_cpu).supermin.img
-SUPERMINFILES = initramfs.$(REPO).$(host_cpu).supermin.hostfiles
-endif
-
-# This is for building the normal appliance:
-$(INITRAMFSIMG) $(VMLINUZ): $(top_builddir)/initramfs/fakeroot.log
-
-$(top_builddir)/initramfs/fakeroot.log: make.sh kmod.whitelist packagelist init
- -mv $(INITRAMFSIMG) $(INITRAMFSIMG).bak
- -mv $(VMLINUZ) $(VMLINUZ).bak
- if ! bash make.sh; then rm -f $@; exit 1; fi
-
-$(INITRAMFSIMG): $(top_builddir)/initramfs/fakeroot.log $(top_builddir)/daemon/guestfsd update.sh
- rm -f $@
- bash update.sh
- touch $@
-
-kmod.whitelist: kmod.whitelist.in
- grep -v '^[[:space:]]*$$' < $< | grep -v '^#' > $@
+superminfsdir = $(libdir)/guestfs/supermin.d
+
+fs_DATA =
+superminfs_DATA = \
+ supermin.d/base.img \
+ supermin.d/daemon.img \
+ supermin.d/init.img \
+ supermin.d/hostfiles
+
+# This used to be a configure-generated file (as is update.sh still).
+# However config.status always touches the destination file, which
+# means the appliance got rebuilt too often.
+make.sh: make.sh.in
+ cd $(top_builddir) && \
+ ./config.status --file=appliance/$@-t:appliance/$<
+ chmod +x $@-t
+ mv $@-t $@