LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1298|回复: 3

automake 无法生成 Makefile.in

[复制链接]
发表于 2009-3-22 09:50:08 | 显示全部楼层 |阅读模式
写了个程序“11.c”:
#include <stdio.h>
int main(int argc,char** argv)
{
        printf("Found the answer!\n");
        return 0;
}

以下是为了生成Makefile的过程:

$ autoscan
生成的configure.scan改成configure.in,内容改为
  1. #                                               -*- Autoconf -*-
  2. # Process this file with autoconf to produce a configure script.
  3. AC_PREREQ(2.61)
  4. AC_INIT(11, 0.1, miraclecome@gmail.com)
  5. AC_CONFIG_SRCDIR([11.c])
  6. AC_CONFIG_HEADER([config.h])
  7. AM_INIT_AUTOMAKE(11, 0.1)
  8. # Checks for programs.
  9. AC_PROG_CC
  10. # Checks for libraries.
  11. # Checks for header files.
  12. # Checks for typedefs, structures, and compiler characteristics.
  13. # Checks for library functions.
  14. AC_CONFIG_FILES([Makefile])
  15. AC_OUTPUT(makefile)
复制代码
$ aclocal
$ autoheader
$ autoconf

$ vi Makefile.am
bin_PROGRAMS=11
11_SOURCES=11.c

$ touch NEWS README ChangeLog AUTHORS
$ automake -a
configure.in:22: required file `makefile.in' not found

出来一句提示,但是没有生成makefile.in
我不知道是什么原因,但是看网上教程都是会生成makefile.in的。
求教,求教。
发表于 2009-3-23 01:19:32 | 显示全部楼层
在你的configure.in中AC_OUTPUT(makefile)错了,应该是AC_OUTPUT

另外,生成Makefile的步骤有问题,应该是这样的:
  1. touch NEWS README AUTHORS ChangeLog
  2. aclocal
  3. autoheader
  4. automake --add-missing --copy
  5. autoconf
  6. ./configure
复制代码
这样就会有Makefile了,Makefile是在你./configure后生成的,不是在AC_OUTPUT里加的。你在AC_CONFIG_FILES中已经说Makefile了.
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-3-23 12:24:59 | 显示全部楼层
不是在AC_OUTPUT里加的。你在AC_CONFIG_FILES中已经说Makefile了.
Right!
Order is not important.

Thank you very much.
回复 支持 反对

使用道具 举报

发表于 2009-3-24 08:39:00 | 显示全部楼层
不 客 气
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表