提交 dcc2da1a 编写于 作者: S Sam Ravnborg

kbuild: improve check-symlink

o if include/asm point to a nonexisting directory remove the asm symlink
o if include/asm is a directory error out

This fixes a situation where one could be left with a symlink
to asm-x86 but that directory no longer exist and thus the build
would error out.

include/asm may be a directory if the kernel tree has been copied
Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
上级 46dca86c
...@@ -961,6 +961,7 @@ export CPPFLAGS_vmlinux.lds += -P -C -U$(ARCH) ...@@ -961,6 +961,7 @@ export CPPFLAGS_vmlinux.lds += -P -C -U$(ARCH)
# The asm symlink changes when $(ARCH) changes. # The asm symlink changes when $(ARCH) changes.
# Detect this and ask user to run make mrproper # Detect this and ask user to run make mrproper
# If asm is a stale symlink (point to dir that does not exist) remove it
define check-symlink define check-symlink
set -e; \ set -e; \
if [ -L include/asm ]; then \ if [ -L include/asm ]; then \
...@@ -970,6 +971,10 @@ define check-symlink ...@@ -970,6 +971,10 @@ define check-symlink
echo " set ARCH or save .config and run 'make mrproper' to fix it"; \ echo " set ARCH or save .config and run 'make mrproper' to fix it"; \
exit 1; \ exit 1; \
fi; \ fi; \
test -e $$asmlink || rm include/asm; \
elif [ -d include/asm ]; then \
echo "ERROR: $@ is a directory but a symlink was expected";\
exit 1; \
fi fi
endef endef
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册