2013년 11월 3일 일요일

Automake 사용

Automake 사용

  1. 준비물 (configure.ac, Makefile.am 파일 필요)
    1. configure.ac파일의 내용은 아래와 같이 획득할 수 있다.
      automake]$ autoscan
      automake]$ cp configure.scan configure.ac
      automake]$ vi configure.ac


      1. configure.ac의 내용 수정.

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

        AC_PREREQ([2.68])
        #AC_INIT([FULL-PACKAGE-NAME], [VERSION], [BUG-REPORT-ADDRESS]) # 아래와 같이 변경.
        AC_INIT([hello], [1.0.0], [bullseye@infraware.co.kr])
        AC_CONFIG_SRCDIR([src/hello.c])
        AC_CONFIG_HEADERS([config.h])

        AM_INIT_AUTOMAKE([-Wall -Werror foreign]) # 추가
        # 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
        src/Makefile])
        AC_OUTPUT

    2. Makefile.am 의 내용

      bin_PROGRAMS	= hello
      hello_SOURCE = hello.c

  2. 동작순서.

    1. autoscan 를 실행 후 configure.scan 파일로 configure.ac 복사 후 아래 내용보고 편집한다.

      #AC_INIT([FULL-PACKAGE-NAME], [VERSION], [BUG-REPORT-ADDRESS])
      AC_INIT([hello], [1.0.0], [bullseye@infraware.co.kr]) # 변경내용

      AM_INIT_AUTOMAKE([-Wall -Werror foreign]) # 추가내용

    2. configure 생성.

      $ autoreconf --install

    3. compile

      $ ./configure
      $ make

댓글 없음:

댓글 쓰기