appliance: Don't rebuild the appliance every time configure runs.
authorRichard Jones <rjones@redhat.com>
Fri, 30 Oct 2009 17:11:02 +0000 (17:11 +0000)
committerRichard Jones <rjones@redhat.com>
Mon, 2 Nov 2009 16:36:37 +0000 (16:36 +0000)
config.status touches make.sh each time it runs, even if the
resulting script would not change.  This causes the appliance
to get rebuilt much more frequently than is necessary.

There's no way to stop configure running, but we can move the
config.status command into a Makefile rule to stop this
undesirable behaviour.

appliance/Makefile.am
configure.ac

index d1338bf..1fb7699 100644 (file)
@@ -61,6 +61,15 @@ $(top_builddir)/initramfs/fakeroot.log: make.sh kmod.whitelist packagelist
        mv $(VMLINUZ) $(VMLINUZ).bak 2>/dev/null; :
        if ! bash make.sh; then rm -f $@; exit 1; fi
 
+# 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 $@
+
 $(INITRAMFSIMG): $(top_builddir)/initramfs/fakeroot.log $(top_builddir)/daemon/guestfsd init update.sh
        rm -f $@
        bash update.sh
index b31c193..e11de0c 100644 (file)
@@ -699,8 +699,6 @@ AC_CONFIG_SUBDIRS([daemon])
 dnl Produce output files.
 AC_CONFIG_HEADERS([config.h])
 dnl http://www.mail-archive.com/automake@gnu.org/msg10204.html
-AC_CONFIG_FILES([appliance/make.sh],
-                [chmod +x appliance/make.sh])
 AC_CONFIG_FILES([appliance/update.sh],
                 [chmod +x appliance/update.sh])
 AC_CONFIG_FILES([appliance/supermin-split.sh],