网站公告列表

  没有公告

加入收藏
设为首页
联系本站
您现在的位置: AnalogCN安诺电子 >> 文章 >> 技术交流 >> 文章正文
  binutils-2.18/libiberty/Makefile分析           ★★★ 【字体:
binutils-2.18/libiberty/Makefile分析
作者:快乐虾    文章来源:http://blog.csdn.net/lights_joy    点击数:    更新时间:2008-8-28    

这个文件由主控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/$@; \

       else true; fi

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

直接编译即可。

 

1.1.2.1.18  ./getopt1.o

这条规则定义为:

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

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

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

       else true; fi

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

直接编译即可。

 

1.1.2.1.19  ./getpwd.o

这条规则定义为:

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

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

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

       else true; fi

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

直接编译即可。

 

1.1.2.1.20  ./getruntime.o    

这条规则定义为:

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

       $(INCDIR)/libiberty.h

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

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

       else true; fi

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

直接编译即可。

 

1.1.2.1.21  ./hashtab.o

这条规则定义为:

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

       $(INCDIR)/libiberty.h

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

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

       else true; fi

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

直接编译即可。

 

1.1.2.1.22  ./hex.o

这条规则定义为:

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

       $(INCDIR)/safe-ctype.h

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

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

       else true; fi

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

直接编译即可。

 

1.1.2.1.23  ./lbasename.o

这条规则定义为:

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

       $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \

       $(INCDIR)/safe-ctype.h

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

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

       else true; fi

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

直接编译即可。

 

1.1.2.1.24  ./lrealpath.o  

这条规则定义为:

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

       $(INCDIR)/libiberty.h

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

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

       else true; fi

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

直接编译即可。

 

1.1.2.1.25  ./make-relative-prefix.o

这条规则定义为:

./make-relative-prefix.o: $(srcdir)/make-relative-prefix.c stamp-h \

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

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

         $(COMPILE.c) $(PICFLAG) $(srcdir)/make-relative-prefix.c -o pic/$@; \

       else true; fi

       $(COMPILE.c) $(srcdir)/make-relative-prefix.c $(OUTPUT_OPTION)

直接编译即可。

 

1.1.2.1.26  ./make-temp-file.o   

这条规则定义为:

./make-temp-file.o: $(srcdir)/make-temp-file.c stamp-h $(INCDIR)/ansidecl.h \

       $(INCDIR)/libiberty.h

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

         $(COMPILE.c) $(PICFLAG) $(srcdir)/make-temp-file.c -o pic/$@; \

       else true; fi

       $(COMPILE.c) $(srcdir)/make-temp-file.c $(OUTPUT_OPTION)

直接编译即可。

 

1.1.2.1.27  ./objalloc.o

这条规则定义为:

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

       $(INCDIR)/objalloc.h

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

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

       else true; fi

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

直接编译即可。

 

1.1.2.1.28  ./obstack.o

这条规则定义为:

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

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

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

       else true; fi

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

直接编译即可。

 

1.1.2.1.29  ./partition.o

这条规则定义为:

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

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

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

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

       else true; fi

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

直接编译即可。

 

1.1.2.1.30  ./pexecute.o

这条规则定义为:

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

       $(INCDIR)/libiberty.h

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

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

       else true; fi

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

直接编译即可。

 

1.1.2.1.31  ./physmem.o

这条规则定义为:

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

       $(INCDIR)/libiberty.h

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

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

       else true; fi

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

直接编译即可。

 

1.1.2.1.32  ./pex-common.o

这条规则定义为:

./pex-common.o: $(srcdir)/pex-common.c stamp-h $(INCDIR)/ansidecl.h \

       $(INCDIR)/libiberty.h $(srcdir)/pex-common.h

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

         $(COMPILE.c) $(PICFLAG) $(srcdir)/pex-common.c -o pic/$@; \

       else true; fi

       $(COMPILE.c) $(srcdir)/pex-common.c $(OUTPUT_OPTION)

直接编译即可。

 

1.1.2.1.33  ./pex-one.o

这条规则定义为:

./pex-one.o: $(srcdir)/pex-one.c stamp-h $(INCDIR)/ansidecl.h \

       $(INCDIR)/libiberty.h

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

         $(COMPILE.c) $(PICFLAG) $(srcdir)/pex-one.c -o pic/$@; \

       else true; fi

       $(COMPILE.c) $(srcdir)/pex-one.c $(OUTPUT_OPTION)

直接编译即可。

 

1.1.2.1.34  ./pex-unix.o

这条规则定义为:

./pex-unix.o: $(srcdir)/pex-unix.c stamp-h $(INCDIR)/ansidecl.h \

       $(INCDIR)/libiberty.h $(srcdir)/pex-common.h

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

         $(COMPILE.c) $(PICFLAG) $(srcdir)/pex-unix.c -o pic/$@; \

       else true; fi

       $(COMPILE.c) $(srcdir)/pex-unix.c $(OUTPUT_OPTION)

直接编译即可。

 

1.1.2.1.35  ./safe-ctype.o

这条规则定义为:

./safe-ctype.o: $(srcdir)/safe-ctype.c $(INCDIR)/ansidecl.h \

       $(INCDIR)/safe-ctype.h

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

         $(COMPILE.c) $(PICFLAG) $(srcdir)/safe-ctype.c -o pic/$@; \

       else true; fi

       $(COMPILE.c) $(srcdir)/safe-ctype.c $(OUTPUT_OPTION)

直接编译即可。

 

1.1.2.1.36  ./sort.o

这条规则定义为:

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

       $(INCDIR)/sort.h

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

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

       else true; fi

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

直接编译即可。

 

1.1.2.1.37  ./spaces.o

这条规则定义为:

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

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

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

       else true; fi