<output id="qn6qe"></output>

    1. <output id="qn6qe"><tt id="qn6qe"></tt></output>
    2. <strike id="qn6qe"></strike>

      亚洲 日本 欧洲 欧美 视频,日韩中文字幕有码av,一本一道av中文字幕无码,国产线播放免费人成视频播放,人妻少妇偷人无码视频,日夜啪啪一区二区三区,国产尤物精品自在拍视频首页,久热这里只有精品12

      川山甲

      追求內心的非常平靜!瞬間清空所有的雜念,達到物我兩忘!

        博客園  :: 首頁  ::  :: 聯(lián)系 :: 訂閱 訂閱  :: 管理
       
       
         
        在linux下C或C++項目開發(fā),Makefile是必備的力氣,但是發(fā)現(xiàn)手寫很麻煩。
        在百度有個comake2工具,用于自動生成Makefile工具,而在外邊本想找一個同類工具,但發(fā)現(xiàn)很難做到,只發(fā)現(xiàn)有個類似的智能生成工具autotools,但是操作比較麻煩,奔著“一人學習,大家共享”的原則,手動寫了一個工具類,幫助自己和大家生成現(xiàn)成的c或者cpp框架。
        代碼比較簡單,希望我們能一起改善下。
        
        
       
        我也希望大家提出更多好的思路(比如名字、功能),我們一起改進下這個工具,煩請大家留下評論,我收集下。
       
       
       
       
       
      使用方式
        
      部署:
      [jack@localhost ~]$ wget https://github.com/chuanshanjia/ccpp/blob/master/frame.sh
      [jack@localhost ccpp]$ ls 
      frame.sh
      [jack@localhost ccpp]$ pwd
      /home/jack/tool/ccpp
      [jack@localhost ccpp]$ sh frame.sh autotools
      configure.ac:6: installing `./install-sh'
      configure.ac:6: installing `./missing'
      ...
      [jack@localhost ccpp]$ ls
      aclocal.m4  autom4te.cache  ChangeLog  config.h.in  config.status  configure.ac  depcomp   include  install-sh  Makefile.am  missing  README  stamp-h1
      AUTHORS     autoscan.log    config.h   config.log   configure      COPYING       frame.sh  INSTALL  Makefile    Makefile.in  NEWS     src
      

        

       清理:
      [jack@localhost ccpp]$ sh frame.sh clear
      [jack@localhost ccpp]$ ls
      frame.sh
      [jack@localhost ccpp]$ 
      

       

      愉快的操作吧^_^

      頭文件位置:

      [jack@localhost ccpp]$ ls
      aclocal.m4  autom4te.cache  ChangeLog  config.h.in  config.status  configure.ac  depcomp   include  install-sh  Makefile.am  missing  README  stamp-h1
      AUTHORS     autoscan.log    config.h   config.log   configure      COPYING       frame.sh  INSTALL  Makefile    Makefile.in  NEWS     src
      [jack@localhost ccpp]$ vim include/demo.h 
      

      main文件位置: 

      [jack@localhost ccpp]$ vim src/demo.cpp
      

      編譯運行:

      [jack@localhost ccpp]$ make
      make  all-am
      make[1]: Entering directory `/home/jack/tool/ccpp'
      g++ -DHAVE_CONFIG_H -I. -I/home/jack/tool/ccpp/include -I/home/jack/tool/ccpp/src/include     -g -O2 -MT demo.o -MD -MP -MF .deps/demo.Tpo -c -o demo.o `test -f 'src/demo.cpp' || echo './'`src/demo.cpp
      mv -f .deps/demo.Tpo .deps/demo.Po
      g++  -g -O2   -o demo demo.o  
      make[1]: Leaving directory `/home/jack/tool/ccpp'
      [jack@localhost ccpp]$ ./demo 
      hello,demo
      [jack@localhost ccpp]$ 
      

        

        

        

      以下內容可作為參考學習,幫助理解工具產生的過程,如非必要,可不進行閱讀。網(wǎng)上有很多類似內容,可以在百度搜索“autotools"就能看到整個過程。  

       
       
      工具準備(參考)
        
      autoscan
      aclocal
      autoheader 
      automake
      autoconf
      automake

       

       

       

       

      準備Makefile.am文件

      INCLUDES=-I./include -I./src/include
      UTOMAKE_OPTIONS=foreign
      bin_PROGRAMS=test
      test_SOURCES=src/test.cpp 
      

        

       

        

      使用智能化工具(參考)
        

      autoscan

       當我們利用autoscan工具生成confiugre.scan文件時,我們需要將confiugre.scan重命名為confiugre.ac文件。confiugre.in調用一系列autoconf宏來測試程序需要的或用到的特性是否存在,以及這些特性的功能。

      具體使用如下:

       

      [jack@localhost tool]$ autoscan 
      [jack@localhost tool]$ ls
      autoscan.log  configure.scan  include  src
      [jack@localhost tool]$ mv configure.scan configure.ac
      [jack@localhost tool]$ ls
      autoscan.log  configure.in  include  src [jack@localhost tool]$ vim configure.ac

        

      修改點:

       

       

      一氣呵成

      aclocal
      autoconf
      autoheader
      automake --add-missing
      automake --add-missing
      touch NEWS README  AUTHORS  ChangeLog
      automake --add-missing
      ./configure
      

        

       

       

       

       
      參考手冊
         
      confiugre.in文件的一般布局:
       
      AC_INIT
       測試程序
       測試函數(shù)庫
       測試頭文件
       測試類型定義
       測試結構
       測試編譯器特性
       測試庫函數(shù)
       測試系統(tǒng)調用
      AC_OUTPUT
      

        

       
      表 1Makefile.am一般格式
      表 1Makefile.am一般格式
       
      表 2 Makefile.am中可用的全局變量
      表 2 Makefile.am中可用的全局變量

      在Makefile.am中盡量使用相對路徑,系統(tǒng)預定義了兩個基本路徑:

      表 3Makefile.am中可用的路徑變量
      表 3Makefile.am中可用的路徑變量
       
       
      參考文獻
         
      1、http://www.ibm.com/developerworks/cn/linux/l-makefile/
      2、https://www.gnu.org/software/autoconf/manual/autoconf-2.61/html_node/Autoconf-Language.html#Autoconf-Language
      3、http://www.gnu.org/software/automake/manual/automake.pdf
       

       

      推薦
       

       

       

       

      posted on 2016-03-09 15:16  川山甲  閱讀(11745)  評論(5)    收藏  舉報
      主站蜘蛛池模板: 亚洲精品乱码久久久久久中文字幕 | 久久这里精品国产99丫E6| 亚洲精品电影院| 两个人免费完整高清视频| 人妻夜夜爽天天爽| 精品久久久久久无码人妻蜜桃| 97久久精品人人澡人人爽| 琼中| 久女女热精品视频在线观看| 成人中文在线| 另类图片亚洲人妻中文无码 | 精品人人妻人人澡人人爽人人| 97亚洲色欲色欲综合网| 国产乱码日韩精品一区二区| 国产成人一区二区三区免费 | 国产午夜福利在线视频| 免费人成再在线观看网站| 久久一级精品久熟女人妻| 国产午夜亚洲精品久久| 精品人妻免费看一区二区三区| 夜鲁鲁鲁夜夜综合视频欧美| 国产综合视频精品一区二区| 97成人碰碰久久人人超级碰oo | 国产盗摄xxxx视频xxxx| 亚洲中文字幕在线二页| 国产黄大片在线观看画质优化| 国产熟女一区二区三区四区| 老妇xxxxx性开放| 亚洲国产良家在线观看| 国产精品国产三级国产午| 欧美牲交a欧美牲交aⅴ一| 欧美激情一区二区| 桦川县| 男女xx00上下抽搐动态图| 自偷自拍亚洲综合精品| 国产福利微视频一区二区| 尹人香蕉久久99天天拍| 阳朔县| 国产又色又爽又黄的在线观看| 亚洲免费观看一区二区三区| 少妇又紧又色又爽又刺激视频|