成人免费xxxxx在线视频软件_久久精品久久久_亚洲国产精品久久久_天天色天天色_亚洲人成一区_欧美一级欧美三级在线观看

autoconf安裝自動(dòng)編譯工具介紹(3)

運(yùn)維 系統(tǒng)運(yùn)維
《linux高級(jí)程序設(shè)計(jì)》第2章Linux下C語(yǔ)言開(kāi)發(fā)工具,這一章主要介紹Linux下進(jìn)行C語(yǔ)言程序開(kāi)發(fā)所必備的工具。本節(jié)為Autoconf/Automake工具組簡(jiǎn)介。

autoconf安裝自動(dòng)編譯工具介紹(3)

7.使用Automake生成Makefile.in文件

下面使用Automake生成"Makefile.in"文件,使用選項(xiàng)"--add-missing"可以讓Automake自動(dòng)添加一些必需的腳本文件。如下所示:

[root@localhost hello]# automake --add-missing
configure.ac: installing './install-sh'    //創(chuàng)建install-sh文件
configure.ac: installing './missing'
Makefile.am: installing './INSTALL'
Makefile.am: required file './NEWS' not found
Makefile.am: required file './README' not found
Makefile.am: required file './AUTHORS' not found
Makefile.am: required file './ChangeLog' not found
Makefile.am: installing './COPYING'
Makefile.am: installing './depcomp'
[root@localhost hello]# automake --add-missing //再運(yùn)行一次,可以輔助生成幾個(gè)必要的文件
Makefile.am: required file './NEWS' not found //沒(méi)有找到NEWS文件
Makefile.am: required file './README' not found
Makefile.am: required file './AUTHORS' not found
Makefile.am: required file './ChangeLog' not found
[root@localhost hello]# touch NEWS    //創(chuàng)建NEWS文件,如果沒(méi)有自動(dòng)生成,手工創(chuàng)建
[root@localhost hello]# touch README   //創(chuàng)建README文件
[root@localhost hello]# touch AUTHORS   //創(chuàng)建AUTHORS文件
[root@localhost hello]# touch ChangeLog   //創(chuàng)建ChangeLog文件
[root@localhost hello]# automake --add-missing //再運(yùn)行一次
[root@localhost hello]# ls      //生成必要的文件
aclocal.m4      ChangeLog     configure.scan  INSTALL      missing
AUTHORS         config.h.in   COPYING         install-sh   NEWS
autom4te.cache  configure     depcomp         Makefile.am  README
autoscan.log    configure.ac  hello.c         Makefile.in
[root@localhost hello]# ls configure.in -l
-rw-r--r--  1 root root 536 Dec 27 04:29 configure.in

8.a(chǎn)utoconf安裝配置

運(yùn)行自動(dòng)配置設(shè)置文件configure,把Makefile.in變成最終的Makefile。

[root@localhost hello]# ./configure    //配置,生成Makefile文件
……
config.status: creating Makefile
config.status: executing depfiles commands
[root@localhost hello]# ls
aclocal.m4      ChangeLog    config.status   COPYING  install-sh   missing
AUTHORS         config.h     configure       depcomp  Makefile     NEWS
autom4te.cache  config.h.in  configure.ac    hello.c  Makefile.am  README
autoscan.log    config.log   configure.scan  INSTALL  Makefile.in  stamp-h1
[root@localhost hello]# ls  -l  Makefile*
-rw-r--r--  1 root root 16876 Dec 27 04:51 Makefile
-rw-r--r--  1 root root    68 Dec 27 04:46 Makefile.am
-rw-r--r--  1 root root 17180 Dec 27 04:50 Makefile.in

9.a(chǎn)utoconf安裝測(cè)試

運(yùn)行make命令進(jìn)行編譯,下面的示例中Make的主要編譯命令為"gcc  -g -O2   -o hello  hello.o",此句對(duì)應(yīng)本節(jié)前面介紹的手工編輯的Makefile文件內(nèi)容。
 

[root@localhost hello]# cd ../hello
[root@localhost hello]# make     //執(zhí)行make命令
make  all-am
……
gcc  -g -O2   -o hello  hello.o      //編譯指令
……

編譯成功后,將在當(dāng)前目錄下生成并運(yùn)行可執(zhí)行程序hello。測(cè)試源代碼是否正確:

 

[root@localhost hello_2]# ./hello 
hello!GNU
此方法生成的makefile文件很全面。使用"make install"命令把目標(biāo)文件安裝在系統(tǒng)中。

 

[root@localhost hello]# make install      //安裝
make[1]: Entering directory '/root/book/ch02/ch0206/hello'
test -z "/usr/local/bin" || mkdir -p -- "/usr/local/bin"
  /usr/bin/install -c 'hello' '/usr/local/bin/hello'   //安裝目標(biāo)文件
make[1]: Nothing to be done for 'install-data-am'.
make[1]: Leaving directory '/root/book/ch02/ch0206/hello'

使用"make uninstall"命令把目標(biāo)文件從系統(tǒng)中卸載。

 

[root@localhost hello]# make uninstall      //卸載命令
 rm -f '/usr/local/bin/hello'        //從系統(tǒng)中卸載

使用"make clean"命令清除編譯時(shí)的obj文件。

[root@localhost hello]# make clean
test -z "hello" || rm -f hello
rm -f *.o            //刪除obj文件

使用"make dist"命令將程序和相關(guān)的文檔打包為一個(gè)壓縮文檔以供發(fā)布。

[root@localhost hello]# make dist
……
[root@localhost hello]# ls         //查看生成的文件
aclocal.m4      config.h.in    configure.scan    install-sh   README
AUTHORS         config.h.in~   COPYING           Makefile     stamp-h1
autom4te.cache  config.log     depcomp           Makefile.am
Changelog       config.status  hello-1.0.tar.gz  Makefile.in
ChangeLog       configure      hello.c           missing
config.h        configure.ac   INSTALL           NEWS
[root@localhost hello]# ls hello-1.0.tar.gz -l    //打包文件
-rw-r--r--  1 root root 67699 Dec 27 06:33 hello-1.0.tar.gz

【編輯推薦】

  1. Linux 查看磁盤(pán)空間實(shí)現(xiàn)代碼介紹
  2. Linux操作系統(tǒng)需要微軟的十大幫助
  3. 探尋Linux到底需要多低的配置
  4. Linux測(cè)試工具tcpdump監(jiān)視TCP/IP連接命令介紹
  5. Linux流量控制實(shí)例應(yīng)用介紹
責(zé)任編輯:chenqingxiang 來(lái)源: 人民郵電出版社
相關(guān)推薦

2010-06-22 15:13:32

autoconf安裝

2010-06-22 15:24:11

autoconf安裝

2010-06-22 15:45:06

Autoconf使用

2010-06-22 16:09:42

Autoconf教程

2010-03-01 16:40:40

Linux Makef

2010-02-25 15:11:48

Linux Makef

2010-01-13 15:07:51

2010-06-22 16:24:57

Autoconf教程

2010-03-02 16:13:56

Linux升級(jí)

2010-06-22 16:54:48

Autoconf教程

2010-06-22 14:55:21

autoconf安裝

2010-05-28 14:55:17

Linux編程工具

2010-06-22 15:31:22

autoconf安裝

2015-10-09 13:14:10

clip自動(dòng)化運(yùn)維工具

2010-01-14 16:27:44

CentOS emes

2010-06-22 17:05:04

Autoconf教程

2011-05-04 09:02:20

簽名工具代碼BlackBerry

2010-04-12 17:38:25

BlackBerry開(kāi)

2025-03-07 09:00:00

2009-02-25 08:41:49

Windows 7自動(dòng)安裝工具更新
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)

主站蜘蛛池模板: 国产第一页在线观看 | 国产亚洲一区二区三区 | 成人精品系列 | 综合色婷婷 | 青青草精品 | 国产精品一区二区精品 | 日韩aⅴ视频 | 女女爱爱视频 | 久久人操 | 日本在线免费观看 | 九九热在线视频免费观看 | 亚洲一区二区三区四区在线观看 | 欧美高清视频一区 | 日韩视频中文字幕 | 欧美h视频 | 国产在线观看一区二区 | 午夜影视 | 精品视频一区二区三区在线观看 | 日韩欧美综合 | 亚洲高清视频一区二区 | 91精品国产综合久久久动漫日韩 | 婷婷桃色网 | 亚洲国产欧美日韩 | 国产精品视频在线播放 | 免费观看国产视频在线 | 欧美国产日韩在线观看 | 免费观看成人鲁鲁鲁鲁鲁视频 | 久久新视频 | 国产亚洲精品精品国产亚洲综合 | 日韩视频免费 | 日韩欧美国产一区二区三区 | 国产a区 | 亚洲黄色成人网 | 久久精品国产一区二区电影 | 大乳boobs巨大吃奶挤奶 | 精品小视频 | 欧美区日韩区 | 亚洲精品视频免费观看 | 亚洲另类自拍 | 国产成人高清视频 | 亚洲综合在 |