[libvirt] [PATCH] build: avoid autogen on 'make clean'

Eric Blake eblake at redhat.com
Tue Apr 6 19:22:50 UTC 2010

Tested by running 'git submodule foreach git pull origin master',
then seeing that 'make clean' skips autogen although 'make'
properly runs it.

* cfg.mk (_clean_requested): New check, to speed up 'make clean'
even if gnulib submodule is outdated.
Suggested by Daniel P. Berrange.
 cfg.mk |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/cfg.mk b/cfg.mk
index 70465c3..f422a53 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -301,7 +301,8 @@ ifeq (0,$(MAKELEVEL))
 		git diff .gnulib);					\
       stamp="$$($(_submodule_hash) $(_curr_status) 2>/dev/null)";	\
       test "$$stamp" = "$$actual"; echo $$?)
-  ifeq (1,$(_update_required))
+  _clean_requested = $(filter %clean,$(MAKECMDGOALS))
+  ifeq (1,$(_update_required)$(_clean_requested))
     $(info INFO: gnulib update required; running ./autogen.sh first)
 Makefile: _autogen

More information about the libvir-list mailing list