./configure make && make install

 

  linux源代碼編譯安裝的三個過程:configure,  make , make installlinux

  1. ./configure  測試

    configure 是一個可執行腳本,有不少選項,能夠執行 ./configure  --help 列出, configure的做用是檢測安裝平臺的目標特徵,好比檢測編譯器是什麼版本,最後生成一個符合目標平臺的編譯腳本makefile。blog

       ./configure --prefix = /usr/local/xxx 指定是將軟件安裝到指定的目錄/usr/local/xxx下。另一個額外的好處是方便卸載軟件和移植,卸載只須要刪除xxx文件夾,移植將文件打包烤至目標主機便可。資源

  2. make 文檔

    編譯過程。根據第一步生成的makefile腳本編譯源代碼、get

  3. make install (須要root權限,向系統寫文件)編譯器

    安裝(有些軟件須要先運行 make check 或 make test來進行一些測試),將編譯出來的程序、依賴庫、文檔拷貝至指定的xxx目標。編譯

      若是在configure後面沒有指定 --prefix目錄, 默認將可執行文件放到 /usr/loceal/bin , 庫文件/usr/local/lib , 配置文件 /usr/local/etc  ,其餘資源文件 /usr/local/sharetest

 

參考: https://thoughtbot.com/blog/the-magic-behind-configure-make-make-install打包

相關文章
相關標籤/搜索