cvs ( Concurrent Version System )是一个版本控制系统,什么是版本控制系统呢?简单的说,它可以记录程序代码修改的过程,有一个完整的历史记录( history )。辟如说,当你在修改程序代码的时候, 不小心写出了一个 bug,但是你可能很久以后才发现多出了这个 bug, 这个时候,cvs 就能很有效的帮助你找出到底是在哪一次的修改中,出现了这个 bug。
dnl Process this file with Autoconf to produce a configure script.
AC_INIT(hello.c)
AM_INIT_AUTOMAKE(hello, 1.0)
dnl Checks for programs.
AC_PROG_CC
dnl Checks for libraries.
dnl Checks for header files.
dnl Checks for typedefs, structures, and compiler characteristics.
dnl Checks for library functions.
AC_OUTPUT(Makefile)
% ./configure
creating cache ./config.cache
checking for a BSD compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking whether make sets ${MAKE}... yes
checking for working aclocal... found
checking for working Autoconf... found
checking for working Automake... found
checking for working autoheader... found
checking for working makeinfo... found
checking for gcc... gcc
checking whether the C compiler (gcc ) works... yes
checking whether the C compiler (gcc ) is a cross-compiler... no
checking whether we are using GNU C... yes
checking whether gcc accepts -g... yes
updating cache ./config.cache
creating ./config.status
creating Makefile
make all
产生设定的目标,既范例中的可执行文件。只敲入make 也可以,此时会开始编译源代码,然后连接并产生执行文件。
make clean
清除之前所编译的可执行文件及目标文件(object file, *.o)。
make distclean
除了清除可执行文件和目标文件以外,也把 configure 所产生的 Makefile 清除掉。 通常在发布软件前执行该命令。
make install
将程序安装到系统中,若源码编译成功,且执行结果正确,便可以把程序安装到系统预先设定的执行文件存放路径中,若用 bin_PROGRAMS 宏的话,程序会被安装到 /usr/local/bin下。
make dist
将程序和相关的文档包装为一个压缩文档以供发布 (distribution) 。执行完在目录下会产生一个以
PACKAGE-VERSION.tar.gz 为名称的文件。PACKAGE 和 VERSION 这两个参数是根据 configure.in 文中
AM_INIT_AUTOMAKE(PACKAGE, VERSION) 的定义。在我们的例子中会产生 'hello-1.0.tar.gz' 的文件。
make distcheck
和 make dist 类似,但是加入检查包装以后的压缩文件是否正常,这个目标除了把程序和相关文档包装成 tar.gz 文件外,还会自动把这个压缩文件解开,执行 configure,并执行 make all ,确认编译无错误以后,方显示这个 tar.gz 文件已经准备好并可以发布了。当你看到:
==========================================
hello-1.0.tar.gz is ready for distribution
==========================================