diff mbox

lib: Fix out of tree build of version.h

Message ID 1418303497.2867.3.camel@jlahtine-mobl1.ger.corp.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Lahtinen, Joonas Dec. 11, 2014, 1:11 p.m. UTC
Currently out of tree build fails because the version.h.tmp is generated
into the source directory instead of the build directory where it is
later looked for. This commit fixes it.

From 2c0617e21101d69e7219c6660936c0015f93f8ee Mon Sep 17 00:00:00 2001
From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>

Date: Thu, 11 Dec 2014 15:05:11 +0200
Subject: [PATCH] lib: Fix out of tree build of version.h

Write the version.h.tmp file into the build directory instead of source
directory. This allows out of tree building when those two are not the
same.

Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>

---
 lib/Makefile.sources |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

-- 
1.7.9.5
---------------------------------------------------------------------
Intel Finland Oy
Registered Address: PL 281, 00181 Helsinki 
Business Identity Code: 0357606 - 4 
Domiciled in Helsinki 

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

Comments

Joonas Lahtinen Dec. 11, 2014, 2:17 p.m. UTC | #1
This e-mail can be disregarded. It contains no secrets no nothing,
simply sent from wrong address.

On to, 2014-12-11 at 13:11 +0000, Lahtinen, Joonas wrote:
> Currently out of tree build fails because the version.h.tmp is generated
> into the source directory instead of the build directory where it is
> later looked for. This commit fixes it.
> 
> From 2c0617e21101d69e7219c6660936c0015f93f8ee Mon Sep 17 00:00:00 2001
> From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Date: Thu, 11 Dec 2014 15:05:11 +0200
> Subject: [PATCH] lib: Fix out of tree build of version.h
> 
> Write the version.h.tmp file into the build directory instead of source
> directory. This allows out of tree building when those two are not the
> same.
> 
> Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> ---
>  lib/Makefile.sources |   12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/lib/Makefile.sources b/lib/Makefile.sources
> index 819b21a..34a3d31 100644
> --- a/lib/Makefile.sources
> +++ b/lib/Makefile.sources
> @@ -55,16 +55,16 @@ libintel_tools_la_SOURCES = 	\
>  $(IGT_LIB_PATH)/version.h.tmp:
>  	@touch $@
>  	@if test -d $(GPU_TOOLS_PATH)/.git; then \
> -		if which git > /dev/null 2>&1; then cd $(@D); \
> +		if which git > /dev/null 2>&1; then \
> +			cd $(GPU_TOOLS_PATH); \
>  			git log -n 1 --oneline | \
> -			sed 's/^\([^ ]*\) .*/#define IGT_GIT_SHA1 "g\1"/' \
> -			>> $(@F) ; \
> +			sed 's/^\([^ ]*\) .*/#define IGT_GIT_SHA1 "g\1"/' ; \
>  		else \
> -			echo '#define IGT_GIT_SHA1 "NO-GIT"' >> $@ ; \
> +			echo '#define IGT_GIT_SHA1 "NO-GIT"' ; \
>  		fi \
>  	else \
> -		echo '#define IGT_GIT_SHA1 "NOT-GIT"' >> $@ ; \
> -	fi
> +		echo '#define IGT_GIT_SHA1 "NOT-GIT"' ; \
> +	fi >> $@
>  
> 
>  $(IGT_LIB_PATH)/version.h: $(IGT_LIB_PATH)/version.h.tmp
diff mbox

Patch

diff --git a/lib/Makefile.sources b/lib/Makefile.sources
index 819b21a..34a3d31 100644
--- a/lib/Makefile.sources
+++ b/lib/Makefile.sources
@@ -55,16 +55,16 @@  libintel_tools_la_SOURCES = 	\
 $(IGT_LIB_PATH)/version.h.tmp:
 	@touch $@
 	@if test -d $(GPU_TOOLS_PATH)/.git; then \
-		if which git > /dev/null 2>&1; then cd $(@D); \
+		if which git > /dev/null 2>&1; then \
+			cd $(GPU_TOOLS_PATH); \
 			git log -n 1 --oneline | \
-			sed 's/^\([^ ]*\) .*/#define IGT_GIT_SHA1 "g\1"/' \
-			>> $(@F) ; \
+			sed 's/^\([^ ]*\) .*/#define IGT_GIT_SHA1 "g\1"/' ; \
 		else \
-			echo '#define IGT_GIT_SHA1 "NO-GIT"' >> $@ ; \
+			echo '#define IGT_GIT_SHA1 "NO-GIT"' ; \
 		fi \
 	else \
-		echo '#define IGT_GIT_SHA1 "NOT-GIT"' >> $@ ; \
-	fi
+		echo '#define IGT_GIT_SHA1 "NOT-GIT"' ; \
+	fi >> $@
 
 
 $(IGT_LIB_PATH)/version.h: $(IGT_LIB_PATH)/version.h.tmp