automake的使用

1.新建项目autocpp,目录结构如下:

 

2.$aclocal

生成了aclocal.m4 autom4te.cache

 

3.libtoolize --copy --force

结果:

libtoolize: putting auxiliary files in `.'.

libtoolize: copying file `./ltmain.sh'

libtoolize: Consider adding `AC_CONFIG_MACRO_DIR([m4])' to configure.ac and

libtoolize: rerunning libtoolize, to keep the correct libtool macros in-tree.

libtoolize: Consider adding `-I m4' to ACLOCAL_AMFLAGS in Makefile.am.

 

4.运行autoconf

结果:生成configure文件

 

5.运行autoheader

结果:生成config.h.in文件

 

6:automake --add-missing --copy

结果:

[shengjl25@/home/shengjl25/testautomake/autocpp]$automake --add-missing --copy

configure.ac:14: installing `./config.guess'

configure.ac:14: installing `./config.sub'

configure.ac:6: installing `./install-sh'

configure.ac:6: installing `./missing'

src/bar/Makefile.am: installing `./depcomp'

Makefile.am: installing `./INSTALL'

Makefile.am: required file `./NEWS' not found

Makefile.am: required file `./README' not found

Makefile.am: required file `./AUTHORS' not found

Makefile.am: required file `./ChangeLog' not found

Makefile.am: installing `./COPYING' using GNU General Public License v3 file

Makefile.am: Consider adding the COPYING file to the version control system

Makefile.am: for your code, to avoid questions about which license your project uses.

创建not found的四个文件再重新运行automake --add-missing

生成Makefile.in文件

 

7.configure --prefix=$HOME

结果:生成Makefile文件

 

8.运行make all 生成hello文件

运行./src/main/hello

输出结果:

main +

foo +-

bar +-

main -

 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值