Home > programming > 速攻automake

速攻automake

何回やっても覚えられないので最低限のことだけ。

  1. ソースファイルを作る。

    #include <stdio.h>
    #include "config.h"
    
    
    int
    main(int argc, char **argv)
    {
        printf("hello, world\n");
        return 0;
    }
    
  2. (どうせ捨てるけど)Makefile も作っておく。空でいい。

  3. autoscan を実行し、できた configure.scan を configure.ac にコピー。

  4. configure.ac を編集。AC_INIT を直すのと、AM_INIT_AUTOMAKE を追加。

  5. aclocal, autoconf, autoheader を実行。

    #                                               -*- 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(hello, 0.0.0, iakio@mono-space.net)
    AC_CONFIG_SRCDIR([hello.c])
    AC_CONFIG_HEADER([config.h])
    AM_INIT_AUTOMAKE
    
    
    # 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
    
  6. Makefile.am を作る

    bin_PROGRAMS = hello
    hello_SOURCES = hello.c
    
  7. automake --foreign --add-missing

Writeback:0

Comment Form

writeback message: Ready to post a comment.

TrackBack ping me at
http://www.mono-space.net/blog/programming/e061222_automake.trackback

Page Top