懒人学习automake, Makefile.am,configure.ac

简介: 已经存在Makefile.am,如何生成Makefile?   步骤:   [plain] view plain copy   [root@localhost hello]# autoscan .

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

 

步骤:

 

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



 

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

 

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



 

 

参考文献:

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

目录
相关文章
|
7天前
|
监控 Linux
yum install -y net-snmp-devel 安装不成功 zabbix项目安装,Errors during downloading metadata for repository ‘extras-common’:问题解决方案-优雅草卓伊凡
yum install -y net-snmp-devel 安装不成功 zabbix项目安装,Errors during downloading metadata for repository ‘extras-common’:问题解决方案-优雅草卓伊凡
42 13
yum install -y net-snmp-devel 安装不成功 zabbix项目安装,Errors during downloading metadata for repository ‘extras-common’:问题解决方案-优雅草卓伊凡
|
编译器
Qt没有被正确安装,请运行make install -- 问题的解决办法
Qt没有被正确安装,请运行make install -- 问题的解决办法
1320 0
Makefile.am:1: error: Libtool library used but 'LIBTOOL' is undefined
Makefile.am:1: error: Libtool library used but 'LIBTOOL' is undefined
370 0
编译OpenJDK8:configure: could not find or use freetype at location
编译OpenJDK8:configure: could not find or use freetype at location
178 0
|
C语言
编译OpenJDK8:configure error /usr/lib64/ccache/gcc is a symbolic link to ccache
编译OpenJDK8:configure error /usr/lib64/ccache/gcc is a symbolic link to ccache
148 0
|
XML IDE Java
编程开发中的Compile、Make、Build详细对比
编程开发中的Compile、Make、Build详细对比
436 0
编程开发中的Compile、Make、Build详细对比
|
关系型数据库 MySQL Linux
编译tars的时候找不到libmysqlclient.a静态库
获取MariaDB源码 下载相应源码,下载地址mariadb-5.5.56.tar.gz 下载后传到虚拟机中,解压然后编译。
245 0
|
C语言
没有安装gcc,导致提示configure cannot guess build type; you must specify one
没有安装gcc,导致提示configure cannot guess build type; you must specify one
197 0

热门文章

最新文章