Skip to content

Commit 0e15011

Browse files
committed
Reconfigure when the git submodule status changes
1 parent f96f169 commit 0e15011

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Makefile.in

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,17 @@ endif
318318
# Re-configuration
319319
######################################################################
320320

321+
# This is a pretty expensive operation but I don't see any way to avoid it
322+
SUBMODULE_STATUS=$(shell cd "$(CFG_SRC_DIR)" && "$(CFG_GIT)" submodule status)
323+
# Look through for submodules prefixed with '-' (need init), or '+' (need update)
324+
NEED_GIT_RECONFIG=$(shell echo "$(SUBMODULE_STATUS)" | grep -c '^\(+\|-\)')
325+
326+
ifeq ($(NEED_GIT_RECONFIG),0)
327+
else
328+
# If the submodules have changed then always execute config.mk
329+
.PHONY: config.mk
330+
endif
331+
321332
config.mk: $(S)configure $(S)Makefile.in $(S)src/snapshots.txt
322333
@$(call E, cfg: reconfiguring)
323334
$(Q)$(S)configure $(CFG_CONFIGURE_ARGS)

0 commit comments

Comments
 (0)