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

autoconf 和 automake 生成 Makefile 文件

2013年09月29日 ⁄ 综合 ⁄ 共 862字 ⁄ 字号 评论关闭

autoconf 和 automake 生成 Makefile 文件

1) 在project目录下新建Makefile.am文件,并在各个子目录下也新建makefile.am文件

2) 运行autoscan命令
3) 将configure.scan 文件重命名为configure.in,并修改configure.in文件
修改L5 AC_INIT(unit_station, 1.0, baocy@aurine.net)
增加L8 AM_INIT_AUTOMAKE(unit_station, 1.0)
在# Checks for header files.后增加   AC_PROG_RANLIB

4) 在project目录下新建NEWS、 README、 ChangeLog 、AUTHORS文件
5) 将/usr/share/automake-1.X/目录下的depcomp和complie文件拷贝到本目录下
6) 运行aclocal命令
7) autoheader
8) 运行autoconf命令
9) 运行automake -a命令
10) 运行./confiugre脚本

如果需要加入多线程,改写Makefile.am这个文件,加一个LIBS   +=   -lpthread  再用./configure生成Makefile就可以了
或者./configure   -lpthread   ./make   就行了
如果需要交叉编译。用
./configure --host=arm-hismall-linux --cache-file=arm-hismall-linux.cache

参考:http://www.ibm.com/developerworks/cn/linux/l-makefile/
http://blogold.chinaunix.net/u1/56723/showart_469251.html
http://hi.baidu.com/serial_story/blog/item/7ecb12f59f7c392dbd310909.html/cmtid/d3e80f4ec555cbc6d0c86a5d

抱歉!评论已关闭.