[RFC,kvm-unit-tests,2/8] Makefile: ensure build-head works out-of-src-tree

Message ID 20170406190727.5624-3-alex.bennee@linaro.org
State New
Headers show

Commit Message

Alex Bennée April 6, 2017, 7:07 p.m.
Pass -C $(SRCDIR) to the git command that generates the build-head
stamp.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Andrew Jones April 7, 2017, 11:44 a.m. | #1
On Thu, Apr 06, 2017 at 08:07:21PM +0100, Alex Bennée wrote:
> Pass -C $(SRCDIR) to the git command that generates the build-head
> stamp.
> 
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> ---
>  Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Makefile b/Makefile
> index 16ce297..eba7b28 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -80,7 +80,7 @@ $(LIBFDT_archive): $(addprefix $(LIBFDT_objdir)/,$(LIBFDT_OBJS))
>  
>  -include */.*.d */*/.*.d
>  
> -all: $(shell git rev-parse --verify --short=8 HEAD >build-head 2>/dev/null)
> +all: $(shell git -C $(SRCDIR) rev-parse --verify --short=8 HEAD >build-head 2>/dev/null)
>  
>  standalone: all
>  	@scripts/mkstandalone.sh
> -- 
> 2.11.0
>

Reviewed-by: Andrew Jones <drjones@redhat.com>

Patch

diff --git a/Makefile b/Makefile
index 16ce297..eba7b28 100644
--- a/Makefile
+++ b/Makefile
@@ -80,7 +80,7 @@  $(LIBFDT_archive): $(addprefix $(LIBFDT_objdir)/,$(LIBFDT_OBJS))
 
 -include */.*.d */*/.*.d
 
-all: $(shell git rev-parse --verify --short=8 HEAD >build-head 2>/dev/null)
+all: $(shell git -C $(SRCDIR) rev-parse --verify --short=8 HEAD >build-head 2>/dev/null)
 
 standalone: all
 	@scripts/mkstandalone.sh