编译库的方法(基于MSYS2与MinGW-w64)(一)——如何根据configure.ac和Makefile.am为开源代码产生当前平台的Makefile

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,相应的可执行文件,库文件,头文件拷贝到系统相应位置。

 

 

 

 

 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值