懒人学习automake, Makefile.am,configure.ac(转)
已经存在Makefile.am,如何生成Makefile?
步骤:
-
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的内容作为例子:
-
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
联系方式:emhhbmdfbGlhbmcxOTkxQDEyNi5jb20=
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· DeepSeek 开源周回顾「GitHub 热点速览」
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了