public inbox for linux-sh@vger.kernel.org
 help / color / mirror / Atom feed
From: Franck Bui-Huu <vagabon.xyz@gmail.com>
To: linux-sh@vger.kernel.org
Subject: Re: [PATCH] Use relative path when creating include/asm/{mach,cpu}
Date: Tue, 18 Mar 2008 19:04:06 +0000	[thread overview]
Message-ID: <47E01226.3050504@gmail.com> (raw)
In-Reply-To: <47DEC594.6010502@gmail.com>

Franck Bui-Huu wrote:
> Well it should be pretty trivial to make this patch works both cases
> although it can't be called a "clean up" patch.
> 

and here's an updated patch, which should work for both cases.

It's pretty simple and not very intrusive so it could be a temporary fix
until the massive header reorganization happen.

		Franck

---8<---

Subject: [PATCH] Use relative path when creating include/asm/{mach,cpu} symlinks when possible

From: Franck Bui-Huu <fbuihuu@gmail.com>

When building the kernel without passing the O= command line parameter
there's no point to use absolute paths for them.

Usually relative paths are preferred because they survive directory
moves, work across networked file systems and chrooted environments.

Absolute paths are still used if an output directory is given.

Signed-off-by: Franck Bui-Huu <fbuihuu@gmail.com>
---
 arch/sh/Makefile |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/arch/sh/Makefile b/arch/sh/Makefile
index c510c22..cffc92b 100644
--- a/arch/sh/Makefile
+++ b/arch/sh/Makefile
@@ -154,7 +154,11 @@ drivers-$(CONFIG_OPROFILE)	+= arch/sh/oprofile/
 
 boot := arch/sh/boot
 
+ifneq ($(KBUILD_SRC),)
 incdir-prefix	:= $(srctree)/include/asm-sh/
+else
+incdir-prefix	:+endif
 
 #	Update machine arch and proc symlinks if something which affects
 #	them changed.  We use .arch and .mach to indicate when they were
@@ -182,7 +186,7 @@ include/asm-sh/.mach: $(wildcard include/config/sh/*.h) \
 	$(Q)if [ ! -d include/asm-sh ]; then mkdir -p include/asm-sh; fi
 	$(Q)rm -f include/asm-sh/mach
 	$(Q)for i in $(incdir-y); do \
-	if [ -d $(incdir-prefix)$$i ]; then \
+	if [ -d $(srctree)/include/asm-sh/$$i ]; then \
 		echo -n '  SYMLINK include/asm-sh/mach -> '; \
 		echo -e "include/asm-sh/$$i"; \
 		ln -fsn $(incdir-prefix)$$i \
@@ -191,7 +195,7 @@ include/asm-sh/.mach: $(wildcard include/config/sh/*.h) \
 		if [ ! -d include/asm-sh/mach ]; then \
 			echo -n '  SYMLINK include/asm-sh/mach -> '; \
 			echo -e 'include/asm-sh'; \
-			ln -fsn $(incdir-prefix) include/asm-sh/mach; \
+			ln -fsn $(incdir-prefix)../asm-sh include/asm-sh/mach; \
 		fi; \
 	fi; \
 	done
-- 
1.5.4.4.GIT


  parent reply	other threads:[~2008-03-18 19:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-17 19:25 [PATCH] Use relative path when creating include/asm/{mach,cpu} symlinks Franck Bui-Huu
2008-03-17 19:51 ` [PATCH] Use relative path when creating include/asm/{mach,cpu} Stuart MENEFY
2008-03-18  3:11 ` [PATCH] Use relative path when creating include/asm/{mach,cpu} symlinks Paul Mundt
2008-03-18  7:26 ` [PATCH] Use relative path when creating include/asm/{mach,cpu} Franck Bui-Huu
2008-03-18  7:31 ` Franck Bui-Huu
2008-03-18 19:04 ` Franck Bui-Huu [this message]
2008-03-21  3:39 ` [PATCH] Use relative path when creating include/asm/{mach,cpu} symlinks Paul Mundt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47E01226.3050504@gmail.com \
    --to=vagabon.xyz@gmail.com \
    --cc=linux-sh@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox