Commit a9d8bc98061c2c4bce312ce4d63cb4c61889fb6d

Authored by Loïc Minier
Committed by Wolfgang Denk
1 parent 42484788dc

Don't add symlink in srctree when using an objtree

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>

Showing 2 changed files with 2 additions and 3 deletions Side-by-side Diff

... ... @@ -1243,7 +1243,7 @@
1243 1243 @rm -f $(obj)u-boot.imx
1244 1244 @rm -f $(obj)tools/{env/crc32.c,inca-swap-bytes}
1245 1245 @rm -f $(obj)arch/powerpc/cpu/mpc824x/bedbug_603e.c
1246   - @rm -f $(obj)include/asm/proc $(obj)include/asm/arch $(obj)include/asm
  1246 + @rm -fr $(obj)include/asm/proc $(obj)include/asm/arch $(obj)include/asm
1247 1247 @rm -fr $(obj)include/generated
1248 1248 @[ ! -d $(obj)nand_spl ] || find $(obj)nand_spl -name "*" -type l -print | xargs rm -f
1249 1249 @[ ! -d $(obj)onenand_ipl ] || find $(obj)onenand_ipl -name "*" -type l -print | xargs rm -f
... ... @@ -98,8 +98,7 @@
98 98 ln -s ${SRCTREE}/arch/${arch}/include/asm asm
99 99 LNPREFIX=${SRCTREE}/arch/${arch}/include/asm/
100 100 cd ../include
101   - rm -f asm
102   - ln -s ${SRCTREE}/arch/${arch}/include/asm asm
  101 + mkdir -p asm
103 102 else
104 103 cd ./include
105 104 rm -f asm