From 4b346d1daa0070775a03134b4d2a01028f5510cd Mon Sep 17 00:00:00 2001 From: Gary Lin Date: Thu, 14 May 2020 16:12:26 +0800 Subject: [PATCH] Check the git command before setting TOPDIR Since git doesn't necessarily exist in a build system, skip the git command to avoid the command-not-found warning. Signed-off-by: Gary Lin --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile b/Makefile index f8238e32e..6d1e8ae9f 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,11 @@ EFI_ARCH ?= $(shell $(CC) -dumpmachine | cut -f1 -d- | \ ) ifeq ($(MAKELEVEL),0) +ifneq (, $(shell which git)) TOPDIR != if [ "$$(git rev-parse --is-inside-work-tree)" = true ]; then echo $$(realpath ./$$(git rev-parse --show-cdup)) ; else echo $(PWD) ; fi +else +TOPDIR != echo $(PWD) +endif BUILDDIR ?= $(TOPDIR)/build-$(EFI_ARCH) endif