-
-INITRAMFSIMG = initramfs.$(REPO).$(host_cpu).img
-VMLINUZ = vmlinuz.$(REPO).$(host_cpu)
-
-fs_DATA = $(INITRAMFSIMG) $(VMLINUZ)
-
-$(INITRAMFSIMG) $(VMLINUZ): $(top_builddir)/initramfs/fakeroot.log
-
-$(top_builddir)/initramfs/fakeroot.log: make-initramfs.sh.in
- -mv $(INITRAMFSIMG) $(INITRAMFSIMG).bak
- -mv $(VMLINUZ) $(VMLINUZ).bak
- if ! bash make-initramfs.sh; then rm -f $@; exit 1; fi
-
-$(INITRAMFSIMG): $(top_builddir)/initramfs/fakeroot.log $(top_builddir)/daemon/guestfsd
- rm -f $@
- bash update-initramfs.sh
+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 $@
+
+packagelist: packagelist.in
+ cpp -undef -D$(DISTRO)=1 < $< | \
+ grep -v '^[[:space:]]*$$' | grep -v '^#' > $@-t
+ mv $@-t $@
+
+excludelist: excludelist.in
+ cpp -undef -D$(DISTRO)=1 < $< | \
+ grep -v '^[[:space:]]*$$' | grep -v '^#' > $@-t
+ mv $@-t $@
+
+supermin.d/base.img supermin.d/hostfiles: stamp-supermin
+stamp-supermin: make.sh packagelist excludelist
+ mkdir -p supermin.d
+ rm -f $@ supermin.d/base.img supermin.d/hostfiles
+ ./make.sh