已经存在Makefile.am,如何生成Makefile?

步骤:

  1. [root@localhost hello]# autoscan .///在当前文件夹中搜索
  2. [root@localhost hello]# cp configure.scan configure.ac //复制文件
  3. [root@localhost hello]# vi configure.ac //编辑文件
  4. 编辑configure.ac,加入下面一行:
  5. AM_INIT_AUTOMAKE(hello,1.0)      //automake所必备的宏,必须添加
  6. [root@localhost hello]# aclocal     //执行aclocal生成aclocal.m4文件
  7. [root@localhost hello]# autoconf   //执行autoconf生成configure文件
  8. [root@localhost hello]# autoheader
  9. [root@localhost hello]# automake --add-missing
  10. [root@localhost hello]# touch NEWS; touch README; touch AUTHORS; touch ChangeLog    //创建NEWS等文件,如果没有自动生成,手工创建
  11. [root@localhost hello]# automake --add-missing //再运行一次
  12. [root@localhost hello]# ./configure    //配置,生成Makefile文件
  13. [root@localhost hello]# make     //执行make命令

以上过程可能出现一些警告,请忽略。最后,给出一个Makefile.am的内容作为例子:

  1. AM_LDFLAGS = -lpthread -lc -lm -lrt -ldl
  2. CXXFLAGS = -D__STDC_LIMIT_MACROS -g -Wall -DORDER_SERIALIZE #-O2 -fno-strict-aliasing
  3. bin_PROGRAMS = parser_main
  4. parser_main_SOURCES = parser_main.cpp \
  5. Parser.cpp \
  6. Lexer.cpp \
  7. SelectStmt.cpp \
  8. InsertStmt.cpp \
  9. UpdateStmt.cpp \
  10. DeleteStmt.cpp \
  11. Stmt.cpp \
  12. Expr.cpp \
  13. Identifier.cpp
  14. ~

参考文献:

http://os.51cto.com/art/201006/207098.htm

http://os.51cto.com/art/201006/207099.htm

http://os.51cto.com/art/201006/207101.htm

如何写Makefile.am

懒人学习automake, Makefile.am,configure.ac的更多相关文章

  1. 懒人学习automake, Makefile.am,configure.ac(转)

    已经存在Makefile.am,如何生成Makefile? 步骤: [root@localhost hello]# autoscan .///在当前文件夹中搜索 [root@localhost hel ...

  2. automake中Makefile.am和configure.ac的格式及编译过程

    step1:写Makefile.am step2:执行autoscan,会生成configurae.scan,修改configure.scan内容之后,命名为configure.ac step3:执行 ...

  3. configure.ac和Makefile.am的格式解析概述

    1. configure.ac和Makefile.am的格式解析概述 1.1. Autotools相关工具链 1.1.1. Autotools 1.1.2. 其他相关工具 1.2. 工具链的流程 1. ...

  4. C# 嵌入dll 动软代码生成器基础使用 系统缓存全解析 .NET开发中的事务处理大比拼 C#之数据类型学习 【基于EF Core的Code First模式的DotNetCore快速开发框架】完成对DB First代码生成的支持 基于EF Core的Code First模式的DotNetCore快速开发框架 【懒人有道】在asp.net core中实现程序集注入

    C# 嵌入dll   在很多时候我们在生成C#exe文件时,如果在工程里调用了dll文件时,那么如果不加以处理的话在生成的exe文件运行时需要连同这个dll一起转移,相比于一个单独干净的exe,这种形 ...

  5. 如何根据configure.ac和Makefile.am为开源代码产生当前平台的Makefile

    1 2 3 4 5 6 7 8 9 //根据configure.in和Makefile.am生成makefile的步骤,基于UBUNTU 12.04 1.autoscan (可选) 2.aclocal ...

  6. 关于Makefile,Makefile.in,Makefile.am,Configure功能及相互关系的问题

    makefile写法 在 Unix 上写程式的人大概都碰过 Makefile,尤其是用 C 来开发程式的人.用 make来开发和编译程式的确很方便,可是要写出一个 Makefile就不简单了.偏偏介绍 ...

  7. 编写configure.ac

    configure.ac由一些宏组成(如果已经有源代码,你可以运行autoscan来产生一个configure.scan文件,在此基础修改成configure.ac将更加方便) 最基本的组成可以是下面 ...

  8. 源码编译Redis Desktop Manager | 懒人屋

    原文:源码编译Redis Desktop Manager | 懒人屋 源码编译Redis Desktop Manager  2.3k  字    10  分钟    2019-10-10 文章背景 本 ...

  9. 【转】[教程]在 win7 / win8 下安装苹果系统 (懒人版)

    前言   这篇安装教程的素材在国庆就准备好了,但那时学习任务比较重,没有时间发帖,一直拖到现在.趁这个周末有空,赶紧写完它,希望能帮助一些景友. 论坛已经有不少安装教程,如果对这篇安装教程有疑问可以去 ...

随机推荐

  1. nginx平滑升级实战

    Nginx 平滑升级 1.查看旧版Nginx的编译参数 [root@master ~]# /usr/local/nginx/sbin/nginx -V [root@master ~]# ll ngin ...

  2. linux(Ubuntu16)下切换python2和python3(转)

    采用update-alternatives 切换版本 1.打开终端:Ctrl+Alt+T 2.查看update-alternatives的帮助信息:update-alternatives --help ...

  3. js中的三种弹框分别是alert(),confirm(),prompt()

    1.alert(): ①写在<script>标签中 ②括号中的内容为字符串或者整型 ③点击确认即可关闭,无返回值 2.confirm(): ①写在<script>标签中 ②括号 ...

  4. 2.Linux文件IO编程

    2.1Linux文件IO概述 2.1.0POSIX规范 POSIX:(Portable Operating System Interface)可移植操作系统接口规范. 由IEEE制定,是为了提高UNI ...

  5. Spring核心技术(三)——Spring的依赖及其注入(续)

    本文将继续前文,针对依赖注入的细节进行描述 依赖注入细节 如前文所述,开发者可以通过定义Bean的依赖的来引用其他的Bean或者是一些值的,Spring基于XML的配置元数据通过支持一些子元素< ...

  6. springboot 生产环境不能访问swagger

    @Profile({"local", "dev", "test"}) local,dev, test 分支都可以访问swagger

  7. 关于 CMSIS 标准 及 STM32F10x的固件库

    CMSIS 标准英文全称是Cortex MicroController Software Interface Standard,翻译为中文意思就是 ARM Cortex 微控制器软件接口标准. 由于基 ...

  8. 关于${ctx}拿不到值的问题

    当项目开发时我们喜欢用 <c:set var="ctx" value="${pageContext.request.contextPath}"/>来 ...

  9. [洛谷P1114] “非常男女”计划

    题目描述 近来,初一年的XXX小朋友致力于研究班上同学的配对问题(别想太多,仅是舞伴),通过各种推理和实验,他掌握了大量的实战经验.例如,据他观察,身高相近的人似乎比较合得来. 万圣节来临之际,XXX ...

  10. cogs—— 310. [POJ2395] Out of Hay

    310. [POJ2395] Out of Hay ★☆   输入文件:outofhay.in   输出文件:outofhay.out   简单对比 时间限制:1 s   内存限制:128 MB De ...