autotools生成Makefile
来源:互联网 发布:mac finder要密码 编辑:程序博客网 时间:2024/06/05 16:50
自己需编写,Makefile.am
通过搜索资料和自身体会总结autotools的一个简单使用方法。
大致包括如下命令:
autoscan
aclocal
autoconf
autoheader
automake
首先创建hello.c文件并编辑
- #include <stdio.h>
- int main()
- {
- printf("hello\n");
- return 0;
- }
(1)autoscan
在源代码目录中执行 autoscan
生成configure.scan文件。
编辑configure.scan文件,通常添加如下两行
- AM_INIT_AUTOMAKE(hello, 1.0)
- AC_CONFIG_FILES([Makefile])
并另存为configure.ac(或configure.in),和autoscan.log。
(2)aclocal
执行aclocal,工具根据configure.ac(或configure.in)生成aclocal.m4文件和autom4te.cache文件夹。
(3)autoconf
执行autoconf,生成configure文件。
(4)autoheader
执行autoheader,生成config.h.in文件。
(5)automake
新建文件Makefile.am并编辑
- AUTOMAKE_OPTIONS=foreign
- bin_PROGRAMS=hello
- hello_SOURCES=hello.c
执行automake,提示:
- configure.ac:8: error: required file './install-sh' not found
- configure.ac:8: 'automake --add-missing' can install 'install-sh'
- configure.ac:8: error: required file './missing' not found
- configure.ac:8: 'automake --add-missing' can install 'missing'
- Makefile.am: error: required file './depcomp' not found
- Makefile.am: 'automake --add-missing' can install 'depcomp'
执行automake --add-missing
再执行automake
后面的过程即为熟知的
./configure
make
make install
补充:
autotools工具还提供 make dist 打包功能
执行 make dist
根据configure.ac中
AC_INIT( [ hello ], [ 1.0 ] )
生成hello-1.0.tar.gz的源码包文件。
0 0
- 使用Autotools生成Makefile
- 使用autotools生成makefile
- autotools生成Makefile(一)
- autotools生成Makefile(二)
- 使用autotools生成Makefile
- autotools生成Makefile(一)
- autotools生成Makefile
- autotools生成makefile文件实例
- autotools生成makefile文件实例
- 使用autotools简单生成Makefile
- autotools工具自动生成Makefile
- autotools使用(自动生成Makefile)
- 使用autotools自动生成makefile
- 使用autotools工具自动生成makefile文件
- autotools系列工具—-自动生成Makefile
- autotools自动生成Makefile与打包
- 用autotools(Automake\Autoconf)生成Makefile
- autotools系列工具—-自动生成Makefile
- 【Python那些事儿之七】Iterators详解
- 思念来了请关灯
- How does Log.wtf() differ from Log.e()?
- StringUtils中 isNotEmpty 和isNotBlank的区别
- module_init的加载和释放
- autotools生成Makefile
- 菜鸟在线带你了解:开发HTML5游戏的九个大坑
- 岁月变迁,叫我怎么留住你的容颜
- Fallacy: Gambler's Fallacy(囚徒困境)
- SQL查询某字段非空的记录解决方法
- 【c/c++】Vector入门
- struts2的整体回顾(ACTION、拦截器、值栈、OGNL表达式、ModelDriven方案等)
- opencv findContours 相关
- 用户空间与内核的交互---IOCTL