From e25644b4d573deee46bb520ce2a0d9493cbbcfd8 Mon Sep 17 00:00:00 2001 From: Joel Stanley Date: Wed, 13 Aug 2014 15:19:05 +1000 Subject: Fix gitid generation when not in a git repository If skiboot doesn't live in a git repository, the makefile will go searching up the directory tree for one. To save confusion, only look in the source tree for the git repository. The gitid can be overridden by passing GIT_SHA=foo as an argument to make. This is useful for doing builds outside of a git tree, as buildroot does. Signed-off-by: Joel Stanley Signed-off-by: Benjamin Herrenschmidt --- Makefile.main | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Makefile.main') diff --git a/Makefile.main b/Makefile.main index 68a3807..599372a 100644 --- a/Makefile.main +++ b/Makefile.main @@ -128,8 +128,10 @@ $(SUBDIRS): # Set V=1 if you want to see everything. include $(SRC)/Makefile.rules +GIT_SHA ?= $(shell cd $(SRC); GIT_DIR=$(SRC)/.git git describe --always --dirty 2> /dev/null) + gitid.c: - @echo "const char gitid[] = \"`cd $(SRC); git describe --always --dirty`\";" > $@ + @echo "const char gitid[] = \"$(GIT_SHA)\";" > $@ include $(shell find $(SRC)/* -name Makefile.check) -- cgit v1.1