內核編譯出錯:multiple target patterns

原文地址:http://blog.csdn.net/zjujoe/article/details/3185382

現象

 svn 倉庫check out 一份內核, 然後make (該配置內置了initramfs 文件系統),第一次make 成功, 但是此後再也不行了!make , make clean 等後都會出錯。給開發帶來極大麻煩。

 

出錯信息如下:

20081007_kernel>make

  CHK     include/linux/version.h

make[1]:`include/asm-arm/mach-types.h' is up to date.

  CHK     include/linux/utsrelease.h

  CHK     include/linux/compile.h

/home/zjujoe/svn/mhlv_2.6/working/songlixin/20081007_kernel/usr/Makefile:41:*** multiple target patterns.  Stop.

make: *** [usr] Error2

 

20081007_kernel>make clean

  CLEAN   arch/arm/boot/compressed

  CLEAN   arch/arm/boot

  CLEAN   /home/zjujoe/svn/mhlv_2.6/working/songlixin/20081007_kernel

  CLEAN   arch/arm/kernel

  CLEAN   drivers/char

  CLEAN   init

  CLEAN   lib

/home/zjujoe/svn/mhlv_2.6/working/songlixin/20081007_kernel/usr/Makefile:41:*** multiple target patterns.  Stop.

make: *** [_clean_usr] Error2

 

20081007_kernel>makedistclean

/home/zjujoe/svn/mhlv_2.6/working/songlixin/20081007_kernel/usr/Makefile:41:*** multiple target patterns.  Stop.

make: *** [_clean_usr] Error2

 

 

問題解決

(同時打算再仔細研究一下 Makefile 語法:P)

google 了一下, 查到文檔:

http://www.ibm.com/developerworks/cn/linux/l-debugmake.html

 

該文檔說make 時使用  -d 參數可以看到大量信息, 試着用 make–d, 最後幾行:

This program built fori486-pc-linux-gnu

Reading makefiles...

Reading makefile`scripts/Makefile.build'...

Reading makefile`include/config/auto.conf' (search path) (don't care) (no ~expansion)...

Reading makefile`scripts/Kbuild.include' (search path) (no ~expansion)...

Reading makefile`/home/zjujoe/svn/mhlv_2.6/working/songlixin/20081007_kernel/usr/Makefile'(search path) (no ~ expansion)...

Reading makefile`usr/.initramfs_data.cpio.gz.d' (search path) (no ~expansion)...

/home/zjujoe/svn/mhlv_2.6/working/songlixin/20081007_kernel/usr/Makefile:41:*** multiple target patterns.  Stop.

Reaping losing child 0x080af520PID 6349

make: *** [usr] Error2

Removing child 0x080af520 PID6349 from chain.

 

看一下,usr/.initramfs_data.cpio.gz.d initramfs 的目錄列表,

試着刪除文件 usr/.initramfs_data.cpio.gz.d  Make, 居然不出錯了!!!

 

20081007_kernel>rm -fusr/.initramfs_data.cpio.gz.d

20081007_kernel>make

  CHK     include/linux/version.h

make[1]:`include/asm-arm/mach-types.h' is up to date.

  CHK     include/linux/utsrelease.h

  CHK     include/linux/compile.h

  MODPOSTvmlinux

  Kernel:arch/arm/boot/Image is ready

  Kernel:arch/arm/boot/zImage is ready

  Building modules, stage2.

  MODPOST 33modules

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章