中文字幕 另类精品,亚洲欧美一区二区蜜桃,日本在线精品视频免费,孩交精品乱子片免费

<sup id="3hn2b"></sup>

    1. <sub id="3hn2b"><ol id="3hn2b"></ol></sub><legend id="3hn2b"></legend>

      1. <xmp id="3hn2b"></xmp>

      2. 新聞中心

        EEPW首頁(yè) > 嵌入式系統(tǒng) > 設(shè)計(jì)應(yīng)用 > Linux下C編程基礎(chǔ)之:實(shí)驗(yàn)內(nèi)容

        Linux下C編程基礎(chǔ)之:實(shí)驗(yàn)內(nèi)容

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

        本文引用地址:http://www.antipu.com.cn/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”復(fù)制到該目錄下。

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

        (4)編輯configure.scan,修改相關(guān)內(nèi)容,并將其重命名為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可執(zhí)行文件,并在當(dāng)前目錄下運(yùn)行hello查看結(jié)果。

        (12)使用makeinstall將hello安裝到系統(tǒng)目錄下,并運(yùn)行,查看結(jié)果。

        (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)運(yùn)行:aclocal。

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

        (8)運(yùn)行:autoheader。

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

        AUTOMAKE_OPTIONS=foreign

        bin_PROGRAMS=hello

        hello_SOURCES=hello.chello.h

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

        (11)運(yùn)行:./configure。

        (12)運(yùn)行:make。

        (13)運(yùn)行:./hello,查看結(jié)果是否正確。

        (14)運(yùn)行:makeinstall。

        (15)運(yùn)行:hello,查看結(jié)果是否正確。

        (16)運(yùn)行:makedist。

        (17)在當(dāng)前目錄下解壓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)運(yùn)行:make。

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

        (22)運(yùn)行:makeinstall。

        (23)運(yùn)行:hello,查看結(jié)果是否正確。

        4.實(shí)驗(yàn)結(jié)果

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

        linux操作系統(tǒng)文章專題:linux操作系統(tǒng)詳解(linux不再難懂)

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

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

        評(píng)論


        相關(guān)推薦

        技術(shù)專區(qū)

        關(guān)閉