文章出处:http://blog.mcuol.com/User/wangguangdong/Article/17384_1.htm

Makefile.am, Makefile.in, Makefile之间关系以及aclocal, automake, autoconf等命令作用的探究

aclocal   #产生 aclocal.m4
libtoolize --force
automake --add-missing   #根据Makefile.am生成Makefile.in
autoconf   #根据configure.in 生成configure 
autoheader

为了弄清楚automake等一系列命令的作用,专门搜集并阅读了一些相关资料。并通过下面一个小例子,熟悉了一下这些GNU工具的使用:

例子:在/hello/目录下创建一个hello.c文件,并编译运行它:

#cd /hello/

(1) 编写源文件hello.c:

include 
int main(int argc, char** argv)
{
printf("Hello, GNU!n");
return 0;
}

(2) #autoscan 
->生成 configure.scan 和 autoscan.log

(3) 将configure.scan 修改为 configure.in:

# Process this file with autoconf to produce a configure script.
AC_INIT(hello.c)
AM_INIT_AUTOMAKE(hello, 1.0)

# Checks for programs.
AC_PROG_CC

# Checks for library functions.
AC_OUTPUT(Makefile)

(4) #aclocal
->生成 aclocal.m4 和 autom4te.cache (生成aclocal.m4的过程中涉及到configure.in)

(5) #autoconf
->生成 configure (根据 configure.in, 和 aclocal.m4)

(6) 编写Makefile.am:

AUTOMAKE_OPTIONS= foreign
bin_PROGRAMS= hello
hello_SOURCES= hello.c

(7) #automake --add-missing
->生成 Makefile.in, depcomp, install-sh, 和 missing (根据 Makefile.am, 和 aclocal.m4)

(8) #./configure
->生成 Makefile, config.log, 和 config.status

Makefile.am, Makefile.in 与 Makefile的关系(转)的更多相关文章

  1. Linux kernel的 Makefile和Kconfig以及Make menuconfig的关系【转】

    本文转载自:http://blog.sina.com.cn/s/blog_4ba5b45e0102e6vp.html 熟悉内核的Makefile对开发设备驱动.理解内核代码结构都是非常重要的linux ...

  2. Makefile学习与进阶之Makefile.am和$$(M)的意思

    (1)makefile 中,出现$$(M) 是什么意思,发现还是看实际的Makefile长知识啊 在makefile中,会经常使用shell命令,也经常见到$var 和 $$var的情况,有什么区别呢 ...

  3. make 与makefile(会不会写 makefile,从一个侧面说明了一个人是否具备完成大型工程的能力。)

    跟我一起写 Makefile /**/ 陈皓 (CSDN) 概述 —— 什么是makefile?或许很多Winodws的程序员都不知道这个东西,因为那些Windows的IDE都为你做了这个工作,但我觉 ...

  4. make :err Makefile.ssl is older than Makefile.org. Reconfigure the source tree (via './config' or 'perl Configure'), please.

    内核编译时出现错误 Makefile.ssl is older than Makefile.org. Reconfigure the source tree (via './config' or 'p ...

  5. Can't locate Log/Dispatch.pm in @INC /Makefile out-of-date with respect to Makefile.PL

    mha check的时候报错问题解决:   # masterha_check_ssh --conf=/data/mha/app1.cnf Can't locate Log/Dispatch.pm in ...

  6. 【linux】-Makefile简要知识+一个通用Makefile

    目录 Makefile Makefile规则与示例 为什么需要Makefile Makefile样式 先介绍Makefile的两个函数 完善Makefile 通用Makefile的使用 通用的Make ...

  7. makefile自动生成目标与依赖的关系

    有main.c: #include <stdio.h> #include "command.h" int main(int argc, const char *argv ...

  8. Linux C编程学习之开发工具3---多文件项目管理、Makefile、一个通用的Makefile

    GNU Make简介 大型项目的开发过程中,往往会划分出若干个功能模块,这样可以保证软件的易维护性. 作为项目的组成部分,各个模块不可避免的存在各种联系,如果其中某个模块发生改动,那么其他的模块需要相 ...

  9. project管理之makefile与自己主动创建makefile文件过程

    (风雪之隅 http://www.laruence.com/2009/11/18/1154.html) Linux Makefile自己主动编译和链接使用的环境 想知道到Linux Makefile系 ...

  10. 代码片段--Makefile之大型工程项目子目录Makefile的一种通用写法

    转载:http://blog.csdn.net/mo_hui123456/article/details/8929615 管理Linux环境下的C/C++大型项目,如果有一个智能的Build Syst ...

随机推荐

  1. python登陆github

    #!/usr/bin/env python # encoding: utf-8 import requests from headers import headers from lxml import ...

  2. python搭建区块链

    #!/usr/bin/env python # encoding: utf-8 ''' 我们要创建一个 Blockchain 类 ,他的构造函数创建了一个初始化的空列表(要存储我们的区块链),并且另一 ...

  3. shiro多realm验证之——shiro实现不同身份使用不同Realm进行验证(转)

    转自: http://blog.csdn.net/xiangwanpeng/article/details/54802509 (使用特定的realm实现特定的验证) 假设现在有这样一种需求:存在两张表 ...

  4. 2.tornado请求与响应

    之前我们介绍了tornado的基础流程,但还遗留了一些问题.今天我们就来解决遗留问题并学习新的内容 settings,使用tornado.web.Application(handler, **sett ...

  5. jmeter 多机负载压测与服务器性能监测

    环境: jmeter: apache-jmeter-3.3 jdk: 负载生成: 被测机: 一. 多机负载压测: 概述: 1.修改jmeter.properties配置文件 remote_hosts= ...

  6. 【原创】SQL Server Job邮件详细配置

    1 简介 SQL Server 代理具有发送电子邮件的功能.您可以配置 SQL Server 代理邮件,使其在出现下列情况时向预定义的操作员发送电子邮件: 警报触发时.可以配置警报,以针对所发生的特定 ...

  7. laravel-u-editor工具栏语言切换的方法

    更改/config/app.php/locale,可支持en,zh_CN,zh_TW,我们一般设为zh_CN

  8. 几何【P2313】 [HNOI2005]汤姆的游戏

    顾z 你没有发现两个字里的blog都不一样嘛 qwq 题目描述--->p2313 [HNOI]汤姆的游戏 分析 说不上是分析. 数据范围给出来,这题明显暴力啊emmm. 个人认为的坑点. 这题不 ...

  9. Linq 连接运算符:Concat,Union

    //Concat()方法附加两个相同类型的序列,并返回一个新序列(集合)IList<string> strList = new List<string>() { "O ...

  10. HTML表格基础详解

    在现在 div 大行其道的时代,table 这个标签似乎很少被人提及,到处都是 div+css 布局的书以及博客文章,但其实 table 以及连带的其他表格标签依然在网页中占很重要的地位,特别是后台展 ...