现在的位置: 首页 > 综合 > 正文

binutils-2.18/libiberty/Makefile分析

2013年09月14日 ⁄ 综合 ⁄ 共 7394字 ⁄ 字号 评论关闭

快乐虾

http://blog.csdn.net/lights_joy/

lights@hb165.com

 

 

本文适用于

binutils-2.18

configure –target=bfin-uclinux-gnu

Blackfin系列DSP

Cygwin gcc 3.4.4

 

 

 

欢迎转载,但请保留作者信息

 

 

这个文件由主控Makefile调用configure脚本生成并执行make操作。要求生成的目标为all

1.1    all

Makefile中的第一个目标就是all

all: stamp-picdir $(TARGETLIB) needed-list required-list all-subdir

       @: $(MAKE) ; exec $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=all

1.1.1   stamp-picdir

这条规则定义为:

stamp-picdir:

       if [ x"$(PICFLAG)" != x ] && [ ! -d pic ]; then /

         mkdir pic; /

       else true; fi

       touch stamp-picdir

没什么操作,简单创建stamp-picdir目录。

 

1.1.2   $(TARGETLIB)

这条规则定义为:

$(TARGETLIB): $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS)

       -rm -f $(TARGETLIB) pic/$(TARGETLIB)

       $(AR) $(AR_FLAGS) $(TARGETLIB) /

         $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS)

       $(RANLIB) $(TARGETLIB)

       if [ x"$(PICFLAG)" != x ]; then /

         cd pic; /

         $(AR) $(AR_FLAGS) $(TARGETLIB) /

           $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS); /

         $(RANLIB) $(TARGETLIB); /

         cd ..; /

       else true; fi

当所需要的目标文件都生成时,这段脚本将它们链接为$(TARGETLIB),即libiberty.a

1.1.2.1             $(REQUIRED_OFILES)

这个变量定义为:

# These are always included in the library.  The first four are listed

# first and by compile time to optimize parallel builds.

REQUIRED_OFILES = ./regex.o ./cplus-dem.o ./cp-demangle.o ./md5.o  /

       ./alloca.o ./argv.o                                       /

       ./choose-temp.o ./concat.o ./cp-demint.o                   /

       ./dyn-string.o                                            /

       ./fdmatch.o ./fibheap.o ./filename_cmp.o ./floatformat.o     /

       ./fnmatch.o ./fopen_unlocked.o                                /

       ./getopt.o ./getopt1.o ./getpwd.o ./getruntime.o          /

       ./hashtab.o ./hex.o                                     /

       ./lbasename.o ./lrealpath.o                                 /

       ./make-relative-prefix.o ./make-temp-file.o                 /

       ./objalloc.o ./obstack.o                               /

       ./partition.o ./pexecute.o ./physmem.o                       /

       ./pex-common.o ./pex-one.o ./pex-unix.o                          /

       ./safe-ctype.o ./sort.o ./spaces.o ./splay-tree.o ./strerror.o  /

        ./strsignal.o                                             /

       ./unlink-if-ordinary.o                                         /

       ./xatexit.o ./xexit.o ./xmalloc.o ./xmemdup.o ./xstrdup.o     /

        ./xstrerror.o ./xstrndup.o

因而有以下依赖关系。

1.1.2.1.1       ./regex.o

这条规则定义为:

./regex.o: $(srcdir)/regex.c stamp-h $(INCDIR)/ansidecl.h $(INCDIR)/xregex.h /

       $(INCDIR)/xregex2.h

       if [ x"$(PICFLAG)" != x ]; then /

         $(COMPILE.c) $(PICFLAG) $(srcdir)/regex.c -o pic/$@; /

       else true; fi

       $(COMPILE.c) $(srcdir)/regex.c $(OUTPUT_OPTION)

直接编译即可。

 

 

1.1.2.1.2       ./cplus-dem.o

这条规则定义为:

./cplus-dem.o: $(srcdir)/cplus-dem.c stamp-h $(INCDIR)/ansidecl.h /

       $(INCDIR)/demangle.h $(INCDIR)/libiberty.h /

       $(INCDIR)/safe-ctype.h

       if [ x"$(PICFLAG)" != x ]; then /

         $(COMPILE.c) $(PICFLAG) $(srcdir)/cplus-dem.c -o pic/$@; /

       else true; fi

       $(COMPILE.c) $(srcdir)/cplus-dem.c $(OUTPUT_OPTION)

直接编译即可。

 

1.1.2.1.3       ./cp-demangle.o

这条规则定义为:

./cplus-dem.o: $(srcdir)/cplus-dem.c stamp-h $(INCDIR)/ansidecl.h /

       $(INCDIR)/demangle.h $(INCDIR)/libiberty.h /

       $(INCDIR)/safe-ctype.h

       if [ x"$(PICFLAG)" != x ]; then /

         $(COMPILE.c) $(PICFLAG) $(srcdir)/cplus-dem.c -o pic/$@; /

       else true; fi

       $(COMPILE.c) $(srcdir)/cplus-dem.c $(OUTPUT_OPTION)

直接编译即可。

 

1.1.2.1.4       ./md5.o    

这条规则定义为:

./md5.o: $(srcdir)/md5.c stamp-h $(INCDIR)/ansidecl.h $(INCDIR)/md5.h

       if [ x"$(PICFLAG)" != x ]; then /

         $(COMPILE.c) $(PICFLAG) $(srcdir)/md5.c -o pic/$@; /

       else true; fi

       $(COMPILE.c) $(srcdir)/md5.c $(OUTPUT_OPTION)

直接编译即可。

 

1.1.2.1.5       ./alloca.o

这条规则定义为:

./alloca.o: $(srcdir)/alloca.c stamp-h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h

       if [ x"$(PICFLAG)" != x ]; then /

         $(COMPILE.c) $(PICFLAG) $(srcdir)/alloca.c -o pic/$@; /

       else true; fi

       $(COMPILE.c) $(srcdir)/alloca.c $(OUTPUT_OPTION)

直接编译即可。

 

1.1.2.1.6       ./argv.o    

这条规则定义为:

./argv.o: $(srcdir)/argv.c stamp-h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h /

       $(INCDIR)/safe-ctype.h

       if [ x"$(PICFLAG)" != x ]; then /

         $(COMPILE.c) $(PICFLAG) $(srcdir)/argv.c -o pic/$@; /

       else true; fi

       $(COMPILE.c) $(srcdir)/argv.c $(OUTPUT_OPTION)

直接编译即可。

 

1.1.2.1.7       ./choose-temp.o

这条规则定义为:

./choose-temp.o: $(srcdir)/choose-temp.c stamp-h $(INCDIR)/ansidecl.h /

       $(INCDIR)/libiberty.h

       if [ x"$(PICFLAG)" != x ]; then /

         $(COMPILE.c) $(PICFLAG) $(srcdir)/choose-temp.c -o pic/$@; /

       else true; fi

       $(COMPILE.c) $(srcdir)/choose-temp.c $(OUTPUT_OPTION)

直接编译即可。

 

1.1.2.1.8       ./concat.o

这条规则定义为:

./concat.o: $(srcdir)/concat.c stamp-h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h

       if [ x"$(PICFLAG)" != x ]; then /

         $(COMPILE.c) $(PICFLAG) $(srcdir)/concat.c -o pic/$@; /

       else true; fi

       $(COMPILE.c) $(srcdir)/concat.c $(OUTPUT_OPTION)

直接编译即可。

 

1.1.2.1.9       ./cp-demint.o

这条规则定义为:

./cp-demint.o: $(srcdir)/cp-demint.c stamp-h $(INCDIR)/ansidecl.h /

       $(srcdir)/cp-demangle.h $(INCDIR)/demangle.h /

       $(INCDIR)/libiberty.h

       if [ x"$(PICFLAG)" != x ]; then /

         $(COMPILE.c) $(PICFLAG) $(srcdir)/cp-demint.c -o pic/$@; /

       else true; fi

       $(COMPILE.c) $(srcdir)/cp-demint.c $(OUTPUT_OPTION)

直接编译即可。

 

1.1.2.1.10  ./dyn-string.o      

这条规则定义为:

./dyn-string.o: $(srcdir)/dyn-string.c stamp-h $(INCDIR)/ansidecl.h /

       $(INCDIR)/dyn-string.h $(INCDIR)/libiberty.h

       if [ x"$(PICFLAG)" != x ]; then /

         $(COMPILE.c) $(PICFLAG) $(srcdir)/dyn-string.c -o pic/$@; /

       else true; fi

       $(COMPILE.c) $(srcdir)/dyn-string.c $(OUTPUT_OPTION)

直接编译即可。

 

1.1.2.1.11  ./fdmatch.o

这条规则定义为:

./fdmatch.o: $(srcdir)/fdmatch.c stamp-h $(INCDIR)/ansidecl.h /

       $(INCDIR)/libiberty.h

       if [ x"$(PICFLAG)" != x ]; then /

         $(COMPILE.c) $(PICFLAG) $(srcdir)/fdmatch.c -o pic/$@; /

       else true; fi

       $(COMPILE.c) $(srcdir)/fdmatch.c $(OUTPUT_OPTION)

直接编译即可。

 

1.1.2.1.12  ./fibheap.o

这条规则定义为:

./fibheap.o: $(srcdir)/fibheap.c stamp-h $(INCDIR)/ansidecl.h $(INCDIR)/fibheap.h /

       $(INCDIR)/libiberty.h

       if [ x"$(PICFLAG)" != x ]; then /

         $(COMPILE.c) $(PICFLAG) $(srcdir)/fibheap.c -o pic/$@; /

       else true; fi

       $(COMPILE.c) $(srcdir)/fibheap.c $(OUTPUT_OPTION)

直接编译即可。

 

1.1.2.1.13  ./filename_cmp.o

这条规则定义为:

./filename_cmp.o: $(srcdir)/filename_cmp.c stamp-h $(INCDIR)/filenames.h /

       $(INCDIR)/safe-ctype.h

       if [ x"$(PICFLAG)" != x ]; then /

         $(COMPILE.c) $(PICFLAG) $(srcdir)/filename_cmp.c -o pic/$@; /

       else true; fi

       $(COMPILE.c) $(srcdir)/filename_cmp.c $(OUTPUT_OPTION)

直接编译即可。

 

1.1.2.1.14  ./floatformat.o    

这条规则定义为:

./floatformat.o: $(srcdir)/floatformat.c stamp-h $(INCDIR)/ansidecl.h /

       $(INCDIR)/floatformat.h $(INCDIR)/libiberty.h

       if [ x"$(PICFLAG)" != x ]; then /

         $(COMPILE.c) $(PICFLAG) $(srcdir)/floatformat.c -o pic/$@; /

       else true; fi

       $(COMPILE.c) $(srcdir)/floatformat.c $(OUTPUT_OPTION)

直接编译即可。

 

1.1.2.1.15  ./fnmatch.o

这条规则定义为:

./fnmatch.o: $(srcdir)/fnmatch.c stamp-h $(INCDIR)/fnmatch.h /

       $(INCDIR)/safe-ctype.h

       if [ x"$(PICFLAG)" != x ]; then /

         $(COMPILE.c) $(PICFLAG) $(srcdir)/fnmatch.c -o pic/$@; /

       else true; fi

       $(COMPILE.c) $(srcdir)/fnmatch.c $(OUTPUT_OPTION)

直接编译即可。

 

1.1.2.1.16  ./fopen_unlocked.o  

这条规则定义为:

./fopen_unlocked.o: $(srcdir)/fopen_unlocked.c stamp-h $(INCDIR)/ansidecl.h /

       $(INCDIR)/libiberty.h

       if [ x"$(PICFLAG)" != x ]; then /

         $(COMPILE.c) $(PICFLAG) $(srcdir)/fopen_unlocked.c -o pic/$@; /

       else true; fi

       $(COMPILE.c) $(srcdir)/fopen_unlocked.c $(OUTPUT_OPTION)

直接编译即可。

 

1.1.2.1.17  ./getopt.o

这条规则定义为:

./getopt.o: $(srcdir)/getopt.c stamp-h $(INCDIR)/ansidecl.h $(INCDIR)/getopt.h

       if [ x"$(PICFLAG)" != x ]; then /

         $(COMPILE.c) $(PICFLAG) $(srcdir)/getopt.c -o pic/$@; /

抱歉!评论已关闭.