在kernel目录进行过make menuconfig之后,再编译整包出现 xxx is not clean, please run 'make mrproper'报错
但是根据提示在kernel路径下执行 make mrproper,依旧出现错误
这时候去根据提示内容,去找相应的Makefile,看看设么条件下会报这样的错
Makefile位于kernel的根目录下
# prepare3 is used to check if we are building in a separate output directory,
# and if so do:
# 1) Check that make has not been executed in the kernel src $(srctree)
prepare3: include/config/kernel.release
ifneq ($(KBUILD_SRC),)
@$(kecho) ' Using $(srctree) as source for kernel'
$(Q)if [ -f $(srctree)/.config -o -d $(srctree)/include/config ]; then \
echo >&2 " $(srctree) is not clean, please run 'make mrproper'"; \
echo >&2 " in the '$(srctree)' directory.";\
/bin/false; \
fi;
ndif
也就是会检查kernel根目录下是否有名.config的文件以及include路径下是否存在名为config的目录,如果有就出现" $(srctree) is not clean, please run 'make mrproper'"提示
所以解决这个问题的办法就是删掉 .config 和include/config
继续工作~
本文详细介绍了在Linux内核目录进行makemenuconfig配置并尝试编译时遇到xxxisnotclean,pleaserun'makemrproper'错误的解决方法。通过分析Makefile,发现该错误与.config文件及include/config目录的存在有关。解决方案为删除这些文件,确保内核源码目录干净。
1601





