簡體   English   中英

Makefile.def和Makefile.am

[英]Makefile.def vs Makefile.am

我的工作在Linux上的binutils-2.29。 在父目錄沒有Makefile.am ,但在所有的子目錄有Makefile.am

在父目錄這些都是Makefile文件存在:

Makefile  Makefile.def  Makefile.in  Makefile.tpl

在側Makefile.tpl有它說評論Makefile從生成Makefile.tplautogen Makefile.def

但里面的子目錄沒有Makefile.def ,當我運行autoreconf && automake它產生MakefileMakefile.am

究竟是什么區別Makefile.defMakefile.am

Makefile.def和Makefile.am之間到底有什么區別?

讓我們看一下GCC,這也是使用binutils大型項目。 引用重新生成GCC配置

Makefile.in文件有時很大,可以通過Makemake.am文件自動生成。 某些Makefile.in文件(用於在生成樹中生成Makefile)是由autogen從Makefile.tpl和Makefile.def文件生成的。 Autogen是一種(可編寫GUILE腳本的)工具,旨在簡化包含大量重復文本的程序的創建和維護。

所以,不同的是真的,你希望如何以及在何處存儲輸入的部分文件autogen會努力。 對於GCC,它的Makefile.tpl存儲一個模板 (用於生成輸出Makefile,而Makefile.def存儲的定義將由autogen使用。

例如,在Makefile.tpl您會找到以下用於填充HOST_LIB_PATH變量的模板(請注意,它使用host_modules變量):

# This is the list of directories that may be needed in RPATH_ENVVAR
# so that programs built for the host machine work.
HOST_LIB_PATH = [+ FOR host_modules +][+
  IF lib_path +]$(HOST_LIB_PATH_[+module+])[+ ENDIF lib_path +][+
  ENDFOR host_modules +]

Makefile.def有一個host_modules的定義:

host_modules= { module= bfd; bootstrap=true; };
host_modules= { module= opcodes; bootstrap=true; };
// ...

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM