From patchwork Fri May 9 12:52:23 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Marek X-Patchwork-Id: 4143061 Return-Path: X-Original-To: patchwork-linux-kbuild@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 DFE30BFF02 for ; Fri, 9 May 2014 12:53:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 270A5201F7 for ; Fri, 9 May 2014 12:53:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4464F2017E for ; Fri, 9 May 2014 12:53:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750712AbaEIMxj (ORCPT ); Fri, 9 May 2014 08:53:39 -0400 Received: from cantor2.suse.de ([195.135.220.15]:44008 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755997AbaEIMwm (ORCPT ); Fri, 9 May 2014 08:52:42 -0400 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 5501BAD33; Fri, 9 May 2014 12:52:41 +0000 (UTC) Received: by sepie.suse.cz (Postfix, from userid 10020) id 24AAD40806; Fri, 9 May 2014 14:52:41 +0200 (CEST) From: Michal Marek To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Sam Ravnborg Subject: [PATCH v2 4/5] kbuild: Use relative path when building in the source tree Date: Fri, 9 May 2014 14:52:23 +0200 Message-Id: <1399639944-20551-5-git-send-email-mmarek@suse.cz> X-Mailer: git-send-email 1.8.4.5 In-Reply-To: <1399639944-20551-1-git-send-email-mmarek@suse.cz> References: <1399639944-20551-1-git-send-email-mmarek@suse.cz> Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 When not using O=, $(srctree) refers to the same directory as $(objtree), so we can set it to '.' as well. This makes the default include path more compact and results in more readable messages from the compiler. The only case where we need the absolute path is when creating the 'source' symlink in /lib/modules. Acked-by: Sam Ravnborg Signed-off-by: Michal Marek --- v1->v2: Fix the 'source' symlink Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 480503a..4da1c4b 100644 --- a/Makefile +++ b/Makefile @@ -153,7 +153,7 @@ else _all: modules endif -srctree := $(if $(KBUILD_SRC),$(KBUILD_SRC),$(CURDIR)) +srctree := $(if $(KBUILD_SRC),$(KBUILD_SRC),.) objtree := . src := $(srctree) obj := $(objtree) @@ -1054,7 +1054,7 @@ _modinst_: @rm -rf $(MODLIB)/kernel @rm -f $(MODLIB)/source @mkdir -p $(MODLIB)/kernel - @ln -s $(srctree) $(MODLIB)/source + @ln -s `cd $(srctree) && /bin/pwd` $(MODLIB)/source @if [ ! $(objtree) -ef $(MODLIB)/build ]; then \ rm -f $(MODLIB)/build ; \ ln -s $(CURDIR) $(MODLIB)/build ; \