一、今天参照GNU hello,终于做出了hello makefile,
已经解决的问题:
1.configure.in:35: required file `config.h.in' not found
ANSWER:在执行automake --add-missing之前执行autoheader,生成config.h.in
2.Makefile.am: required file `./NEWS' not found
Makefile.am: required file `./README' not found
Makefile.am: required file `./AUTHORS' not found
Makefile.am: required file `./ChangeLog' not found
ANSWER:add a command,just like this: touch README NEWS AUTHORS ChangeLog(即在根目录添加)
3.
还没有解决的问题:
1.intl/dcigettext.c:129: warning: getwd is deprecated, use getcwd instead
configure.in: warning: missing AM_GNU_GETTEXT wanted by: intl/intl-compat.c:101
2.configure.in:35: required file `tests/hello.in' not found
3.[leizhige@localhost hello]$ chmod +x tests/hello(我把这条语句去掉了)
chmod: cannot access `tests/hello': No such file or directory
二、####Make a makefile(using gnu automake)####
test
|----- comm
| |---- debug.c
| `----debug.h
|
|---- doc
| |--|-- test.conf
| `--|-- test.man.3
|
|
`---- src
|----test.c
`----test.h
cd /test
autoscan ->configure.scan
mv configure.scan->configure.in
AC_OUTPUT([Makefile comm/Makefile src/Makefile doc/Makefile])
AC_PROG_RANLIB #because use the "lib"
aclocal
autoconf
create Makefile.am,comm/Makefile.am, src/Makefile.am,doc/Makefile.am
顶层的Makefile.am内容如下
SUBDIRS = doc comm src test 这里注意把comm放在src前面
comm/Makefile.am内容如下:
noinst_LIBRARIES=libcomm.a noinst指的是该库不要install到prefix/lib目录下,因为只是一个临时的libcomm_a_lib=debug.h debug.c 注意命名
# src/Makefile.am内容如下
bin_PROGRAMS=test
hello_SOURCES=test.h test.c
doc/Makefile.am内容如下
man_MANS=test.man.3
sysconf_DATA=test.conf
autoheader
automake --add-missing --copy
./configure
make
####complete####
三、生成makefile的步骤:
1) 运行autoscan命令
2) 将configure.scan 文件重命名为configure.in,并修改configure.in文件
3) 在project目录下新建Makefile.am文件,并在子目录下也新建Makefile.am文件
4) 在project目录下新建NEWS、 README、 ChangeLog 、AUTHORS文件
touch NEWS README ChangeLog AUTHORS
5) 将/usr/share/automake-1.8/目录下的depcomp和complie文件拷贝到本目录下
6) 运行aclocal 命令
7) 运行autoconf命令
8) 运行autoheader命令
9) 运行automake --add-missing 命令
10) 运行./confiugre脚本
11) 执行make
分享到:
相关推荐
ubuntu20.04离线dpkg安装automake
免费下载 automake-1.16.1.tar.xz_FreeDownload.zip 文件后,解压此文件即可得到 automake-1.16.1.tar.xz源文件。
autoconf automake 轻松入门
automake 是linux下的自动生成makefile的工具。需要配合auroconf使用 版本:automake-1.9.6.tar.tar
GNU官方的Automake教程,国内的Automake教程大多过时并且抽象,官方教程从零开始,可帮助初学者快速了解Automake的基础知识,熟练驾驭开源项目的automake
autoconf和automake
automake和autoconf英文手册,automake和autoconf英文手册
AutoMake使用总结,如何使用AutoMake!
automake的一个完整例子。 研究automake的例子。当然也包括autoconf。
automake 1.11版本 automake 1.11版本 automake 1.11版本
轻松学automake.pdf—— automake及开源项目软件工程中文基础教程,很实用!
automake-1.11.3.tar.xz
依次执行命令:aclocal,libtoolize -f -c,autoconf,automake --add-missing,./configure,make。 3、cd */project/swap 依次执行命令:aclocal,autoconf,automake --add-missing,./configure,make。 4、cd *...
如何使用automake,如何通过automake构建一个源代码工程
GNU automake documentation file
automake 可以生成两个执行程序:main 和main2 一个automake生成多个执行程序
automake 工具链使用, 有利于makefile的生成
automake-1.9.5-mingwPORT
automake 中文用户手册 GNU Automake For version 1.3, 3 April 1998
使用AutoMake轻松生成Makefile