1.参考链接
如何根据configure.ac和Makefile.am为开源代码产生当前平台的Makefile https://www.cnblogs.com/lidabo/p/7269077.html
Windows下搭建类UNIX环境 : Msys2+MinGW-w64 https://blog.csdn.net/yehuohan/article/details/52090282
2.引言
//根据configure.in和Makefile.am生成makefile的步骤,基于UBUNTU 12.04
1.autoscan (可选)
2.aclocal
3.autoconf
4.autoheader(可选)
5.libtoolize --automake --copy --debug --force(可选)
6.automake --add-missing
7.autoreconf –f –i –Wall,no–obsolete(可选)
8../configure
复杂点的方式:
为一个项目源文件生成makefile并make的步骤如下:
操作在包含源文件的项目目录下进行。
- (1)运行autoscan,生成文件configure.scan
- (2)修改configure.scan,改名为configure.in
- (3)运行autoheader,生成文件configure.h.in(现在一般改为configure.ac)
- (4)运行libtoolize,生成ltmain.sh
- (5)运行allocal,生成aclocal.m4
- (6)运行autoconf,生成configure
- (7)运行automake,生成makefile.in,每个包含makefile.am的子目录都生成makefile.in。automake -a选项可以补齐文件config.guess,config.sub,install-sh,missing,depcomp
- (8)运行./configure,生成config.status,config.h,makefile
- (9)运行make,生成中间文件对象文件,库文件,最后生成可执行文件
- (10)运行make install,相应的可执行文件,库文件,头文件拷贝到系统相应位置。