<dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><s id="yhprb"><strike id="yhprb"></strike></s></dfn><small id="yhprb"></small><dfn id="yhprb"></dfn><small id="yhprb"><delect id="yhprb"></delect></small><small id="yhprb"></small><small id="yhprb"></small> <delect id="yhprb"><strike id="yhprb"></strike></delect><dfn id="yhprb"></dfn><dfn id="yhprb"></dfn><s id="yhprb"><noframes id="yhprb"><small id="yhprb"><dfn id="yhprb"></dfn></small><dfn id="yhprb"><delect id="yhprb"></delect></dfn><small id="yhprb"></small><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn> <small id="yhprb"></small><delect id="yhprb"><strike id="yhprb"></strike></delect><dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"><s id="yhprb"><strike id="yhprb"></strike></s></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn>

新聞中心

EEPW首頁(yè) > 嵌入式系統 > 設計應用 > Linux下C編程基礎之:實(shí)驗內容

Linux下C編程基礎之:實(shí)驗內容

作者: 時(shí)間:2013-09-13 來(lái)源:網(wǎng)絡(luò ) 收藏

本文引用地址:http://dyxdggzs.com/article/257147.htm

3.7.4使用autotools生成包含多文件的makefile

1.目的

通過(guò)使用autotools生成包含多文件的makefile,進(jìn)一步掌握autotools的使用方法。同時(shí),掌握下安裝軟件的常用方法。

2.過(guò)程

(1)在原目錄下新建文件夾auto。

(2)將上例的兩個(gè)代碼文件“hello.c”和“hello.h”復制到該目錄下。

(3)使用autoscan生成configure.scan。

(4)編輯configure.scan,修改相關(guān)內容,并將其重命名為configure.in。

(5)使用aclocal生成aclocal.m4。

(6)使用autoconf生成configure。

(7)使用autoheader生成config.h.in。

(8)編輯makefile.am。

(9)使用automake生成makefile.in。

(10)使用configure生成makefile。

(11)使用make生成hello可執行文件,并在當前目錄下運行hello查看結果。

(12)使用makeinstall將hello安裝到系統目錄下,并運行,查看結果。

(13)使用makedist生成hello壓縮包。

(14)解壓hello壓縮包。

(15)進(jìn)入解壓目錄。

(16)在該目錄下安裝hello軟件。

3.步驟

(1)mkdir./auto。

(2)cphello.*./auto(假定原先在“hello.c”文件目錄下)。

(3)命令:autoscan。

(4)使用vi編輯configure.scan為:

#-*-Autoconf-*-

#Processthisfilewithautoconftoproduceaconfigurescript.

AC_PREREQ(2.59)

AC_INIT(hello,1.0)

AM_INIT_AUTOMAKE(hello,1.0)

AC_CONFIG_SRCDIR([hello.h])

AC_CONFIG_HEADER([config.h])

#Checksforprograms.

AC_PROG_CC

#Checksforlibraries.

#Checksforheaderfiles.

#Checksfortypedefs,structures,andcompilercharacteristics.

#Checksforlibraryfunctions.

AC_OUTPUT(makefile)

(5)保存退出,并重命名為configure.in。

(6)運行:aclocal。

(7)運行:autoconf,并用ls查看是否生成了configure可執行文件。

(8)運行:autoheader。

(9)用vi編輯makefile.am文件為:

AUTOMAKE_OPTIONS=foreign

bin_PROGRAMS=hello

hello_SOURCES=hello.chello.h

(10)運行:automake,然后運行automake–a。

(11)運行:./configure。

(12)運行:make。

(13)運行:./hello,查看結果是否正確。

(14)運行:makeinstall。

(15)運行:hello,查看結果是否正確。

(16)運行:makedist。

(17)在當前目錄下解壓hello-1.0.tar.gz:tar–zxvfhello-1.0.tar.gz。

(18)進(jìn)入解壓目錄:cd./hello-1.0。

(19)下面開(kāi)始下常見(jiàn)的安裝軟件步驟:./configure。

(20)運行:make。

(21)運行:./hello(在正常安裝時(shí)這一步可省略)。

(22)運行:makeinstall。

(23)運行:hello,查看結果是否正確。

4.實(shí)驗結果

能夠正確使用autotools生成makefile,并且能夠成功安裝短小的hello軟件。

linux操作系統文章專(zhuān)題:linux操作系統詳解(linux不再難懂)

上一頁(yè) 1 2 3 4 下一頁(yè)

關(guān)鍵詞: C編程 實(shí)驗 Linux VI

評論


相關(guān)推薦

技術(shù)專(zhuān)區

關(guān)閉
国产精品自在自线亚洲|国产精品无圣光一区二区|国产日产欧洲无码视频|久久久一本精品99久久K精品66|欧美人与动牲交片免费播放
<dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><s id="yhprb"><strike id="yhprb"></strike></s></dfn><small id="yhprb"></small><dfn id="yhprb"></dfn><small id="yhprb"><delect id="yhprb"></delect></small><small id="yhprb"></small><small id="yhprb"></small> <delect id="yhprb"><strike id="yhprb"></strike></delect><dfn id="yhprb"></dfn><dfn id="yhprb"></dfn><s id="yhprb"><noframes id="yhprb"><small id="yhprb"><dfn id="yhprb"></dfn></small><dfn id="yhprb"><delect id="yhprb"></delect></dfn><small id="yhprb"></small><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn> <small id="yhprb"></small><delect id="yhprb"><strike id="yhprb"></strike></delect><dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"><s id="yhprb"><strike id="yhprb"></strike></s></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn>