public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] Don't add symlink in srctree when using an objtree
@ 2010-12-05  0:52 Loïc Minier
  2010-12-17 19:51 ` Wolfgang Denk
       [not found] ` <20101217195131.321CC15192A@gemini.denx.de>
  0 siblings, 2 replies; 4+ messages in thread
From: Loïc Minier @ 2010-12-05  0:52 UTC (permalink / raw)
  To: u-boot

When building with srctree != objtree, the build creates arch/soc/cpu
specific symlinks in the source tree.  This means that the same source
tree can't be used for multiple builds at the same time.  Also, these
symlinks in the source tree are only cleaned up if one passes the same
O= to distclean.

When srctree != objtree, mkconfig creates an $objtree/include2 directory
in the objtree to host the asm -> arch/$arch/include/asm symlink so that
"#include <asm>" can be used.  But it also creates another identical
symlink in $objtree/include.

Then, mkconfig creates two symlinks:
$objtree/include/asm/arch -> arch/$arch/include/asm/arch-$cpu (or $soc)
$objtree/include/asm/proc -> arch/$arch/include/asm/proc-armv (on arm)
but because $objtree/include/asm points at $srctree already, the two
symlinks are created under $srctree.

To fix this, create a real $objtree/include/asm directory, instead of a
symlink.  Update cleanup code accordingly.

Signed-off-by: Lo?c Minier <loic.minier@linaro.org>
---
 Makefile |    4 +++-
 mkconfig |    3 +--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index 87a383d..8a3f3e0 100644
--- a/Makefile
+++ b/Makefile
@@ -1246,7 +1246,9 @@ clobber:	clean
 	@rm -f $(obj)u-boot.imx
 	@rm -f $(obj)tools/{env/crc32.c,inca-swap-bytes}
 	@rm -f $(obj)arch/powerpc/cpu/mpc824x/bedbug_603e.c
-	@rm -f $(obj)include/asm/proc $(obj)include/asm/arch $(obj)include/asm
+	@rm -f $(obj)include/asm/proc $(obj)include/asm/arch
+	@[ ! -h $(obj)include/asm ] || rm -f $(obj)include/asm
+	@[ ! -d $(obj)include/asm ] || rmdir $(obj)include/asm
 	@rm -fr $(obj)include/generated
 	@[ ! -d $(obj)nand_spl ] || find $(obj)nand_spl -name "*" -type l -print | xargs rm -f
 	@[ ! -d $(obj)onenand_ipl ] || find $(obj)onenand_ipl -name "*" -type l -print | xargs rm -f
diff --git a/mkconfig b/mkconfig
index 2fda1d4..1408b53 100755
--- a/mkconfig
+++ b/mkconfig
@@ -98,8 +98,7 @@ if [ "$SRCTREE" != "$OBJTREE" ] ; then
 	ln -s ${SRCTREE}/arch/${arch}/include/asm asm
 	LNPREFIX=${SRCTREE}/arch/${arch}/include/asm/
 	cd ../include
-	rm -f asm
-	ln -s ${SRCTREE}/arch/${arch}/include/asm asm
+	mkdir -p asm
 else
 	cd ./include
 	rm -f asm
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-01-03 15:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-05  0:52 [U-Boot] [PATCH] Don't add symlink in srctree when using an objtree Loïc Minier
2010-12-17 19:51 ` Wolfgang Denk
     [not found] ` <20101217195131.321CC15192A@gemini.denx.de>
2010-12-18 16:07   ` Loïc Minier
2011-01-03 15:11     ` Loïc Minier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox