• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            牽著老婆滿街逛

            嚴(yán)以律己,寬以待人. 三思而后行.
            GMail/GTalk: yanglinbo#google.com;
            MSN/Email: tx7do#yahoo.com.cn;
            QQ: 3 0 3 3 9 6 9 2 0 .

            幾個(gè)好用的makefile 幾乎可以不用修改

            Makefile

            ?????? makefile 來編譯工程,對很多朋友來說都是一件麻煩而痛苦的事情,這里我寫了幾個(gè) makefile ,專門提供給那些曾經(jīng)被 makefile 困擾的朋友,根據(jù)生成的目標(biāo)文件不同,我將 makefile 分成了三份:生成可執(zhí)行文件的 makefile ,生成靜態(tài)鏈接庫德 makefile ,生成動(dòng)態(tài)鏈接庫的 makefile

            ?????? 這些 makefile 都很簡單,一般都是一看就會(huì)用,用法也很容易,只需要把它們拷貝到你的代碼的同一目錄下,然后就可以使用 make 來生成目標(biāo)文件了。

            ?????? 是不是真的有這么神奇?呵呵,你自己用用就知道了。

            ?????? 當(dāng)然,如果要用到什么庫文件,你還需要修改一些編譯參數(shù),這個(gè)可以對照我轉(zhuǎn)載的另一篇文章《 GNU make 指南》。

            ?????? 下面是三個(gè) makefile 的源代碼:

            ?

            ?????? 1 、生成可執(zhí)行文件的 makefile

            ######################################

            #

            # Generic makefile

            #

            # by Coon Xu

            # email: coonxu@126.com

            #

            # Copyright (c) 2005 Coon Xu

            # All rights reserved.

            #?

            # No warranty, no liability;

            # you use this at your own risk.

            #

            # You are free to modify and

            # distribute this without giving

            # credit to the original author.

            #

            ######################################

            ?

            ?

            #source file

            # 源文件,自動(dòng)找所有 .c .cpp 文件,并將目標(biāo)定義為同名 .o 文件

            SOURCE? := $(wildcard *.c) $(wildcard *.cpp)

            OBJS??? := $(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(SOURCE)))

            ?

            #target you can change test to what you want

            # 目標(biāo)文件名,輸入任意你想要的執(zhí)行文件名

            TARGET? := test

            ?

            #compile and lib parameter

            # 編譯參數(shù)

            CC????? := gcc

            LIBS??? :=

            LDFLAGS:=?

            DEFINES:=

            INCLUDE:= -I.

            CFLAGS? := -g -Wall -O3 $(DEFINES) $(INCLUDE)

            CXXFLAGS:= $(CFLAGS) -DHAVE_CONFIG_H

            ?

            ?

            #i think you should do anything here

            # 下面的基本上不需要做任何改動(dòng)了

            .PHONY : everything objs clean veryclean rebuild

            ?

            everything : $(TARGET)

            ?

            all : $(TARGET)

            ?

            objs : $(OBJS)

            ?

            rebuild: veryclean everything

            ???????????????

            clean :

            ??? rm -fr *.so

            ??? rm -fr *.o

            ???

            veryclean : clean

            ??? rm -fr $(TARGET)

            ?

            $(TARGET) : $(OBJS)?

            ??? $(CC) $(CXXFLAGS) -o $@ $(OBJS) $(LDFLAGS) $(LIBS)

            ?

            ?????? 2 、生成靜態(tài)鏈接庫的 makefile

            ######################################

            #

            # Generic Static Library makefile

            #

            # by Coon Xu

            # email: coonxu@126.com

            #

            # Copyright (c) 2005 Coon Xu

            # All rights reserved.

            #?

            # No warranty, no liability;

            # you use this at your own risk.

            #

            # You are free to modify and

            # distribute this without giving

            # credit to the original author.

            #

            ######################################

            ?

            #target you can change test to what you want

            # 共享庫文件名, lib*.a

            TARGET? := libtest.a

            ?

            #compile and lib parameter

            # 編譯參數(shù)

            CC????? := gcc

            AR????? = ar

            RANLIB? = ranlib

            LIBS??? :=

            LDFLAGS:=?

            DEFINES:=

            INCLUDE:= -I.

            CFLAGS? := -g -Wall -O3 $(DEFINES) $(INCLUDE)

            CXXFLAGS:= $(CFLAGS) -DHAVE_CONFIG_H

            ?

            #i think you should do anything here

            # 下面的基本上不需要做任何改動(dòng)了

            ?

            #source file

            # 源文件,自動(dòng)找所有 .c .cpp 文件,并將目標(biāo)定義為同名 .o 文件

            SOURCE? := $(wildcard *.c) $(wildcard *.cpp)

            OBJS??? := $(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(SOURCE)))

            ?

            .PHONY : everything objs clean veryclean rebuild

            ?

            everything : $(TARGET)

            ?

            all : $(TARGET)

            ?

            objs : $(OBJS)

            ?

            rebuild: veryclean everything

            ???????????????

            clean :

            ??? rm -fr *.o

            ???

            veryclean : clean

            ??? rm -fr $(TARGET)

            ?

            $(TARGET) : $(OBJS)?

            ??? $(AR) cru $(TARGET) $(OBJS)

            ??? $(RANLIB) $(TARGET)

            ?

            ?????? 3 、生成動(dòng)態(tài)鏈接庫的 makefile

            ######################################

            #

            # Generic Share Library makefile

            #

            # by Coon Xu

            # email: coonxu@126.com

            #

            # Copyright (c) 2005 Coon Xu

            # All rights reserved.

            #?

            # No warranty, no liability;

            # you use this at your own risk.

            #

            # You are free to modify and

            # distribute this without giving

            # credit to the original author.

            #

            ######################################

            ?

            #target you can change test to what you want

            # 共享庫文件名, lib*.so

            TARGET? := libtest.so

            ?

            #compile and lib parameter

            # 編譯參數(shù)

            CC????? := gcc

            LIBS??? :=

            LDFLAGS:=?

            DEFINES:=

            INCLUDE:= -I.

            CFLAGS? := -g -Wall -O3 $(DEFINES) $(INCLUDE)

            CXXFLAGS:= $(CFLAGS) -DHAVE_CONFIG_H

            SHARE?? := -fPIC -shared -o

            ?

            #i think you should do anything here

            # 下面的基本上不需要做任何改動(dòng)了

            ?

            #source file

            # 源文件,自動(dòng)找所有 .c .cpp 文件,并將目標(biāo)定義為同名 .o 文件

            SOURCE? := $(wildcard *.c) $(wildcard *.cpp)

            OBJS??? := $(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(SOURCE)))

            ?

            .PHONY : everything objs clean veryclean rebuild

            ?

            everything : $(TARGET)

            ?

            all : $(TARGET)

            ?

            objs : $(OBJS)

            ?

            rebuild: veryclean everything

            ???????????????

            clean :

            ??? rm -fr *.o

            ???

            veryclean : clean

            ??? rm -fr $(TARGET)

            ?

            $(TARGET) : $(OBJS)?

            ??? $(CC) $(CXXFLAGS) $(SHARE) $@ $(OBJS) $(LDFLAGS) $(LIBS)

            posted on 2007-02-08 15:34 楊粼波 閱讀(831) 評論(0)  編輯 收藏 引用

            久久综合亚洲色一区二区三区| 青青草原综合久久大伊人| 九九99精品久久久久久| 2022年国产精品久久久久| 欧美午夜精品久久久久久浪潮| 无码人妻少妇久久中文字幕| 国产色综合久久无码有码| 91精品国产高清久久久久久国产嫩草| 手机看片久久高清国产日韩| 亚洲精品乱码久久久久久中文字幕 | 国产精品久久久久久久午夜片| 亚洲伊人久久综合中文成人网| 久久亚洲中文字幕精品有坂深雪| 久久国产香蕉视频| 欧洲人妻丰满av无码久久不卡| 久久人人爽人人澡人人高潮AV | 久久伊人精品青青草原日本| 成人久久久观看免费毛片| 国产精品久久新婚兰兰| 久久免费小视频| 久久久久人妻精品一区二区三区| 性做久久久久久久久| 国产福利电影一区二区三区久久久久成人精品综合 | 久久婷婷国产剧情内射白浆 | 欧美久久综合性欧美| 久久综合给合久久狠狠狠97色69| 天天影视色香欲综合久久| 99久久99久久精品国产片果冻| www久久久天天com| 精品免费久久久久久久| 国产成人久久AV免费| 精品久久久久久国产潘金莲| 亚洲中文精品久久久久久不卡| 亚洲国产成人精品女人久久久| 久久91这里精品国产2020| 人人狠狠综合久久亚洲88| 69久久夜色精品国产69| 久久精品视频网| 久久国产精品波多野结衣AV| 精品久久综合1区2区3区激情| 中文字幕亚洲综合久久2|