summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2020-05-28 20:14:35 -0400
committerAndrew Cady <d@jerkface.net>2020-05-28 20:19:36 -0400
commit0a860338567d2c8b8425fa968fe0fd1bb60922b7 (patch)
treeeacb9224bbec38db856e0957e2817353fb3398a8
parent227b1458d884f6aa8c0b0c983a9c09baaf7f0297 (diff)
auto-upgrade submodules
It only does this if git is clean.
-rw-r--r--Makefile4
1 files changed, 3 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 063a4c2..d341da5 100644
--- a/Makefile
+++ b/Makefile
@@ -140,9 +140,11 @@ endif
140 140
141include user.mk 141include user.mk
142 142
143UPGRADE_SUBMODULES = $(shell a=$$(git status -uno -s) && [ -z "$$a" ] && echo y)
144
143.PHONY: submodule $(SUBMODULES) 145.PHONY: submodule $(SUBMODULES)
144$(SUBMODULES): stack 146$(SUBMODULES): stack
145 [ -e $@/Makefile ] || git submodule update --init 147 $(if $(UPGRADE_SUBMODULES),, [ -e $@/Makefile ] ||) git submodule update --init
146 $(MAKE) -C $@ $(cmd) 148 $(MAKE) -C $@ $(cmd)
147 149
148install-submodules: cmd=install 150install-submodules: cmd=install