From 0a860338567d2c8b8425fa968fe0fd1bb60922b7 Mon Sep 17 00:00:00 2001 From: Andrew Cady Date: Thu, 28 May 2020 20:14:35 -0400 Subject: auto-upgrade submodules It only does this if git is clean. --- Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 063a4c2..d341da5 100644 --- a/Makefile +++ b/Makefile @@ -140,9 +140,11 @@ endif include user.mk +UPGRADE_SUBMODULES = $(shell a=$$(git status -uno -s) && [ -z "$$a" ] && echo y) + .PHONY: submodule $(SUBMODULES) $(SUBMODULES): stack - [ -e $@/Makefile ] || git submodule update --init + $(if $(UPGRADE_SUBMODULES),, [ -e $@/Makefile ] ||) git submodule update --init $(MAKE) -C $@ $(cmd) install-submodules: cmd=install -- cgit v1.2.3