自动生成Makefile的全过程详解

https://blog.csdn.net/u011857683/article/details/82026809
编写源代码
使用autoscan命令来帮助我们根据目录下的源代码生成一个configure.in的模板文件
现在将configure.scan改名为configure.ac并且修改

     #                                               -*- Autoconf -*-  
    # Process this file with autoconf to produce a configure script.  

    AC_PREREQ(2.59)  
    #AC_INIT(FULL-PACKAGE-NAME, VERSION, BUG-REPORT-ADDRESS)  
    AC_INIT(str, 0.0.1, [bug@sounos.org])  
    AM_INIT_AUTOMAKE  
    AC_CONFIG_SRCDIR([include/str.h])  
    AC_CONFIG_HEADER([config.h])  

    # Checks for programs.  
    AC_PROG_CC  

    # Checks for libraries.  

    # Checks for header files.  

    # Checks for typedefs, structures, and compiler characteristics.  

    # Checks for library functions.  
    AC_CONFIG_FILES([Makefile])  
    AC_OUTPUT   

执行aclocal
制作Makefile.am
    AUTOMAKE_OPTIONS=foreign
    bin_PROGRAMS=helloworld
    helloworld_SOURCES=helloworld.c
autoheader
automake -a
autoconf
完毕
全部评论

相关推荐

醉蟀:你不干有的是人干
点赞 评论 收藏
分享
每晚夜里独自颤抖:这个在牛客不是老熟人了吗
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务