【Linux技術】autotools製作makefile過程詳解

來源:互聯網
上載者:User


 



 

 

 

 

 

1 #                                               -*- Autoconf -*-              2 # Process this file with autoconf to produce a configure script.              3                                                                               4 AC_PREREQ([2.68])                                                             5 #AC_INIT([FULL-PACKAGE-NAME], [VERSION], [BUG-REPORT-ADDRESS])                6 AC_CONFIG_SRCDIR([hello.c])                                                   7 AC_CONFIG_HEADERS([config.h])                                                 8                                                                               9 #add-me-------------                                                         10 AC_INIT(hello,1.0,infodownzert@gmail.com)                                    11 AM_INIT_AUTOMAKE(hello,1.0)                                                  12                                                                              13 # Checks for programs.                                                       14 AC_PROG_CC                                                                   15                                                                              16 # Checks for libraries.                                                      17                                                                              18 # Checks for header files.                                                   19 AC_CHECK_HEADERS([stdlib.h])                                                 20                                                                              21 # Checks for typedefs, structures, and compiler characteristics.             22                                                                              23 # Checks for library functions.                                              24                                                                              25 AC_CONFIG_FILES([Makefile])                                                  26 AC_OUTPUT

 


 

 

 

 

 

 

 


AUTOMAKE_OPTIONS=foreignbin_PROGRAMS= hellohellohello_SOURCES= hello.c

 

 

 

 

mystery@mystery-dell:~/Desktop/autotools$ ./configurechecking for a BSD-compatible install... /usr/bin/install -cchecking whether build environment is sane... yeschecking for a thread-safe mkdir -p... /bin/mkdir -pchecking for gawk... nochecking for mawk... mawkchecking whether make sets $(MAKE)... yeschecking for gcc... gccchecking whether the C compiler works... yeschecking for C compiler default output file name... a.outchecking for suffix of executables...checking whether we are cross compiling... nochecking for suffix of object files... ochecking whether we are using the GNU C compiler... yeschecking whether gcc accepts -g... yeschecking for gcc option to accept ISO C89... none neededchecking for style of include used by make... GNUchecking dependency style of gcc... gcc3checking how to run the C preprocessor... gcc -Echecking for grep that handles long lines and -e... /bin/grepchecking for egrep... /bin/grep -Echecking for ANSI C header files... yeschecking for sys/types.h... yeschecking for sys/stat.h... yeschecking for stdlib.h... yeschecking for string.h... yeschecking for memory.h... yeschecking for strings.h... yeschecking for inttypes.h... yeschecking for stdint.h... yeschecking for unistd.h... yeschecking for stdlib.h... (cached) yesconfigure: creating ./config.statusconfig.status: creating Makefileconfig.status: executing depfiles commands

 

 

 

 



mystery@mystery-dell:~/Desktop/autotools$ makecd . && /bin/bash ./config.status config.hconfig.status: creating config.hmake  all-ammake[1]: Entering directory `/home/mystery/Desktop/autotools'gcc -DHAVE_CONFIG_H -I.     -g -O2 -MT hello.o -MD -MP -MF .deps/hello.Tpo -c -o hello.o hello.cmv -f .deps/hello.Tpo .deps/hello.Pogcc  -g -O2   -o hello hello.ocd . && /bin/bash ./config.status config.hconfig.status: creating config.hconfig.status: config.h is unchangedmake[1]: Leaving directory `/home/mystery/Desktop/autotools'

 

 

mystery@mystery-dell:~/Desktop/autotools$ ./hello!!!Hello World!!!

 

 

 

 

mystery@mystery-dell:~/Desktop/autotools$ make cleantest -z "hello" || rm -f hellorm -f *.o

 

 

mystery@mystery-dell:~/Desktop/autotools$ make distmystery@mystery-dell:~/Desktop/autotools$ ls hello-1.0-tar.gzhello-1.0-tar.gz

 

 

 

 

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.