From d4d1707fce3e158a8a982c044395e6b49cedcb40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20G=2E=20Aragoneses?= Date: Mon, 9 May 2016 20:15:54 +0800 Subject: [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 ``` --- Makefile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index b40350491f..c13049636e 100644 --- a/Makefile +++ b/Makefile @@ -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 -- cgit v1.2.3