linux 下 automake 生成 makefile

来源:互联网 发布:jquery confirm.js 编辑:程序博客网 时间:2024/06/08 16:09
1.autoscan产生 autoscan.log   configure.scan2.mv configure.scan configure.in3.vim configure.in原始#                                               -*- Autoconf -*-# Process this file with autoconf to produce a configure script.AC_PREREQ([2.63])AC_INIT([FULL-PACKAGE-NAME], [VERSION], [BUG-REPORT-ADDRESS])AC_CONFIG_SRCDIR([main.cpp])AC_CONFIG_HEADERS([config.h])# Checks for programs.AC_PROG_CXXAC_PROG_CC# Checks for libraries.# Checks for header files.# Checks for typedefs, structures, and compiler characteristics.# Checks for library functions.AC_OUTPUT修改为#                                               -*- Autoconf -*-# Process this file with autoconf to produce a configure script.AC_PREREQ([2.63])AC_INIT([main], [1.0], [])AC_CONFIG_SRCDIR([main.cpp])AC_CONFIG_HEADERS([config.h])AM_INIT_AUTOMAKE(main,1.0)# Checks for programs.AC_PROG_CXXAC_PROG_CC# Checks for libraries.# Checks for header files.# Checks for typedefs, structures, and compiler characteristics.# Checks for library functions.AC_OUTPUT([        Makefile        model/Makefile        ])4.aclocal 产生 aclocal.m4   autom4t3.cache 5.autoconf产生 configure6.autoheader产生 config.h.in7.vim Makefile.am在有源码的文件夹下都新建一个 Makefile.am 文件主目录bin_PROGRAMS=mainmain_SOURCES=main.cppmain_LDADD=$(top_srcdir)/model/header.omain_LDFLAGS=-D_GNU_SOURCEDEFS+=-D_GNU_SOURCEexport INCLUDE子目录bin_PROGRAMS=mainmain_SOURCES=header.cppDEFS+=-D_GNU_SOURCE其它选项等INCLUDES=-I$(top_srcdir)/include -I$(top_srcdir)/sourcemain_DEPENDENCIES = $(top_builddir)/source/libnetserver.amain_LDADD=-lpthread -lXXXXX8.touch NEWS  README  AUTHORS ChangeLog9.automake –add-missing10../configure11.make12.如果涉及到  .deps  问题, 需要在  .deps 下新建目录