diff --git a/.gitignore b/.gitignore index 9bad4ae0..01fad60e 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,8 @@ config.log include/config.h include/config.h.in +stamp-h +stamp-h.in configure config.guess config.status @@ -17,6 +19,8 @@ autom4te.cache aclocal.* *.a config.mak +stamp-mak +stamp-mak.in preload/exported.h preload/ldexportlist preload/wrappers.c diff --git a/Makefile b/Makefile index c0b7faed..e7b0f901 100644 --- a/Makefile +++ b/Makefile @@ -75,15 +75,23 @@ do-all: $(targets) # Don't erase these files if make is interrupted while refreshing them. .PRECIOUS: $(OBJDIR)/config.status .NOTPARALLEL: $(DIST_FILES) -$(DIST_FILES): $(SRCDIR)/configure $(SRCDIR)/config.mak.in +# Use a proxy timestamp file here since config.mak and config.h +# don't update unless their contents change when the dependencies +# that generate them change, avoid repeated rebuilds after changing +# files such as configure.ac e.g. after checking out a new branch +$(DIST_FILES): $(OBJDIR)/stamp-mak +$(OBJDIR)/stamp-mak: $(SRCDIR)/configure $(SRCDIR)/config.mak.in $(OBJDIR)/config.status --recheck + echo > $(OBJDIR)/stamp-mak $(SRCDIR)/configure: $(SRCDIR)/configure.ac cd $(SRCDIR); \ ./autogen.sh -$(OBJDIR)/include/config.h: $(SRCDIR)/include/config.h.in $(OBJDIR)/config.status - $(OBJDIR)/config.status config.h +$(OBJDDIR)/include/config.h: $(OBJDIR)/stamp-h +$(OBJDIR)/stamp-h: $(SRCDIR)/include/config.h.in $(OBJDIR)/config.status + $(OBJDIR)/config.status include/config.h + echo > $(OBJDIR)/stamp-h $(OBJDIR)/include/scratchbox2_version.h: $(OBJDIR)/config.mak mkdir -p $(OBJDIR)/include @@ -209,9 +217,11 @@ ifeq ($(OS),Linux) endif CLEAN_FILES += $(targets) \ + $(SRCDIR)/stamp-h \ $(OBJDIR)/include/config.h \ $(OBJDIR)/include/scratchbox2_version.h DISTCLEAN_FILES += $(DIST_FILES) \ + $(OBJDIR)/stamp-mak \ $(OBJDIR)/config.log \ $(SRCDIR)/configure \ $(SRCDIR)/include/config.h.in diff --git a/autogen.sh b/autogen.sh index efa70cb9..decd64e5 100755 --- a/autogen.sh +++ b/autogen.sh @@ -4,3 +4,6 @@ rm -rf configure autom4te.cache autoreconf --verbose --force --install + +echo > stamp-h.in +echo > stamp-mak.in diff --git a/configure.ac b/configure.ac index e5c51b3f..1b6015a6 100644 --- a/configure.ac +++ b/configure.ac @@ -15,6 +15,9 @@ AC_CONFIG_AUX_DIR([build-aux]) #AC_CONFIG_SRCDIR([src/libfakechroot.c]) AC_CONFIG_HEADERS([include/config.h]) AC_CONFIG_FILES([config.mak]) +dnl Generate timestamp so that configure output files timestamps are in sync +AC_CONFIG_FILES([stamp-h], [echo timestamp > stamp-h]) +AC_CONFIG_FILES([stamp-mak], [echo timestamp > stamp-mak]) AC_PROG_CC AC_PROG_CXX