ºìÁªLinuxÃÅ»§
Linux°ïÖú

ÇáÇáËÉËɲúÉú Makefile

·¢²¼Ê±¼ä:2006-09-05 19:44:48À´Ô´:ºìÁª×÷Õß:lgms2008
¡¡¡¡ÔÚ Unix ÉÏд³ÌʽµÄÈË´ó¸Å¶¼Åö¹ý Makefile£¬ÓÈÆäÊÇÓà C À´¿ª·¢³ÌʽµÄÈË¡£Óà make À´¿ª·¢ºÍ±àÒë³ÌʽµÄÈ·ºÜ·½±ã£¬¿ÉÊÇҪд³öÒ»¸ö Makefile¾Í²»¼òµ¥ÁË¡£Æ«Æ«½éÉÜ Makefile µÄÎļþ²»¶à£¬GNU Make ÄÇ·ÝÓ¡³öÀ´Òª¼¸°ÙÒ³µÄÎļþ£¬¹â¿´Íê Overview ¾Í¿ìÕóÍöÁË£¬ÄѹÖÐí¶àÈËÎÅ Unix É«±ä¡£±¾ÎĽ«½éÉÜÈçºÎÀûÓà GNU Autoconf ¼° Automake ÕâÁ½Ì×ÈíÌåÀ´Ð­ÖúÎÒÃÇ¡º×Ô¶¯¡»²úÉú Makefile µµ£¬²¢ÇÒÈÿª·¢³öÀ´µÄÈíÌå¿ÉÒÔÏñ Apache,MySQL ºÍ³£¼ûµÄ GNU ÈíÌåÒ»Ñù£¬Ö»Òª»á ``./configure'', ``make'',``make install'' ¾Í¿ÉÒ԰ѳÌʽ°²×°µ½ÏµÍ³ÖС£Èç¹ûÄúÓÐÐÄ¿ª·¢ OpenSource µÄÈíÌ壬»òÖ»ÊÇÏëÔÚ Unix ϵͳÏÂдд³Ìʽ¡£Ï£ÍûÕâ·Ý½éÉÜÎļþÄÜ°ïÖúÄúÇáËɵؽøÈë Unix Programming µÄµîÌá£
1. ¼ò½é
¡¡¡¡Makefile »ù±¾ÉϾÍÊÇ¡ºÄ¿±ê¡»(target), ¡º¹ØÁ¬¡»(dependencies) ºÍ¡º¶¯×÷¡»ÈýÕßËù×é³ÉµÄÒ»Á¬´®¹æÔò¡£¶ø make ¾Í»á¸ù¾Ý Makefile µÄ¹æÔòÀ´¾ö¶¨ÈçºÎ±àÒë (compile) ºÍÁ¬½á (link) ³Ìʽ¡£Êµ¼ÊÉÏ£¬make ¿É×öµÄ²»Ö»ÊDZàÒëºÍÁ¬½á³Ìʽ£¬ÀýÈç FreeBSD µÄ port collection ÖУ¬Makefile »¹¿ÉÒÔ×öµ½×Ô¶¯ÏÂÔØԭʼ³ÌʽÌ×¼þ£¬½âѹËõ (extract) £¬ÐÞ²¹(patch)£¬É趨£¬È»áá±àÒ룬°²×°ÖÁϵͳÖС£
¡¡¡¡Makefile »ù±¾¹¹ÔìËäÈ»¼òµ¥£¬µ«ÊÇÍ×ÉÆÔËÓÃÕâЩ¹æÔò¾ÍÒ²¿ÉÒÔ±ä³öÐí¶à²»Í¬µÄ»¨ÕС£È´Ò²Òò´Ë£¬Ðí¶à¸Õ¿ªÊ¼Ñ§Ï°Ð´ Makefile ʱ»á¸Ðµ½Ã»Óй淶¿ÉÑ­£¬Ã¿¸öÈËд³öÀ´µÄ Makefile ³¤µÃ¶¼²»Ì«Ò»Ñù£¬²»ÖªµÀ´ÓºÎÏÂÊÖ£¬¶øÇÒ³£³£»áÊÜÏÞì¶×Ô¼ºµÄ¿ª·¢»·¾³£¬Ö»Òª»·¾³±äÊý²»Í¬»ò·¾¶¸Äһϣ¬¿ÉÄÜMakefile ¾ÍµÃ¸ú×ÅÐ޸ġ£ËäÈ»ÓÐ GNU Makefile Conventions (GNUMakefile ¹ßÀý) ¶©³öһЩʹÓà GNU ³ÌʽÉè¼Æʱ׫д Makefile µÄһЩ±ê×¼ºÍ¹æ·¶£¬µ«ÊÇÄÚÈݺܳ¤¶øÇҺܸ´ÔÓ, ²¢ÇÒ¾­³£×öЩµ÷Õû£¬ÎªÁ˼õÇá³ÌʽÉè¼Æʦά»¤ Makefile µÄ¸ºµ££¬Òò´ËÓÐÁË Automake¡£
¡¡¡¡³ÌʽÉè¼ÆʦֻÐèдһЩԤÏȶ¨ÒåºÃµÄ¾Þ¼¯ (macro)£¬½»¸ø Automake ´¦Àíáá»á²úÉúÒ»¸ö¿É¹© Autoconf ʹÓÃµÄ Makefile.in µµ¡£ÔÙÅäºÏÀûÓÃAutoconf ²úÉúµÄ×Ô¶¯É趨µµ configure ¼´¿É²úÉúÒ»·Ý·ûºÏ GNU Makefile¹ßÀýµÄ Makeifle ÁË¡£
2. ÉÏ·֮ǰ
ÔÚ¿ªÊ¼ÊÔ×ÅÓà Automake ֮ǰ£¬ÇëÏÈÈ·ÈÏÄãµÄϵͳÒѾ­°²×°ÒÔϵÄÈíÌ壺
1. GNU Automake
2. GNU Autoconf
3. GNU m4
4. perl
5. GNU Libtool (Èç¹ûÄãÐèÒª²úÉú shared library)
ÎһὨÒéÄã×îºÃҲʹÓà GNU C/C++ ±àÒëÆ÷ ¡¢GNU Make ÒÔ¼°ÆäËü GNU µÄ¹¤¾ß³ÌʽÀ´×öΪ¿ª·¢µÄ»·¾³£¬ÕâЩ¹¤¾ß¶¼ÊÇÊôì¶ Open Source Software²»½öÃâ·Ñ¶øÇÒ¹¦ÄÜÇ¿´ó¡£Èç¹ûÄãÊÇʹÓà Red Hat Linux ¿ÉÒÔÕÒµ½ËùÓÐÉÏÊöÈíÌåµÄ rpm µµ£¬FreeBSD Ò²ÓÐÏÖ³ÉµÄ package ¿ÉÒÔÖ±½Ó°²×°£¬»ò×ÅÄãÒ²¿ÉÒÔ×ÔÐÐÏÂÔØÕâЩÈíÌåµÄԭʼµµ»ØÀ´ DIY¡£ÒÔϵķ¶ÀýÊÇÔÚ Red HatLinux 5.2 + CLE2 µÄ»·¾³ÏÂËùÍê³ÉµÄ¡£
3. Ò»¸ö¼òµ¥µÄÀý×Ó
Automake Ëù²úÉúµÄ Makefile ³ýÁË¿ÉÒÔ×öµ½³ÌʽµÄ±àÒëºÍÁ¬½á£¬Ò²ÒѾ­°ÑÈçºÎ²úÉú³ÌʽÎļþ (Èç manual page, info µµ¼° dvi µµ) µÄ¶¯×÷£¬»¹ÓаÑԭʼ³Ìʽ°ü×°ÆðÀ´ÒÔ¹©É¢¡¡µÄ¶¯×÷¶¼¿¼ÂǽøÈ¥ÁË£¬ËùÒÔԭʼ³ÌʽËù´æ·ÅµÄĿ¼¼Ü¹¹×îºÃ·ûºÏ GNU µÄ±ê×¼¹ßÀý£¬½ÓÏÂÀ´ÎÒÄà hello.c À´×öΪÀý×Ó¡£
ÔÚ¹¤×÷Ŀ¼Ï½¨Á¢Ò»¸öеÄ×ÓĿ¼ ``devel''£¬ÔÙÔÚ devel Ͻ¨Á¢Ò»¸ö``hello'' µÄ×ÓĿ¼£¬Õâ¸öĿ¼½«×÷ΪÎÒÃÇ´æ·Å hello Õâ¸ö³Ìʽ¼°ÆäÏà¹Øµµ°¸µÄµØ·½£º[code]% mkdir devel
% cd devel
% mkdir hello
% cd hello[/code]Óñ༭Æ÷д¸ö hello.c µµ£¬[code]#include
int main(int argc, char** argv)
{
printf(``Hello, GNU!\n'');
return 0;
}[/code]½ÓÏÂÀ´¾ÍÒªÓà Autoconf ¼° Automake À´°ïÎÒÃDzúÉú Makefile µµÁË£¬
1. Óà autoscan ²úÉúÒ»¸ö configure.in µÄ³ûÐÍ£¬Ö´ÐÐ autoscan áá»á²úÉúÒ»¸öconfigure.scan µÄµµ°¸£¬ÎÒÃÇ¿ÉÒÔÓÃËü×öΪ configure.inµµµÄÀ¶±¾¡£[code]% autoscan
% ls
configure.scan hello.c[/code]2. ±à¼­ configure.scan µµ£¬ÈçÏÂËùʾ£¬²¢ÇÒ°ÑËüµÄµµÃû¸Ä³É configure.in[code]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)[/code]3. Ö´ÐÐ aclocal ºÍ autoconf £¬·Ö±ð»á²úÉú aclocal.m4 ¼° configure Á½¸öµµ°¸[code]% aclocal
% autoconf
% ls
aclocal.m4configureconfigure.inhello.c[/code]4. ±à¼­ Makefile.am µµ£¬ÄÚÈÝÈçÏÂ[code]AUTOMAKE_OPTIONS= foreign
bin_PROGRAMS= hello
hello_SOURCES= hello.c[/code]5. Ö´ÐÐ automake --add-missing £¬Automake »á¸ù¾Ý Makefile.am µµ²úÉúһЩµµ°¸£¬°üº¬×îÖØÒªµÄ Makefile.in[code]% automake --add-missing
automake: configure.in: installing `./install-sh'
automake: configure.in: installing `./mkinstalldirs'
automake: configure.in: installing `./missing'[/code]
ÎÄÕÂÆÀÂÛ

¹²ÓÐ 1 ÌõÆÀÂÛ

  1. lgms2008 ÓÚ 2006-09-05 19:45:48·¢±í:

    6. ×îááÖ´ÐÐ ./configure £¬[code]% ./configure
    creating cache ./config.cache
    checking for a BSD compatible install... /usr/bin/in
    stall -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[/code]ÏÖÔÚÄãµÄĿ¼ÏÂÒѾ­²úÉúÁËÒ»¸ö Makefile µµ£¬Ï¸ö ``make'' Ö¸Áî¾Í¿ÉÒÔ¿ªÊ¼±àÒë hello.c ³ÉÖ´Ðеµ£¬Ö´ÐÐ ./hello ºÍ GNU ´òÉùÕкô°É£¡[code]% make
    gcc -DPACKAGE="hello" -DVERSION="1.0" -I. -I. -g -O2 -c hello.c
    gcc -g -O2 -o hello hello.o
    % ./hello
    Hello! GNU![/code]Ä㻹¿ÉÒÔÊÔÊÔ ``make clean''£¬''make install''£¬''make dist'' ¿´¿´»áÓÐʲ÷á½á¹û¡£ÄãÒ²¿ÉÒ԰ѲúÉú³öÀ´µÄ Makefile Ðã¸øÄãµÄÀϰ壬ÈÃËû´Ó´Ë¶ÔÄã¹ÎÄ¿Ïà¿´ :-)
    4. һ̽¾¿¾¹
    ÉÏÊö²úÉú Makefile µÄ¹ý³ÌºÍÒÔÍù×ÔÐбàдµÄ·½Ê½·Ç³£²»Ò»Ñù£¬ÉáÆú´«Í³×ÔÐж¨Òå make µÄ¹æÔò£¬Ê¹Óà Automake Ö»ÐèÓõ½Ò»Ð©ÒѾ­¶¨ÒåºÃµÄ¾Þ¼¯¼´¿É¡£ÎÒÃǰѾ޼¯¼°Ä¿±ê (target) дÔÚ Makefile.am µµÄÚ£¬Automake¶ÁÈë Makefile.am µµáá»á°ÑÕâÒ»´®ÒѾ­¶¨ÒåºÃµÄ¾Þ¼¯Õ¹¿ª²¢ÇÒ²úÉú¶ÔÓ¦µÄMakefile.in µµ£¬ È»ááÔÙÓÉ configure Õâ¸ö shell script ¸ù¾ÝMakefile.in ²úÉúÊÊºÏµÄ Makefile¡£
    4.1 ±à¼­ configure.in µµ
    Autoconf ÊÇÓÃÀ´²úÉú 'configure' µµµÄ¹¤¾ß¡£'configure' ÊÇÒ»¸öshell script£¬Ëü¿ÉÒÔ×Ô¶¯É趨ԭʼ³ÌʽÒÔ·ûºÏ¸÷ÖÖ²»Í¬Æ½Ì¨ÉÏ Unix ϵͳµÄÌØÐÔ£¬²¢ÇÒ¸ù¾ÝϵͳÈþÊý¼°»·¾³²úÉúºÏÊ浀 Makefile µµ»òÊÇC µÄ±êÍ·µµ (header file)£¬ÈÃԭʼ³Ìʽ¿ÉÒԺܷ½±ãµØÔÚÕâЩ²»Í¬µÄƽ̨Éϱ»±àÒë³öÀ´¡£Autoconf »á¶ÁÈ¡ configure.in µµÈ»áá²úÉú 'configure' Õâ¸öshell script¡£
    configure.in µµµÄÄÚÈÝÊÇÒ»Á¬´® GNU m4 µÄ¾Þ¼¯£¬ÕâЩ¾Þ¼¯¾­¹ýautoconf ´¦Àíáá»á±ä³É¼ì²éϵͳÌØáçµÄ shell script¡£configure.in ÄÚ¾Þ¼¯µÄ˳Ðò²¢Ã»ÓÐÌرðµÄ¹æ¶¨£¬µ«ÊÇÿһ¸ö configure.in µµ±ØÐëÔÚËùÓо޼¯Ç°¼ÓÈë AC_INIT ¾Þ¼¯£¬È»ááÔÚËùÓо޼¯µÄ×îááÃæ¼ÓÉÏ AC_OUTPUT ¾Þ¼¯¡£ÎÒÃÇ¿ÉÏÈÓà autoscan ɨÃèԭʼµµÒÔ²úÉúÒ»¸ö configure.scan µµ£¬ÔÙ¶Ô configure.scan ×öЩÐÞ¸Ä³É configure.in µµ¡£ÔÚ·¶ÀýÖÐËùÓõ½µÄ¾Þ¼¯ÈçÏ£º
    dnl
    Õâ¸ö¾Þ¼¯ááÃæµÄ×Ö²»»á±»´¦Àí£¬¿ÉÊÓΪע½â¡£
    AC_INIT(FILE)
    Õâ¸ö¾Þ¼¯ÓÃÀ´¼ì²éԭʼÂëËùÔڵķ¾¶£¬autoscan »á×Ô¶¯²úÉú£¬ÎÒÃDz»±ØÐÞ¸ÄËü¡£
    AM_INIT_AUTOMAKE(PACKAGE,VERSION)
    ÕâÊÇʹÓà Automake Ëù±Ø±¸µÄ¾Þ¼¯£¬PACKAGE ÊÇÎÒÃÇËùÒª²úÉúÈíÌåÌ×¼þµÄÃû³Æ£¬VERSION ÊÇ°æ±¾±àºÅ¡£
    AC_PROG_CC
    ¼ì²éϵͳ¿ÉÓÃµÄ C ±àÒëÆ÷£¬Èç¹ûԭʼ³ÌʽÊÇÓà C дµÄ¾ÍÐèÒªÕâ¸ö¾Þ¼¯¡£
    AC_OUTPUT(FILE)
    É趨 configure ËùÒª²úÉúµÄµµ°¸£¬Èç¹ûÊÇ Makefile µÄ»°£¬configure ±ã»á°ÑËü¼ì²é³öÀ´µÄ½á¹û´øÈë Makefile.in µµÈ»áá²úÉúºÏÊ浀 Makefile¡£
    ʵ¼ÊÉÏ£¬ÎÒÃÇʹÓà Automake ʱ£¬»¹ÐëҪһЩÆäËüµÄ¾Þ¼¯£¬ÕâЩ¶îÍâµÄ¾Þ¼¯ÎÒÃÇÓà aclocal À´°ïÎÒÃDzúÉú¡£Ö´ÐÐ aclocal »á²úÉú aclocal.m4 µµ£¬Èç¹ûûÓÐÌرðµÄÓÃ;£¬ÎÒÃÇ¿ÉÒÔ²»±ØÐÞ¸ÄËü£¬Óà aclocal Ëù²úÉúµÄ¾Þ¼¯»á¸æËß Automake Ôõ÷á×ö¡£
    ÓÐÁË configure.in ¼° aclocal.m4 Á½¸öµµ°¸áᣬ±ã¿ÉÒÔÖ´ÐÐ autoconfÀ´²úÉú configure µµÁË¡£
    4.2 ±à¼­ Makefile.am µµ
    ½ÓÏÂÀ´ÎÒÃÇÒª±à¼­ Makefile.am µµ£¬Automake »á¸ù¾Ý configure.in Öеľ޼¯°ÑMakefile.am ת³É Makefile.in µµ¡£Makefile.am µµ¶¨ÒåÎÒÃÇËùÒª²úµÄÄ¿±ê£º
    AUTOMAKE_OPTIONS
    É趨 automake µÄÑ¡Ïî¡£Automake Ö÷ÒªÊÇ°ïÖú¿ª·¢ GNU ÈíÌåµÄÈËԱά»¤ÈíÌåÌ×¼þ£¬ËùÒÔÔÚÖ´ÐÐ automake ʱ£¬»á¼ì²éĿ¼ÏÂÊÇ·ñ´æÔÚ±ê×¼ GNU ÈíÌåÌ×¼þÖÐÓ¦¾ß±¸µÄÎļþµµ°¸£¬ÀýÈç 'NEWS'¡¢'AUTHOR'¡¢'ChangeLog' µÈÎļþµµ¡£Éè³É foreign ʱ£¬automake »á¸ÄÓÃÒ»°ãÈíÌåÌ×¼þµÄ±ê×¼À´¼ì²é¡£
    bin_PROGRAMS
    ¶¨ÒåÎÒÃÇËùÒª²úÉúµÄÖ´ÐеµµµÃû¡£Èç¹ûÒª²úÉú¶à¸öÖ´Ðеµ£¬Ã¿¸öµµÃûÓÿհ××ÖÔª¸ô¿ª¡£
    hello_SOURCES
    ¶¨Òå 'hello' Õâ¸öÖ´ÐеµËùÐèÒªµÄԭʼµµ¡£Èç¹û 'hello' Õâ¸ö³ÌʽÊÇÓɶà¸öԭʼµµËù²úÉú£¬±ØÐë°ÑËüËùÓõ½µÄԭʼµµ¶¼ÁгöÀ´£¬ÒÔ¿Õ°××ÖÔª¸ô¿ª¡£¼ÙÉè 'hello' Õâ¸ö³ÌʽÐèÒª 'hello.c'¡¢'main.c'¡¢'hello.h' Èý¸öµµ°¸µÄ»°£¬Ôò¶¨Òå hello_SOURCES= hello.c main.c hello.h Èç¹ûÎÒÃǶ¨Òå¶à¸öÖ´Ðеµ£¬Ôò¶Ôÿ¸öÖ´Ð嵶¼Òª¶¨ÒåÏà¶ÔµÄfilename_SOURCES¡£
    ±à¼­ºÃ Makefile.am µµ£¬¾Í¿ÉÒÔÓà automake --add-missing À´²úÉúMakefile.in¡£¼ÓÉÏ --add-missing Ñ¡ÏîÊǸæËß automake ˳±ã°ïÎÒÃǼÓÈë°ü×°Ò»¸öÈíÌåÌ×¼þËù±Ø±¸µÄµµ°¸¡£Automake ²úÉú³öÀ´µÄ Makefile.inµµÊÇÍêÈ«·ûºÏ GNU Makefile µÄ¹ßÀý£¬ÎÒÃÇÖ»ÒªÖ´ÐÐ configure Õâ¸öshell script ±ã¿ÉÒÔ²úÉúºÏÊ浀 Makefile µµÁË¡£
    4.3 ʹÓà Makefile
    ÀûÓà configure Ëù²úÉúµÄ 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 µµÒѾ­×¼±¸ºÃ¿É¹©É¢²¥ÁË¡£Õâ¸ö¼ì²é·Ç³£ÓÐÓ㬼ì²é¹ý¹ØµÄÌ×¼þ£¬»ù±¾ÉÏ¿ÉÒÔ¸øÈκÎÒ»¸ö¾ß±¸ GNU ·¢Õ¹»·¾³µÄÈËÈ¥ÖØбàÒë¡£¾Í hello-1.tar.gz Õâ¸ö·¶Àý¶øÑÔ£¬³ýÁËÔÚ RedHat Linux ÉÏ£¬ÔÚ FreeBSD 2.2.x °æÒ²¿ÉÒÔÕýÈ·µØÖØбàÒë¡£
    ҪעÒâµÄÊÇ£¬ÀûÓà Autoconf ¼° Automake Ëù²úÉú³öÀ´µÄÈíÌåÌ×¼þÊÇ¿ÉÒÔÔÚûÓа²×° Autoconf ¼° Automake µÄ»·¾³ÉÏʹÓõģ¬ÒòΪ configure ÊÇÒ»¸ö shell script£¬Ëü¼º±»Éè¼Æ¿ÉÒÔÔÚÒ»°ã Unix µÄ sh Õâ¸ö shell ÏÂÖ´ÐС£µ«ÊÇÈç¹ûÒªÐÞ¸Ä configure.in ¼° Makefile.am µµÔÙ²úÉúеÄconfigure ¼° Makefile.in µµÊ±¾ÍÒ»¶¨ÒªÓÐ Autoconf ¼° Automake ÁË¡£
    5. Ïà¹ØѶϢ
    Autoconf ºÍ Automake ¹¦ÄÜÊ®·ÖÇ¿´ó£¬Äã¿ÉÒÔ´ÓËüÃÇËù¸½µÄ info µµÕÒµ½ÏêϸµÄÓ÷¨¡£ÄãÒ²¿ÉÒÔ´ÓÐí¶àÏÖ´æµÄ GNU ÈíÌå»ò Open Source ÈíÌåÖÐÕÒµ½Ïà¹ØµÄ configure.in »ò Makefile.am µµ£¬ËüÃÇÊÇѧϰ Autoconf ¼°Automake ¸ü¶à¼¼ÇɵÄ×î¼Ñ·¶Àý¡£