zoukankan      html  css  js  c++  java
  • AutoMake 学习笔记---使用过程

    AutoMake 学习笔记---使用过程 | 互联网,请记住我

    AutoMake 学习笔记---使用过程

    过程记录:
    1.autoscan
    2.修改configure.scan,重命名为configure.in,编辑Makefile.am
    3.运行aclocal
    4.autoconf
    5.automake –add-missing
    6.好了,你可以configure && make && make install了。

    实例记录:
    1. mkdir h2
    2.cd h2
    3. vim h2.c,内容如下:

    1. #include <stdio.h>
    2. int main()
    3. {
    4.         printf("hi, This is jerry");
    5.         return 0;
    6. }

    4.运行autoscan,将生成autoscan.log和configure.scan
    5.将configure.scan命名为configure.in,并修改:我这里内容如下:

    1. #                                               -*- Autoconf -*-
    2. # Process this file with autoconf to produce a configure script.
    3.  
    4. AC_PREREQ(2.61)
    5. AC_INIT(h2, 1.0,xurenlu@gmail.com)
    6. AC_CONFIG_SRCDIR([h2.c])
    7. AC_CONFIG_HEADER([config.h])
    8. AM_INIT_AUTOMAKE(h2,1.0)
    9.  
    10. # Checks for programs.
    11. AC_PROG_CC
    12.  
    13. # Checks for libraries.
    14.  
    15. # Checks for header files.
    16.  
    17. # Checks for typedefs, structures, and compiler characteristics.
    18.  
    19. # Checks for library functions.
    20. AC_CONFIG_FILES(Makefile)
    21. AC_OUTPUT

    与autoscan生成的文件相比,我加了这两行:

    1. AM_INIT_AUTOMAKE(h2,1.0)
    2.  
    3. AC_CONFIG_FILES(Makefile)

    同时改了这样几行:

    1. AC_INIT(h2, 1.0,xurenlu@gmail.com)

    现在我们编辑Makefile.am:
    内容如下:

    1. AUTOMAKE_OPTIONS=foreign
    2. bin_PROGRAMS=h2
    3. h2_SOURCES=h2.c

    接下来运行aclocal
    此时会生成aclocal.m4和autom4te.cache。
    我们运行:autoconf生成configure文件.
    再运行autohead 生成config.h.in
    最后运行automake –add-missing 就能得到Makefile.in了
    有了这个,就可以configure了。
    在网上搜到这样一个图:

    image002.gif

  • 相关阅读:
    MVP 实战
    Model 层
    Presenter 层
    View 层
    DB数据库的基本操作
    MongoDB数据库基本操作
    转换函数
    字符串函数
    空值处理
    Java中使用Redis的几种数据类型总结
  • 原文地址:https://www.cnblogs.com/lexus/p/2859836.html
Copyright © 2011-2022 走看看