利用Makefile.am和Makefile.in生成Makefile文件

1.運行命令 autoscan 生成 configure.scan和configure.log文件,這裏若是須要安裝autuconf軟件包,下載地址http://download.chinaunix.net/download/0001000/648.shtmlhtml

下載以後解壓vim

運行命令./configure  這時若是沒有安裝m4軟件包會有錯誤提示,網上查一下如何安裝m4軟件包(http://blog.csdn.net/ldl22847/article/details/8575140)這個博客說的很清楚如何安裝,安裝完成後運行 ./configure 無錯誤提示.net

運行命令 makeunix

運行make installhtm

上面步驟無錯誤提示以後即可以運行autoscan命令,這時會生成 .scan 和 .log文件。這裏須要使用命令mv把configure.scan改成configure.in或者configure.acblog

使用vim查看configure.ac的內容並對其進行修改,不然在面運行aclocal時不會生成.m4的文件。input

修改內容是,在configure.in中添加AM_INIT_AUTOMAKE這句話就能夠了。以下圖所示博客

再運行aclocal命令而後查看可一看到.m4文件生成thread

運行命令autofonf。生成configure文件軟件

2.編寫Makefile.am文件

3.automake

根據提示可能須要運行 automake --add-missing安裝一些必要軟件,而後運行automake生成Makefile.in文件

4.執行configure這時可能會有提示 config.status: error: cannot find input file: `config.h.in' 這樣的錯誤,解決方法是運行命令 autoheader生成config.h.in,而後再執行configure。這時就能夠看到Makefile文件就生成了。

連接:http://my.oschina.net/qihh/blog/66113

http://bbs.chinaunix.net/thread-793596-1-1.html

上面那個是一個很具體的介紹makefile.am makefile.in makefile之間的關係,以及如何一步步的生成makefile文件

下面這個連接是一個在生成.m4文件出錯時的處理狀況

相關文章
相關標籤/搜索