diff options
author | Andrew Cady <d@jerkface.net> | 2020-05-28 20:14:35 -0400 |
---|---|---|
committer | Andrew Cady <d@jerkface.net> | 2020-05-28 20:19:36 -0400 |
commit | 0a860338567d2c8b8425fa968fe0fd1bb60922b7 (patch) | |
tree | eacb9224bbec38db856e0957e2817353fb3398a8 | |
parent | 227b1458d884f6aa8c0b0c983a9c09baaf7f0297 (diff) |
auto-upgrade submodules
It only does this if git is clean.
-rw-r--r-- | Makefile | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -140,9 +140,11 @@ endif | |||
140 | 140 | ||
141 | include user.mk | 141 | include user.mk |
142 | 142 | ||
143 | UPGRADE_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 | ||
148 | install-submodules: cmd=install | 150 | install-submodules: cmd=install |