From 0e150116f33d8111520861b6758b4ca675cb0621 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Mon, 31 Oct 2011 18:19:40 -0700 Subject: [PATCH] Reconfigure when the git submodule status changes --- Makefile.in | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Makefile.in b/Makefile.in index ebc7d4a1f07..477e97b71e7 100644 --- a/Makefile.in +++ b/Makefile.in @@ -318,6 +318,17 @@ endif # Re-configuration ###################################################################### +# This is a pretty expensive operation but I don't see any way to avoid it +SUBMODULE_STATUS=$(shell cd "$(CFG_SRC_DIR)" && "$(CFG_GIT)" submodule status) +# Look through for submodules prefixed with '-' (need init), or '+' (need update) +NEED_GIT_RECONFIG=$(shell echo "$(SUBMODULE_STATUS)" | grep -c '^\(+\|-\)') + +ifeq ($(NEED_GIT_RECONFIG),0) +else +# If the submodules have changed then always execute config.mk +.PHONY: config.mk +endif + config.mk: $(S)configure $(S)Makefile.in $(S)src/snapshots.txt @$(call E, cfg: reconfiguring) $(Q)$(S)configure $(CFG_CONFIGURE_ARGS)