Skip to content

Commit

Permalink
Check the git command before setting TOPDIR
Browse files Browse the repository at this point in the history
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 <glin@suse.com>
  • Loading branch information
lcp authored and vathpela committed Sep 28, 2020
1 parent 6bf6dca commit 4b346d1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Makefile
Expand Up @@ -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

Expand Down

0 comments on commit 4b346d1

Please sign in to comment.