没有合适的资源?快使用搜索试试~ 我知道了~
怎么样创建、发布自己 GNU 的工程-autoMakefile总结
4星 · 超过85%的资源 需积分: 9 7 下载量 84 浏览量
2011-05-23
09:52:47
上传
评论
收藏 12KB TXT 举报
温馨提示
试读
8页
怎么样创建、发布自己 GNU 的工程-autoMakefile总结
资源推荐
资源详情
资源评论
怎么样创建、发布自己 GNU 的工程-autoMakefile总结
一、首先运行一个例子
编译步骤如下:
前提是编译一个源程序,eg:hello.c,然后
xuchangjing@ubuntu:~/test/test$ cat test.c
#include <stdio.h>
#include <stdlib.h>
int main(int argc,char **argv)
{
printf("hello world\n");
return 0;
}
xuchangjing@ubuntu:~/test/test$ ls
test.c
1、autoscan
autoscan是用来扫描源代码目录生成configure.scan文件的。autoscan可以用目录名做为参数,但如果你不使用参数的话,那 么autoscan将认为使用的是当前目录。autoscan将扫描你所指定目录中的源文件,并创建configure.scan文件。
xuchangjing@ubuntu:~/test/test$ autoscan
xuchangjing@ubuntu:~/test/test$ ls
autoscan.log configure.scan test.c
xuchangjing@ubuntu:~/test/test$
2、修改configure.scan为configure.in或configure.ac,并配置configure.in参数
--configure.scan包含了系统配置的基本选项,里面都是一些宏定义。我们需要将它改名为configure.in (因为aclocal工具 只认configure.in或configure.ac不认识configure.scan)
xuchangjing@ubuntu:~/test/test$ mv configure.scan configure.in
xuchangjing@ubuntu:~/test/test$ ls
autoscan.log configure.in test.c
xuchangjing@ubuntu:~/test/test$ vi configure.in
xuchangjing@ubuntu:~/test/test$ cat configure.in
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.67])
AC_INIT(FULL-PACKAGE-NAME, VERSION, BUG-REPORT-ADDRESS)
AC_CONFIG_SRCDIR([test.c])
#AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE(test,1.0)
# Checks for programs.
AC_PROG_CC
# Checks for libraries.
# Checks for header files.
AC_CHECK_HEADERS([stdlib.h])
# Checks for typedefs, structures, and compiler characteristics.
# Checks for library functions.
AC_OUTPUT(Makefile)
xuchangjing@ubuntu:~/test/test$
3、执行 aclocal 命令,生成 aclocal.m4 autom4te.cache
xuchangjing@ubuntu:~/test/test$ ls
autoscan.log configure.in test.c
xuchangjing@ubuntu:~/test/test$ aclocal
xuchangjing@ubuntu:~/test/test$ cat configure.in
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.67])
AC_INIT(FULL-PACKAGE-NAME, VERSION, BUG-REPORT-ADDRESS)
AC_CONFIG_SRCDIR([test.c])
#AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE(test,1.0)
# Checks for programs.
AC_PROG_CC
# Checks for libraries.
# Checks for header files.
AC_CHECK_HEADERS([stdlib.h])
# Checks for typedefs, structures, and compiler characteristics.
# Checks for library functions.
AC_OUTPUT(Makefile)
xuchangjing@ubuntu:~/test/test$
3、执行 aclocal 命令,生成 aclocal.m4 autom4te.cache
xuchangjing@ubuntu:~/test/test$ ls
autoscan.log configure.in test.c
xuchangjing@ubuntu:~/test/test$ aclocal
剩余7页未读,继续阅读
资源评论
- wenshengzhao2011-10-21将autotools系列工具写的很透彻,适合开源下做工程的同学,
bomeng_21it
- 粉丝: 16
- 资源: 19
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 三次样条插值的介绍-什么是三次样条插值原理
- http的一些相关介绍-对于我们来说什么是http
- 全卷积网络基于voc2012数据集简单pytorch实现
- pycharm的一些介绍-用于更好的学习python
- 基于C++的程序设计大赛天梯赛L2答案(天梯赛)
- 基于python实现的三次样条插值和均值插值法实现
- Python语言教程2-python批量图片大小处理-多文件夹
- Python语言教程1-python批量图片重命名,将后缀某几个不想要的字去除
- Space Combat Kit 太空战斗套件Unity游戏开发插件资源unitypackage C#
- Universal Device Preview 通用设备预览Unity游戏开发插件资源unitypackage
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功