beyes@linux-beyes:~/C/Make> which aclocal
/usr/bin/aclocal
beyes@linux-beyes:~/C/Make> which autoscan
/usr/bin/autoscan
beyes@linux-beyes:~/C/Make> which autoconf
/usr/bin/autoconf
beyes@linux-beyes:~/C/Make> which autoheader
/usr/bin/autoheader
beyes@linux-beyes:~/C/Make> which automake
/usr/bin/automake
beyes@linux-beyes:~/C/Make> ls
fun.c head.h hello.c
# -*- 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([fun.c])
AC_CONFIG_HEADERS([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_OUTPUT
beyes@linux-beyes:~/C/Make> rpm -q autoconf
autoconf-2.63-1.97
AC_INIT
测试程序
测试函数库
测试头文件
测试类型定义
测试结构
测试编译器特性
测试库函数
测试系统调用
AC_OUTPUT
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.63])
AC_INIT(hello, 1.0, l4nneret@163.com)
AC_CONFIG_SRCDIR([hello.c])
AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE(hello,1.0)
# 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
beyes@linux-beyes:~/C/Make/mktst> ls
aclocal.m4 autoscan.log configure.in head.h
autom4te.cache configure fun.c hello.c
beyes@linux-beyes:~/C/Make/mktst> autoconf
beyes@linux-beyes:~/C/Make/mktst> ls
aclocal.m4 autoscan.log configure.in head.h
autom4te.cache configure fun.c hello.c
beyes@linux-beyes:~/C/Make/mktst> autoheader
beyes@linux-beyes:~/C/Make/mktst> ls
aclocal.m4 autoscan.log configure fun.c hello.c
autom4te.cache config.h.in configure.in head.h
beyes@linux-beyes:~/C/Make/mktst> cat config.h.in
/* config.h.in. Generated from configure.in by autoheader. */
/* Name of package */
#undef PACKAGE
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Version number of package */
#undef VERSION
AUTOMAKE_OPTIONS=foreign
bin_PROGRAMS=hello
hello_SOURCES=hello.c fun.c head.h
beyes@linux-beyes:~/C/Make/mktst> automake --add-missing
beyes@linux-beyes:~/C/Make/mktst> ls
aclocal.m4 autoscan.log configure fun.c hello.c Makefile.in
autom4te.cache config.h.in configure.in head.h Makefile.am
beyes@linux-beyes:~/C/Make/mktst> ./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... gawk
checking whether make sets $(MAKE)... yes
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
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
configure: creating ./config.status
config.status: creating Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
beyes@linux-beyes:~/C/Make/mktst> make
make all-am
make[1]: Entering directory `/home/beyes/C/Make/mktst'
gcc -DHAVE_CONFIG_H -I. -g -O2 -MT fun.o -MD -MP -MF .deps/fun.Tpo -c -o fun.o fun.c
mv -f .deps/fun.Tpo .deps/fun.Po
gcc -g -O2 -o hello hello.o fun.o
make[1]: Leaving directory `/home/beyes/C/Make/mktst'
beyes@linux-beyes:~/C/Make/mktst> ./hello
hello Makefile world
num is: 138
man is: 178
beyes@linux-beyes:~/C/Make/mktst> ls
aclocal.m4 config.h.in configure.in hello Makefile.am
autom4te.cache config.log fun.c hello.c Makefile.in
autoscan.log config.status fun.o hello.o stamp-h1
config.h configure head.h Makefile
beyes@linux-beyes:~/C/Make/mktst> make clean
test -z "hello" || rm -f hello
rm -f *.o
beyes@linux-beyes:~/C/Make/mktst> ls
aclocal.m4 config.h config.status fun.c Makefile stamp-h1
autom4te.cache config.h.in configure head.h Makefile.am
autoscan.log config.log configure.in hello.c Makefile.in
beyes@linux-beyes:~/C/Make/mktst> make dist
{ test ! -d hello-1.0 || { find hello-1.0 -type d ! -perm -200 -exec chmod u+w {} ';' && rm -fr hello-1.0; }; }
test -d hello-1.0 || mkdir hello-1.0
find hello-1.0 -type d ! -perm -777 -exec chmod a+rwx {} \; -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/sh /home/beyes/C/Make/install-sh -c -m a+r {} {} \; \
|| chmod -R a+r hello-1.0
tardir=hello-1.0 && /bin/sh /home/beyes/C/Make/missing --run tar chof - "$tardir" | GZIP=--best gzip -c >hello-1.0.tar.gz
{ test ! -d hello-1.0 || { find hello-1.0 -type d ! -perm -200 -exec chmod u+w {} ';' && rm -fr hello-1.0; }; }
beyes@linux-beyes:~/C/Make/mktst> ls
aclocal.m4 config.h.in configure.in hello-1.0.tar.gz Makefile.am
autom4te.cache config.log depcomp hello.c Makefile.in
autoscan.log config.status fun.c install-sh missing
config.h configure head.h Makefile stamp-h1
欢迎光临 曲径通幽论坛 (http://www.groad.net/bbs/) | Powered by Discuz! X3.2 |