@Autotool example note
[Install Automake]
apt-get install automake
[Create Floder]
mkdir -p /home/splashwork/codes/C/10to2bin/src
mv 10to2.c /home/splashwork/codes/C/10to2bin/src
/home/splashwork/codes/C/10to2bin/src# vim Makefile.am
     bin_PROGRAMS = 10to2                                                                                                                                           
     10to2_SOURCES = 10to2.c
/home/splashwork/codes/C/10to2bin/# vim Makefile.am
SUBDIRS = src
/home/splashwork/codes/C/10to2bin# autoscan
/home/splashwork/codes/C/10to2bin# mv configure.scan configure.ac
/home/splashwork/codes/C/10to2bin# vim configure.ac
     4 AC_PREREQ([2.67])
     5 AC_INIT([FULL-PACKAGE-NAME], [VERSION], [BUG-REPORT-ADDRESS])
     6 AC_CONFIG_SRCDIR([src/10to2.c])
     7 AC_CONFIG_HEADERS([config.h])
     4 AC_PREREQ([2.67])
     5 AC_INIT([10to2], [0.0.1], [xxxx.xx@gmail.com])
     6 AC_CONFIG_SRCDIR([src/10to2.c])
     7 AC_CONFIG_HEADERS([config.h])
/home/splashwork/codes/C/10to2bin# touch config.h.in README NEWS AUTHORS ChangeLog
/home/splashwork/codes/C/10to2bin# aclocal
/home/splashwork/codes/C/10to2bin# automake --add-missing
/home/splashwork/codes/C/10to2bin# autoconf
root@JSL:/home/splashwork/codes/C/10to2bin# ls
AUTHORS  autom4te.cache  autoscan.log  ChangeLog  config.h.in  configure  configure.ac  Makefile.am  NEWS  README  src
[Test Build]
/home/splashwork/codes/C/10to2bin# ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for stdlib.h... (cached) yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating config.h
config.status: executing depfiles commands
/home/splashwork/codes/C/10to2bin# make
(CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/bash /home/splashwork/codes/C/10to2bin/missing --run autoheader)
rm -f stamp-h1
touch config.h.in
cd . && /bin/bash ./config.status config.h
config.status: creating config.h
make  all-recursive
make[1]: Entering directory `/home/splashwork/codes/C/10to2bin'
Making all in src
make[2]: Entering directory `/home/splashwork/codes/C/10to2bin/src'
gcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT 10to2.o -MD -MP -MF .deps/10to2.Tpo -c -o 10to2.o 10to2.c
10to2.c: In function ‘main’:
10to2.c:9: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result
mv -f .deps/10to2.Tpo .deps/10to2.Po
gcc  -g -O2   -o 10to2 10to2.o  
make[2]: Leaving directory `/home/splashwork/codes/C/10to2bin/src'
make[2]: Entering directory `/home/splashwork/codes/C/10to2bin'
make[2]: Leaving directory `/home/splashwork/codes/C/10to2bin'
make[1]: Leaving directory `/home/splashwork/codes/C/10to2bin'
/home/splashwork/codes/C/10to2bin# ./src/10to2
請輸入一個數(十進位):10
1010
[Pack it to tar]
/home/splashwork/codes/C/10to2bin# make dist
{ test ! -d "10to2-0.0.1" || { find "10to2-0.0.1" -type d ! -perm -200 -exec chmod u+w {} ';' && rm -fr "10to2-0.0.1"; }; }
test -d "10to2-0.0.1" || mkdir "10to2-0.0.1"
(cd src && make  top_distdir=../10to2-0.0.1 distdir=../10to2-0.0.1/src \
    am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)
make[1]: Entering directory `/home/splashwork/codes/C/10to2bin/src'
make[1]: Leaving directory `/home/splashwork/codes/C/10to2bin/src'
test -n "" \
   || find "10to2-0.0.1" -type d ! -perm -755 \
       -exec chmod u+rwx,go+rx {} \; -o \
     ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
     ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
     ! -type d ! -perm -444 -exec /bin/bash /home/splashwork/codes/C/10to2bin/install-sh -c -m a+r {} {} \; \
   || chmod -R a+r "10to2-0.0.1"
tardir=10to2-0.0.1 && /bin/bash /home/splashwork/codes/C/10to2bin/missing --run tar chof - "$tardir" | GZIP=--best gzip -c >10to2-0.0.1.tar.gz
{ test ! -d "10to2-0.0.1" || { find "10to2-0.0.1" -type d ! -perm -200 -exec chmod u+w {} ';' && rm -fr "10to2-0.0.1"; }; }
/home/splashwork/codes/C/10to2bin# ls
10to2-0.0.1.tar.gz  AUTHORS         autoscan.log  config.h     config.h.in~  config.status  configure.ac  depcomp  install-sh  Makefile.am  missing  README  stamp-h1
aclocal.m4          autom4te.cache  ChangeLog     config.h.in  config.log    configure      COPYING       INSTALL  Makefile    Makefile.in  NEWS     src
/home/splashwork/codes/C/10to2bin# make distclean
Making distclean in src
make[1]: Entering directory `/home/splashwork/codes/C/10to2bin/src'
test -z "10to2" || rm -f 10to2
rm -f *.o
rm -f *.tab.c
test -z "" || rm -f
test . = "." || test -z "" || rm -f
rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
rm -rf ./.deps
rm -f Makefile
make[1]: Leaving directory `/home/splashwork/codes/C/10to2bin/src'
Making distclean in .
make[1]: Entering directory `/home/splashwork/codes/C/10to2bin'
test -z "" || rm -f
test . = "." || test -z "" || rm -f
rm -f config.h stamp-h1
rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
make[1]: Leaving directory `/home/splashwork/codes/C/10to2bin'
rm -f config.status config.cache config.log configure.lineno config.status.lineno
rm -f Makefile
--------------------------------