gun make makefile

來源:互聯網
上載者:User

gun makefile :

為automake,autoconf產生makefile的過程(簡化)。
程式源碼
|
autoscan*
|
v
configure.scan
|
編譯修改*
|
v aclocal*
makefile.am configure.in -------> aclocal.m4
\ ___/\___ ___ /
\ / \ /
automake* autoconf*
\ / \ /
v v
makefile.in configure
\ /
./configure*
\ /
v
makefile
詳細步驟和可能出現的問題:
autoscan /*產生configure.scan*/

//產生 configure.scan 修改成configure.in


aclocal /**/

//如不能產生aclocal.m4在configure.in 加上
AM_INIT_AUTOMAKE
有時候需要加AC_OUTPUT([Makefile])


autoconf /*產生configure*/

//根目錄下Makefile.am(源碼在根目錄下不用建立)如下:
SUBDIRS=src

//src目錄下建立檔案Makefile.am 內容如下(如源碼目錄為根目錄則建立在根下):
AUTOMAKE_OPTIONS=foreign
bin_PROGRAMS=hello
hello_SOURCES=hello.c


libtoolize -f -c /*查看缺少檔案*/

// autoheader,組建檔案configure.h.in

automake -a /*查看缺少檔案*/


touch NEWS
touch README
touch AUTHORS
touch ChangeLog

automake
./configure
make
sudo make install
錯誤:沒有規則可以建立目標“all”。 停止。
修改Makefile.ac 添加自己目錄的Makefile

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.