【续《痛苦的版本对齐(2) 和时间的相关性》】http://www.cnblogs.com/yvivid/p/3541142.html
初步定位,如下告警为.depend文件路径问题导致。
.depend:9: *** multiple target patterns. Stop
打开.depend文件(有裁剪,仅显示重要的部分)
start.o: start.S /u-boot-1.1./u-boot-1.1./include/config.h \
/u-boot-1.1./u-boot-1.1./include/cmd_confdefs.h \
/u-boot-1.1./u-boot-1.1./include/asm/arch/sizes.h \
/u-boot-1.1./u-boot-1.1./include/version.h \
interrupts.o: interrupts.c /u-boot-1.1./u-boot-1.1./include/common.h \
/u-boot-1.1./u-boot-1.1./include/config.h \
/u-boot-1.1./u-boot-1.1./include/linux/string.h \
/u-boot-1.1./u-boot-1.1./include/asm/string.h \
/u-boot-1.1./u-boot-1.1./include/asm/ptrace.h \
/u-boot-1.1./u-boot-1.1./include/asm/proc/ptrace.h \
d:/cygwin/arm-2009q1/bin/../lib/gcc/arm-none-linux-gnueabi/4.3./include/stdarg.h \
为了找到问题,需要找.depend是谁生成的,
_depend: $(obj).depend $(obj).depend: $(src)Makefile $(TOPDIR)/config.mk $(SRCS)
@rm -f $@
@for f in $(SRCS); do \
g=`basename $$f | sed -e 's/\(.*\)\.\w/\1.o/'`; \
$(CC) -M $(HOST_CFLAGS) $(CPPFLAGS) -MQ $(obj)$$g $$f >> $@ ; \
done
产生.depend信息的其实是 $(CC),其实就是交叉编译器,为了简化说明,下面用标准的gcc说明,
gcc -M 可以输出 编译文件需要的相关引用文件,
$ gcc -M hello.c
hello.o: hello.c /usr/include/stdio.h /usr/include/_ansi.h \
/usr/include/newlib.h /usr/include/sys/config.h \
/usr/include/machine/ieeefp.h /usr/include/sys/features.h \
/usr/include/cygwin/config.h \
/usr/lib/gcc/i686-pc-cygwin/4.5./include/stddef.h \
/usr/lib/gcc/i686-pc-cygwin/4.5./include/stdarg.h \
/usr/include/sys/reent.h /usr/include/_ansi.h /usr/include/sys/_types.h \
/usr/include/machine/_types.h /usr/include/machine/_default_types.h \
/usr/include/sys/lock.h /usr/include/sys/types.h \
/usr/include/machine/types.h /usr/include/cygwin/types.h \
/usr/lib/gcc/i686-pc-cygwin/4.5./include/stdint.h /usr/include/stdint.h \
/usr/include/endian.h /usr/include/bits/endian.h /usr/include/byteswap.h \
/usr/include/sys/sysmacros.h /usr/include/sys/stdio.h \
/usr/include/sys/cdefs.h
总结,出现上述告警的条件有两个,
1、编译工具,输出了"d:/"这样的路径名。
2、make工具,无法识别"d:/"的信息。
解决问题也就比较清楚,
1、把工具链整理顺(换交叉编译工具,或cygwin下的make)
2、自己做个转换工具,在rules.mk中调用,对.depend进行 路径转换。(可以利用自己熟悉的工具,如C程序、python程序,甚至bash下相关工具)
3、在linux系统下处理。