normal use for autotools

1. remove temporary files, only used for test purpose.

 ls | sed -e "/^term.sh$/d" | sed -e "/^test.cpp$/d" | sed -e "/^Makefile.am$/d" | sed -e "/^autogen.sh$/d" | xargs -n 1 rm -rf

2. edit autogen.sh

echo "automatic generating configure.scan ......"
autoscan

echo "modifing configure.scan to configure.ac ......"
sed -e "/AC_INIT/a
    AM_INIT_AUTOMAKE" configure.scan > configure.ac

echo "automatic generating config.in.h ......"
autoheader

echo "aclocal ......"
aclocal

echo "creating files: README, AUTHORS, NEWS, ChangLog ......"
touch README AUTHORS NEWS ChangeLog

echo "Daniel King(long123king@163.com)" > AUTHORS
echo "0.0.1" > ChangeLog
echo -e " Automatic make" >> ChangeLog
echo -e " Need to edit Makefile.am manually first" >> ChangeLog

echo "automake ......"
automake --add-missing --copy

echo "autoconf ......"
autoconf

echo "./configure"
./configure

echo "make"
echo "##############################################################################"
make
echo "##############################################################################"

3. run autogen.sh

bash autogen.sh
原文地址:https://www.cnblogs.com/long123king/p/3754760.html