自动生成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
完毕