diff options
author | Andrés G. Aragoneses <knocte@gmail.com> | 2016-05-09 15:15:54 +0300 |
---|---|---|
committer | Andrés G. Aragoneses <knocte@gmail.com> | 2016-05-09 15:15:54 +0300 |
commit | d4d1707fce3e158a8a982c044395e6b49cedcb40 (patch) | |
tree | a42f0e1a0206b5399e42306f18ce88477422ed57 | |
parent | ef279bca6d62873e8e50e6f251b533ad4f761155 (diff) |
[build] Bail out early if `git` is not installed
Otherwise typing `make` would fail with this error:
```
$ make
if test -d ".git"; then \
git submodule sync; \
git submodule update --init --recursive || exit 1; \
fi
/bin/sh: 2: git: not found
/bin/sh: 3: git: not found
Makefile:12: recipe for target 'update_submodules' failed
make: *** [update_submodules] Error 1
```
-rw-r--r-- | Makefile | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -8,12 +8,20 @@ MONO_AOT:=MONO_PATH=$(AOT_DIRECTORIES):$(MONO_PATH) mono --aot --debug all: update_submodules all-recursive -update_submodules: +GIT_FOUND = $$(echo $$(which git)) +SYNC_SUBMODULES = \ if test -d ".git"; then \ + if [ "x$(GIT_FOUND)" = "x" ]; then \ + echo "git not found; please install it first"; \ + exit 1; \ + fi; \ git submodule sync; \ git submodule update --init --recursive || exit 1; \ fi +update_submodules: + @$(SYNC_SUBMODULES) + top_srcdir=. include $(top_srcdir)/config.make |