automake的使用

automake生成makefile文件
1、编译参考
参考链接:https://blog.csdn.net/lee244868149/article/details/42241061(里面存在部分问题,所以参考后面的部分)
链接:(编译文件的生成和文件的修改参考)https://blog.csdn.net/vevenlcf/article/details/9411109?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522160242248819724848341667%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fblog.%2522%257D&request_id=160242248819724848341667&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2blogfirst_rank_v2~rank_blog_default-2-9411109.pc_v2_rank_blog_default&utm_term=automake&spm=1018.2118.3001.4187

步骤:
1、执行 autoscan
2、 编辑configure.scan
#vim configure.scan
1 # -- Autoconf --
2 # Process this file with autoconf to produce a configure script.
3
4 AC_PREREQ([2.69])
5 #AC_INIT([FULL-PACKAGE-NAME], [VERSION], [BUG-REPORT-ADDRESS])
6
7 #####1
8 #AC_CONFIG_SRCDIR([hello.c])
9
10 #####2
11 #AC_INIT([hello.c])
12 #AM_INIT_AUTOMAKE(helloworld, 1.0)
13
14 #####3
15 AC_INIT(hello,1.0)
16 AM_INIT_AUTOMAKE(hello,1.0)
17 AC_CONFIG_SRCDIR([hello.c])
18
19 AC_CONFIG_HEADER([config.h])
20
21
22 # Checks for programs.
23 AC_PROG_CC
24
25 # Checks for libraries.
26
27 # Checks for header files.
28
29 # Checks for typedefs, structures, and compiler characteristics.
30
31 # Checks for library functions.
32
33 AC_OUTPUT(Makefile)

然后将文件改名:执行

mv configure.scan configure.in

cp configure.in configure.ac

3、执行命令
然后执行:
#aclocal
#autoconf

autoheader

4、 automake
编辑 Makefile.am文件
#vim Makefile.am
1 AUTOMAKE_OPTIONS=foreign
2 bin_PROGRAMS=hello
3 hello_SOURCES=hello.c
4 # LIBS += -lm -lz -lmysqlclient_r]
执行:生成Makefile
#automake -–add-missing

5、 #./configure

6、# make

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值