summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2012-07-18 10:03:29 +0100
committerRichard W.M. Jones <rjones@redhat.com>2012-07-18 10:03:29 +0100
commitb25aea33fa314857c8094e09af9654f925fb935f (patch)
treeddddf9c2e8f83c328b2e68c02c7b72e5641c70cd
parent87206e4e9e3b0ca813a4ff7b5fac0eccc07a484a (diff)
downloadlibguestfs-b25aea33fa314857c8094e09af9654f925fb935f.tar.gz
libguestfs-b25aea33fa314857c8094e09af9654f925fb935f.tar.xz
libguestfs-b25aea33fa314857c8094e09af9654f925fb935f.zip
build: Change how make.sh, packagelist, excludelist are updated.
Add proper dependencies for these files, but also use 'cmp' to ensure they only get overwritten if the new files have actually changed, so we don't rebuild the appliance unnecessarily.
-rw-r--r--appliance/Makefile.am15
1 files changed, 9 insertions, 6 deletions
diff --git a/appliance/Makefile.am b/appliance/Makefile.am
index 0a9f7ae3..f106921d 100644
--- a/appliance/Makefile.am
+++ b/appliance/Makefile.am
@@ -42,26 +42,29 @@ superminfs_DATA = \
# 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
+make.sh: make.sh.in $(top_builddir)/config.log $(top_builddir)/config.status
cd $(top_builddir) && \
./config.status --file=appliance/$@-t:appliance/$<
chmod +x $@-t
- mv $@-t $@
+ cmp -s $@ $@-t || mv $@-t $@
+ rm -f $@-t
PACKAGELIST_CPP_FLAGS = -D$(DISTRO)=1
if VALGRIND_DAEMON
PACKAGELIST_CPP_FLAGS += -DVALGRIND_DAEMON=1
endif
-packagelist: packagelist.in
+packagelist: packagelist.in Makefile
cpp -undef $(PACKAGELIST_CPP_FLAGS) < $< | \
grep -v '^[[:space:]]*$$' | grep -v '^#' > $@-t
- mv $@-t $@
+ cmp -s $@ $@-t || mv $@-t $@
+ rm -f $@-t
-excludelist: excludelist.in
+excludelist: excludelist.in Makefile
cpp -undef $(PACKAGELIST_CPP_FLAGS) < $< | \
grep -v '^[[:space:]]*$$' | grep -v '^#' > $@-t
- mv $@-t $@
+ cmp -s $@ $@-t || mv $@-t $@
+ rm -f $@-t
supermin.d/base.img supermin.d/hostfiles: stamp-supermin
stamp-supermin: make.sh packagelist excludelist