From patchwork Thu Dec 11 13:11:53 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joonas Lahtinen X-Patchwork-Id: 5475981 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 58C9BBEEA8 for ; Thu, 11 Dec 2014 13:13:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8042A2017D for ; Thu, 11 Dec 2014 13:13:39 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 842E220173 for ; Thu, 11 Dec 2014 13:13:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2932D6E823; Thu, 11 Dec 2014 05:13:38 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTP id E994B6E823 for ; Thu, 11 Dec 2014 05:13:35 -0800 (PST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 11 Dec 2014 05:11:55 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.07,557,1413270000"; d="scan'208";a="636113803" Received: from jlahtine-mobl1.ger.corp.intel.com (HELO [10.252.7.54]) ([10.252.7.54]) by fmsmga001.fm.intel.com with ESMTP; 11 Dec 2014 05:11:53 -0800 Message-ID: <1418303513.2867.4.camel@jlahtine-mobl1.ger.corp.intel.com> From: Joonas Lahtinen To: intel-gfx@lists.freedesktop.org Date: Thu, 11 Dec 2014 15:11:53 +0200 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Mailer: Evolution 3.10.4 (3.10.4-4.fc20) Mime-Version: 1.0 Cc: Thomas Wood Subject: [Intel-gfx] lib: Fix out of tree build of version.h X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 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 --- 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