青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

Benjamin

靜以修身,儉以養(yǎng)德,非澹薄無(wú)以明志,非寧?kù)o無(wú)以致遠(yuǎn)。
隨筆 - 398, 文章 - 0, 評(píng)論 - 196, 引用 - 0
數(shù)據(jù)加載中……

linux常用makefile模板

 

 一、通用的編譯c、c++單工程makefile模板。
1、MY_LIBS是添加靜態(tài)庫(kù)選項(xiàng)
2、MY_CFLAGS一般添加include文件路徑,這個(gè)路徑被用在了c和c++文件編譯時(shí),對(duì)c和c++都有效;如果想分開(kāi)控制,請(qǐng)定義兩個(gè)類(lèi)似的變量
3、PROGRAM是最終生成的文件名,默認(rèn)的是文件夾名字,也可自己指定
4、如果一個(gè)項(xiàng)目有多個(gè)工程,在頂層執(zhí)行這個(gè)文件,會(huì)導(dǎo)致進(jìn)入這個(gè)文件夾兩次,第一次產(chǎn)生.d依賴(lài)文件,由于此時(shí).o文件尚未生成,所以什么也沒(méi)做,
第二次進(jìn)入這個(gè)目錄,會(huì)生成o文件,最終連接成可執(zhí)行文件。.d(depend)依賴(lài)文件;如果以后在編譯時(shí),請(qǐng)不要?jiǎng)h除這些.d文件,以后有了改動(dòng),
比如更改了.h文件中的宏變量,則此時(shí)可根據(jù).depend中的依賴(lài)關(guān)系只生成對(duì)應(yīng)的.o文件了。總之,.d文件可要可不要。默認(rèn)的,*.d依賴(lài)文件不刪除。
不需要d文件,將sinclude $(DEPS)注釋掉即可
5、如果源文件在別的目錄,請(qǐng)?jiān)O(shè)置VPATH

  1#############################################################
  2# Generic Makefile for C/C++ Program
  3#
  4# License: GPL (General Public License)
  5# Author:  whyglinux <whyglinux AT gmail DOT com>
  6# Date:    2006/03/04 (version 0.1)
  7#          2007/03/24 (version 0.2)
  8#          2007/04/09 (version 0.3)
  9#          2007/06/26 (version 0.4)
 10#          2008/04/05 (version 0.5)
 11#
 12# Description:
 13------------
 14# This is an easily customizable makefile template. The purpose is to
 15# provide an instant building environment for C/C++ programs.
 16#
 17# It searches all the C/C++ source files in the specified directories,
 18# makes dependencies, compiles and links to form an executable.
 19#
 20# Besides its default ability to build C/C++ programs which use only
 21# standard C/C++ libraries, you can customize the Makefile to build
 22# those using other libraries. Once done, without any changes you can
 23# then build programs using the same or less libraries, even if source
 24# files are renamed, added or removed. Therefore, it is particularly
 25# convenient to use it to build codes for experimental or study use.
 26#
 27# GNU make is expected to use the Makefile. Other versions of makes
 28# may or may not work.
 29#
 30# Usage:
 31------
 321. Copy the Makefile to your program directory.
 332. Customize in the "Customizable Section" only if necessary:
 34#    * to use non-standard C/C++ libraries, set pre-processor or compiler
 35#      options to <MY_CFLAGS> and linker ones to <MY_LIBS>
 36#      (See Makefile.gtk+-2.0 for an example)
 37#    * to search sources in more directories, set to <SRCDIRS>
 38#    * to specify your favorite program name, set to <PROGRAM>
 393. Type make to start building your program.
 40#
 41# Make Target:
 42------------
 43# The Makefile provides the following targets to make:
 44#   $ make           compile and link
 45#   $ make NODEP=yes compile and link without generating dependencies
 46#   $ make objs      compile only (no linking)
 47#   $ make tags      create tags for Emacs editor
 48#   $ make ctags     create ctags for VI editor
 49#   $ make clean     clean objects and the executable file
 50#   $ make distclean clean objects, the executable and dependencies
 51#   $ make help      get the usage of the makefile
 52#
 53#===========================================================================
 54
 55## Customizable Section: adapt those variables to suit your program.
 56##==========================================================================
 57
 58# The pre-processor and compiler options.
 59MY_CFLAGS =
 60
 61# The linker options.
 62MY_LIBS   =
 63
 64# The pre-processor options used by the cpp (man cpp for more).
 65CPPFLAGS  = -Wall
 66
 67# The options used in linking as well as in any direct use of ld.
 68LDFLAGS   =
 69
 70# The directories in which source files reside.
 71# If not specified, only the current directory will be serached.
 72SRCDIRS   =
 73
 74# The executable file name.
 75# If not specified, current directory name or `a.out' will be used.
 76PROGRAM   =
 77
 78## Implicit Section: change the following only when necessary.
 79##==========================================================================
 80
 81# The source file types (headers excluded).
 82# .c indicates C source files, and others C++ ones.
 83SRCEXTS = .c .C .cc .cpp .CPP .c++ .cxx .cp
 84
 85# The header file types.
 86HDREXTS = .h .H .hh .hpp .HPP .h++ .hxx .hp
 87
 88# The pre-processor and compiler options.
 89# Users can override those variables from the command line.
 90CFLAGS  = --O2
 91CXXFLAGS= --O2
 92
 93# The C program compiler.
 94#CC     = gcc
 95
 96# The C++ program compiler.
 97#CXX    = g++
 98
 99# Un-comment the following line to compile C programs as C++ ones.
100#CC     = $(CXX)
101
102# The command used to delete file.
103#RM     = rm -f
104
105ETAGS = etags
106ETAGSFLAGS =
107
108CTAGS = ctags
109CTAGSFLAGS =
110
111## Stable Section: usually no need to be changed. But you can add more.
112##==========================================================================
113SHELL   = /bin/sh
114EMPTY   =
115SPACE   = $(EMPTY) $(EMPTY)
116ifeq ($(PROGRAM),)
117  CUR_PATH_NAMES = $(subst /,$(SPACE),$(subst $(SPACE),_,$(CURDIR)))
118  PROGRAM = $(word $(words $(CUR_PATH_NAMES)),$(CUR_PATH_NAMES))
119  ifeq ($(PROGRAM),)
120    PROGRAM = a.out
121  endif
122endif
123ifeq ($(SRCDIRS),)
124  SRCDIRS = .
125endif
126SOURCES = $(foreach d,$(SRCDIRS),$(wildcard $(addprefix $(d)/*,$(SRCEXTS))))
127HEADERS = $(foreach d,$(SRCDIRS),$(wildcard $(addprefix $(d)/*,$(HDREXTS))))
128SRC_CXX = $(filter-out %.c,$(SOURCES))
129OBJS    = $(addsuffix .o, $(basename $(SOURCES)))
130DEPS    = $(OBJS:.o=.d)
131
132## Define some useful variables.
133DEP_OPT = $(shell if `$(CC) --version | grep "GCC" >/dev/null`; then \
134                  echo "-MM -MP"; else echo "-M"; fi )
135DEPEND      = $(CC)  $(DEP_OPT)  $(MY_CFLAGS) $(CFLAGS) $(CPPFLAGS)
136DEPEND.d    = $(subst -g ,,$(DEPEND))
137COMPILE.c   = $(CC)  $(MY_CFLAGS) $(CFLAGS)   $(CPPFLAGS) -c
138COMPILE.cxx = $(CXX) $(MY_CFLAGS) $(CXXFLAGS) $(CPPFLAGS) -c
139LINK.c      = $(CC)  $(MY_CFLAGS) $(CFLAGS)   $(CPPFLAGS) $(LDFLAGS)
140LINK.cxx    = $(CXX) $(MY_CFLAGS) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS)
141
142.PHONY: all objs tags ctags clean distclean help show
143
144# Delete the default suffixes
145.SUFFIXES:
146
147all: $(PROGRAM)
148
149# Rules for creating dependency files (.d).
150#------------------------------------------
151
152%.d:%.c
153 @echo -n $(dir $<) > $@
154 @$(DEPEND.d) $< >> $@
155
156%.d:%.C
157 @echo -n $(dir $<) > $@
158 @$(DEPEND.d) $< >> $@
159
160%.d:%.cc
161 @echo -n $(dir $<) > $@
162 @$(DEPEND.d) $< >> $@
163
164%.d:%.cpp
165 @echo -n $(dir $<) > $@
166 @$(DEPEND.d) $< >> $@
167
168%.d:%.CPP
169 @echo -n $(dir $<) > $@
170 @$(DEPEND.d) $< >> $@
171
172%.d:%.c++
173 @echo -n $(dir $<) > $@
174 @$(DEPEND.d) $< >> $@
175
176%.d:%.cp
177 @echo -n $(dir $<) > $@
178 @$(DEPEND.d) $< >> $@
179
180%.d:%.cxx
181 @echo -n $(dir $<) > $@
182 @$(DEPEND.d) $< >> $@
183
184# Rules for generating object files (.o).
185#----------------------------------------
186objs:$(OBJS)
187
188%.o:%.c
189 $(COMPILE.c) $< -o $@
190
191%.o:%.C
192 $(COMPILE.cxx) $< -o $@
193
194%.o:%.cc
195 $(COMPILE.cxx) $< -o $@
196
197%.o:%.cpp
198 $(COMPILE.cxx) $< -o $@
199
200%.o:%.CPP
201 $(COMPILE.cxx) $< -o $@
202
203%.o:%.c++
204 $(COMPILE.cxx) $< -o $@
205
206%.o:%.cp
207 $(COMPILE.cxx) $< -o $@
208
209%.o:%.cxx
210 $(COMPILE.cxx) $< -o $@
211
212# Rules for generating the tags.
213#-------------------------------------
214tags: $(HEADERS) $(SOURCES)
215 $(ETAGS) $(ETAGSFLAGS) $(HEADERS) $(SOURCES)
216
217ctags: $(HEADERS) $(SOURCES)
218 $(CTAGS) $(CTAGSFLAGS) $(HEADERS) $(SOURCES)
219
220# Rules for generating the executable.
221#-------------------------------------
222$(PROGRAM):$(OBJS)
223ifeq ($(SRC_CXX),)              # C program
224 $(LINK.c)   $(OBJS) $(MY_LIBS) -o $@
225 @echo Type ./$@ to execute the program.
226else                            # C++ program
227 $(LINK.cxx) $(OBJS) $(MY_LIBS) -o $@
228 @echo Type ./$@ to execute the program.
229endif
230
231ifndef NODEP
232ifneq ($(DEPS),)
233  sinclude $(DEPS)
234endif
235endif
236
237clean:
238 $(RM) $(OBJS) $(PROGRAM) $(PROGRAM).exe
239
240distclean: clean
241 $(RM) $(DEPS) TAGS
242
243# Show help.
244help:
245 @echo 'Generic Makefile for C/C++ Programs (gcmakefile) version 0.5'
246 @echo 'Copyright (C) 2007, 2008 whyglinux <whyglinux@hotmail.com>'
247 @echo
248 @echo 'Usage: make [TARGET]'
249 @echo 'TARGETS:'
250 @echo '  all       (=make) compile and link.'
251 @echo '  NODEP=yes make without generating dependencies.'
252 @echo '  objs      compile only (no linking).'
253 @echo '  tags      create tags for Emacs editor.'
254 @echo '  ctags     create ctags for VI editor.'
255 @echo '  clean     clean objects and the executable file.'
256 @echo '  distclean clean objects, the executable and dependencies.'
257 @echo '  show      show variables (for debug use only).'
258 @echo '  help      print this message.'
259 @echo
260 @echo 'Report bugs to <whyglinux AT gmail DOT com>.'
261
262# Show variables (for debug use only.)
263show:
264 @echo 'PROGRAM     :' $(PROGRAM)
265 @echo 'SRCDIRS     :' $(SRCDIRS)
266 @echo 'HEADERS     :' $(HEADERS)
267 @echo 'SOURCES     :' $(SOURCES)
268 @echo 'SRC_CXX     :' $(SRC_CXX)
269 @echo 'OBJS        :' $(OBJS)
270 @echo 'DEPS        :' $(DEPS)
271 @echo 'DEPEND      :' $(DEPEND)
272 @echo 'COMPILE.c   :' $(COMPILE.c)
273 @echo 'COMPILE.cxx :' $(COMPILE.cxx)
274 @echo 'link.c      :' $(LINK.c)
275 @echo 'link.cxx    :' $(LINK.cxx)
276
277## End of the Makefile ##  Suggestions are welcome  ## All rights reserved ##
278##############################################################
279
280

二、多項(xiàng)目工程(頂層)makefile模板:這里采用遍歷子文件夾,在有Makefile文件的文件夾下執(zhí)行make命令
1、make  ver=$(ver)這里是版本控制,比如make ver=r就是release版本,默認(rèn)是debug,
版本控制也需要在子項(xiàng)目的Makefile文件中體現(xiàn),這是由用戶(hù)自己定義控制
2、make默認(rèn)是打開(kāi)w,輸出運(yùn)行makefile之前和之后的信息,可以用--no-print-directory禁止輸出這個(gè)trace信息
例如:如果采用上面的c、c++工程makefile模板,屏幕會(huì)打印進(jìn)出文件夾的信息,通過(guò)這選項(xiàng)可以禁止輸出這些信息。
3、這里檢測(cè)的是各個(gè)文件夾下的Makefile文件是否存在,也可以檢測(cè)其他文件。

 1# Top Makefile 
 2DIR = /software/project    #也可以DIR:= `ls .`
 3MODULES = $(shell ls $(DIR)) #也可以MODULES:=`pwd`
 4
 5all : $(MODULES)
 6 @for subdir in $(MODULES); \
 7 do \
 8 if test -f $(DIR)/$$subdir/Makefile;then\
 9  cd $(DIR)/$$subdir;\
10 make  ver=$(ver) ;\
11 cd  $(DIR);\
12 fi;\
13done
14
15clean :
16 @for subdir in $(MODULES); \
17do \
18 if test -f $(DIR)/$$subdir/Makefile;then\
19  cd $(DIR)/$$subdir;\
20 make --no-print-directory clean ver=$(ver) ;\
21 cd  $(DIR);\
22 fi;\
23done
24
25tags:
26 ctags -R
27
28
29.PHONY : all clean distclean tags help
30
31


三、多項(xiàng)目工程(頂層)makefile模板,采用路徑來(lái)表示,不用再檢測(cè)是否有makefile文件;這邊版本可以靈活的添加

 1# Top Makefile for C program
 2
 3all :
 4 #version control.default is debug
 5
 6 $(MAKE) ver=$(ver) -/home/project/baseframe 
 7 $(MAKE) ver=$(ver) -/home/project/logic  
 8 $(MAKE) ver=$(ver) -C  /home/project/login 
 9 $(MAKE) ver=$(ver) -/home/project/db 
10tags:
11 ctags -R
12
13help:
14 @echo "=====================A common Makefilefor c programs===================="
15 @echo "Copyright (C) 2014"
16 @echo "The following targets aresupport:"
17 @echo
18 @echo " all              - (==make) compile and link"
19 @echo " obj              - just compile, withoutlink"
20 @echo " clean            - clean target"
21 @echo " distclean        - clean target and otherinformation"
22 @echo " tags             - create ctags for vimeditor"
23 @echo " help             - print help information"
24 @echo
25 @echo "To make a target, do 'make[target]'"
26 @echo "========================= Version2.0 ==================================="
27
28clean :
29
30 $(MAKE) ver=$(ver) -/home/project/baseframe   clean
31 $(MAKE) ver=$(ver) -/home/project/logic   clean
32 $(MAKE) ver=$(ver) -/home/project/Login clean 
33 $(MAKE) ver=$(ver) -/home/project/db    clean 
34
35distclean:
36 $(MAKE) -/home/project/baseframe distclean
37 $(MAKE) -/home/project/logic distclean
38 $(MAKE) -/home/project/Login distclean
39 $(MAKE) -/home/project/db distclean
40
41  
42.PHONY : all clean distclean tags help
43


 四、通用的c、c++混合編譯模板

  1#
  2# c.cpp混合編譯的makefile模板
  3#
  4#
  5
  6BIN = liblua.so
  7CC = gcc
  8CPP = g++
  9#系統(tǒng)庫(kù)的包含路徑、庫(kù)列表
 10INCS = 
 11LIBS = 
 12SUBDIRS =
 13
 14#源文件包含路徑、庫(kù)列表
 15SOURCEINC = 
 16#
 17#
 18#maintest.c tree/rbtree.c  多了子目錄,那就直接添加 目錄/*.c即可   所有的源文件--  .c文件列表
 19CSRCS = $(wildcard  ./*.c )
 20CPPSRCS = $(wildcard ./*.cpp)
 21
 22#
 23#
 24#所有的.o文件列表
 25COBJS := $(CSRCS:.c=.o)
 26CPPOBJS := $(CPPSRCS:.cpp=.o)
 27#
 28#生成依賴(lài)信息 -MM是只生成自己的頭文件信息,-M 包含了標(biāo)準(zhǔn)庫(kù)頭文件信息。
 29#-MT 或 -MQ都可以改變生成的依賴(lài)  xxx.o:src/xxx.h 為 src/xxx.o:src/xxx.h 當(dāng)然。前面的 src/xxx.o需自己指定
 30#格式為 -MM 輸入.c或.cpp  查找依賴(lài)路徑  -MT或-MQ  生成規(guī)則,比如src/xxx.o 
 31MAKEDEPEND = gcc -MM -MT
 32CFLAGS =
 33CPPFLAGS =
 34
 35#-g 生成調(diào)試信息
 36#-pedantic參數(shù)與-ansi一起使用 會(huì)自動(dòng)拒絕編譯非ANSI程序
 37#-fomit-frame-pointer 去除函數(shù)框架
 38#-Wmissing-prototypes -Wstrict-prototypes 檢查函數(shù)原型
 39#針對(duì)每個(gè).c文件的.d依賴(lài)文件列表
 40CDEF = $(CSRCS:.c=.d)
 41CPPDEF = $(CPPSRCS:.cpp=.d)
 42
 43PLATS = win32-debug win32-release linux-debug linux-release
 44none:
 45 @echo "Please choose a platform:"
 46 @echo " $(PLATS)"
 47
 48win32-debug:
 49 $(MAKE) all INCS=-I"c:/mingw/include" LIBS=-L"c:/mingw/lib" CFLAGS="-Wall -DWIN32 -DDEBUG -g" CPPFLAGS="-Wall -DWIN32 -DDEBUG -g"
 50
 51win32-release:
 52 $(MAKE) all INCS=-I"c:/mingw/include" LIBS=-L"c:/mingw/lib" CFLAGS="-Wall -DWIN32 -DNDEBUG -O2" CPPFLAGS="-Wall -DWIN32 -DNDEBUG -O2"
 53 
 54linux-debug:
 55 $(MAKE) all INCS=-I"/usr/include" LIBS=-L"/usr/lib" CFLAGS="-fPIC -Wall -DDEBUG -g" CPPFLAGS="-fPIC -Wall -DDEBUG -g" -lpthread
 56
 57linux-release:
 58 $(MAKE) all INCS=-I"/usr/include" LIBS=-L"/usr/lib" CFLAGS="-fPIC -Wall -DNDEBUG -O2" CPPFLAGS="-fPIC -Wall -DNDEBUG -O2" -lpthread
 59
 60all:$(BIN)
 61
 62#$(OBJS):%.o :%.c  先用$(OBJS)中的一項(xiàng),比如foo.o: %.o : %.c  含義為:試著用%.o匹配foo.o。如果成功%就等于foo。如果不成功,
 63# Make就會(huì)警告,然后。給foo.o添加依賴(lài)文件foo.c(用foo替換了%.c里的%)
 64# 也可以不要下面的這個(gè)生成規(guī)則,因?yàn)橄旅娴?nbsp;include $(DEF)  就隱含了。此處為了明了,易懂。故留著
 65$(COBJS) : %.o: %.c
 66 $(CC) -c $< -o $@ $(INCS) $(SOURCEINC) $(CFLAGS)
 67$(CPPOBJS) : %.o: %.cpp
 68 $(CPP) -c $< -o $@ $(INCS) $(SOURCEINC) $(CPPFLAGS)
 69
 70# $@--目標(biāo)文件,$^--所有的依賴(lài)文件,$<--第一個(gè)依賴(lài)文件。每次$< $@ 代表的值就是列表中的
 71#
 72
 73####################################
 74#最終鏈接目標(biāo)是.a(靜態(tài)庫(kù))
 75$(BIN) : $(COBJS) $(CPPOBJS)
 76 ar r $@  $(COBJS) $(CPPOBJS) $(LIBS)
 77 ranlib $(BIN)
 78 -rm $(COBJS) $(CPPOBJS)
 79
 80####################################
 81#如果不加-fPIC,則加載.so文件的代碼段時(shí),造成每個(gè)使用這個(gè).so文件代碼段的進(jìn)程在內(nèi)核里都會(huì)生成這個(gè).so文件代碼段的copy.每個(gè)copy都不一樣,取決于 這個(gè).so文件代碼段和數(shù)據(jù)段內(nèi)存映射的位置.
 82#使用-fPIC,則產(chǎn)生的代碼中,沒(méi)有絕對(duì)地址,全部使用相對(duì)地址,故而代碼可以被加載器加載到內(nèi)存的任意位置,都可以正確的執(zhí)行
 83#最終連接目標(biāo)是.so(動(dòng)態(tài)庫(kù))
 84#$(BIN) : $(COBJS) $(CPPOBJS)
 85#-shared -fPIC-o $(BIN) $(COBJS) $(CPPOBJS) $(LIBS)
 86#-rm $(COBJS) $(CPPOBJS)
 87
 88####################################
 89#最終鏈接目標(biāo)是可執(zhí)行文件
 90$(BIN) : $(COBJS) $(CPPOBJS)
 91 $(CPP) -o $(BIN) $(COBJS) $(CPPOBJS) $(LIBS)
 92 -rm $(COBJS) $(CPPOBJS)
 93# 鏈接為最終目標(biāo)
 94
 95
 96#引入了.o文件對(duì).c和.h的依賴(lài)情況。以后.h被修改也會(huì)重新生成,可看看.d文件內(nèi)容即知道為何
 97#引入了依賴(lài)就相當(dāng)于引入了一系列的規(guī)則,因?yàn)橐蕾?lài)內(nèi)容例如: 目錄/xxx.o:目錄/xxx.c 目錄/xxx.h 也相當(dāng)于隱含的引入了生成規(guī)則
 98#故上面不能在出現(xiàn)如: $(OBJS) : $(DEF)之類(lèi)。切記
 99#include $(CDEF) $(CPPDEF)
100.PHONY:clean cleanall
101
102#清除所有目標(biāo)文件以及生成的最終目標(biāo)文件
103clean:   
104 -rm $(BIN) $(COBJS) $(CPPOBJS)
105#rm *.d
106cleanall:
107 -rm $(BIN) $(COBJS) $(CPPOBJS)
108
109五、簡(jiǎn)單makefile模板:只有一個(gè).o文件
110#/***
111#
112#Copyright 2006 bsmith@qq.com
113#
114#Licensed under the Apache License, Version 2.0 (the "License");
115#you may not use this file except in compliance with the License.
116#You may obtain a copy of the License at
117#
118#   http://www.apache.org/licenses/LICENSE-2.0
119#
120#Unless required by applicable law or agreed to in writing, software
121#distributed under the License is distributed on an "AS IS" BASIS,
122#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
123#See the License for the specific language governing permissions and
124#limitations under the License.
125#
126#*/

127
128============project================
129PROJECT = db
130AUTHOR = bsmith
131HOME = .
132=================================
133
134==============bin===================
135TARGET = ../bin/db_d
136===================================
137
138========================================
139===========這里可以作為工程的include文件夾,所有的頭文件都可以放到這里===#
140IFLAGS =  -I"../common/luainclude/" -I"../common/net/" -I"../common/base/" -I"../common/tool/"  -I"../common/" -I"../common/tool/mysql/" -I"../common/luainclude/LuaBridge" -I"../common/luainclude/LuaBridge/detail" -I"../common/Act/" -I"../common/luainclude/LLua"
141===============config====================
142CC = g++
143CFLAGS = -w  -ldl -lrt -Wno-deprecated-declarations
144LFLAGS =  ../common/lib/liblxnet.a   ../common/lib/libxml.a ../common/lib/libbaseframe.a ../common/lib/libjemalloc.a   ../common/lib/liblua52.a -lpthread -lmysqlclient
145========================================
146#maintest.c tree/rbtree.c  多了子目錄,那就直接添加 目錄/*.c即可   所有的源文件--  .c文件列表  
147CSRCS = $(wildcard  ./*.c )  
148CPPSRCS = $(wildcard ./*.cpp )
149#所有的.o文件列表  
150COBJS := $(CSRCS:.c=.o)  
151CPPOBJS := $(CPPSRCS:.cpp=.o)  
152
153# args
154# [args] 生成模式. 0代表debug模式, 1代表release模式. make ver=r.
155ifeq ($(ver),r)
156    # release
157    CFLAGS +=  -O3
158    TARGET = ../bin/db_r
159else
160 # debug
161    CFLAGS += -g
162endif
163
164# ==================compile====================
165%.o : %.cpp 
166  $(CC) -g -c $(CFLAGS) $(IFLAGS) $(LFLAGS) $< -o $@ 
167 
168all : bin
169
170bin : $(TARGET)
171
172$(TARGET) : $(OBJS)
173 $(CC) $(CPPSRCS) -o $(TARGET) $(OBJS)  $(IFLAGS) $(LFLAGS) $(CFLAGS)
174
175install : $(TARGET)
176  @cp $(TARGET) $(HOME)/bin/
177  @ln -s $(HOME)/bin/$(TARGET) $(HOME)/bin/$(LINK) 
178  
179clean :
180 @rm -f $(OBJS)
181 @rm -f ../bin/$(TARGET)
182 @rm -f $(HOME)/bin/$(TARGET)
183 @rm -f $(HOME)/bin/$(LINK)
184 @rm -f ./*.o
185distclean:
186 @rm -f ./bin/$(TARGET)
187# ==========================================
188
189
190 
191


 

posted on 2015-12-31 20:11 Benjamin 閱讀(3488) 評(píng)論(0)  編輯 收藏 引用 所屬分類(lèi): linux

青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <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>
            日韩午夜在线| 麻豆精品传媒视频| 久久亚洲国产精品日日av夜夜| 亚洲网站在线看| 亚洲一级片在线观看| 亚洲五月婷婷| 欧美一级片在线播放| 久久青青草原一区二区| 男人插女人欧美| 亚洲人成在线播放| 亚洲乱码精品一二三四区日韩在线| 亚洲国产欧美国产综合一区| 亚洲精品在线视频| 亚洲欧美福利一区二区| 久久久久久久激情视频| 欧美大尺度在线观看| 欧美日韩一级黄| 国产一区二区三区在线免费观看| 亚洲国产精品一区二区www在线| 亚洲美女在线视频| 欧美亚洲一级片| 亚洲高清色综合| 亚洲天堂av在线免费观看| 久久久久九九视频| 国产精品乱人伦中文| 亚洲国产高清视频| 亚洲欧美在线网| 亚洲电影在线免费观看| 亚洲视频一起| 欧美wwwwww| 国产美女精品| 日韩一区二区电影网| 久久九九精品| 中文国产一区| 欧美黄色视屏| 怡红院av一区二区三区| 午夜影院日韩| 亚洲精品国久久99热| 久久精品国产在热久久| 国产精品成人免费| 最新国产の精品合集bt伙计| 久久黄色网页| 亚洲视频网站在线观看| 欧美日产国产成人免费图片| 亚洲第一天堂无码专区| 久久久精品动漫| 中日韩视频在线观看| 欧美日本中文字幕| 亚洲日本免费| 欧美**字幕| 久久久久国产一区二区三区| 亚洲精品少妇网址| 久久香蕉国产线看观看网| 宅男精品视频| 欧美成人亚洲成人日韩成人| 一区一区视频| 久久久久久久一区二区三区| 亚洲欧美网站| 国产日韩欧美亚洲一区| 午夜精品久久久久久久男人的天堂 | 欧美日韩国产成人高清视频| 亚洲激情另类| 亚洲国产1区| 欧美电影免费| 99国产成+人+综合+亚洲欧美| 欧美激情视频网站| 免费永久网站黄欧美| 亚洲国产成人在线| 亚洲国产精品小视频| 欧美日韩精品一本二本三本| 亚洲午夜久久久久久尤物 | 99精品久久| 国产精品分类| 欧美一区二区三区另类| 亚洲资源av| 国产日韩专区在线| 久久亚洲私人国产精品va| 久久久久一区二区三区| 亚洲国产aⅴ天堂久久| 亚洲国产精品视频| 欧美日韩国产成人在线免费 | 国产欧美精品| 久久人91精品久久久久久不卡| 久久精品人人做人人综合| 在线观看中文字幕亚洲| 最新日韩在线视频| 国产精品视频免费观看www| 久久久91精品| 欧美激情一级片一区二区| 亚洲欧美日韩一区在线| 久久久免费精品| 亚洲永久精品国产| 久久久国产精品一区二区三区| 亚洲美女在线视频| 欧美影院精品一区| 99这里只有精品| 欧美亚洲自偷自偷| 99视频精品全部免费在线| 午夜精品一区二区三区在线| 亚洲精品久久久久中文字幕欢迎你 | 美女尤物久久精品| 亚洲欧美日韩在线观看a三区 | 亚洲一区二区三区免费视频 | 欧美一区二视频| 亚洲人成在线观看| 亚洲免费视频一区二区| 亚洲欧洲精品一区二区三区| 亚洲免费在线看| 99视频精品全部免费在线| 久久精品国产欧美亚洲人人爽 | 久久视频国产精品免费视频在线| 欧美高清视频一区二区| 午夜综合激情| 麻豆亚洲精品| 久久精品一区二区三区不卡| 欧美日韩国产不卡| 亚洲第一毛片| 激情文学综合丁香| 亚洲欧美卡通另类91av| 一区二区久久| 欧美福利影院| 欧美激情 亚洲a∨综合| 韩国一区电影| 香港久久久电影| 欧美一区二区观看视频| 国产精品高潮久久| 夜夜躁日日躁狠狠久久88av| 亚洲精品美女在线观看播放| 久久久久国内| 欧美mv日韩mv国产网站| 国语对白精品一区二区| 午夜一区二区三区在线观看| 午夜精品久久久久久久| 国产精品福利在线观看| 中文日韩在线视频| 亚洲自拍偷拍麻豆| 国产精品乱人伦一区二区| 一区二区欧美亚洲| 亚洲欧美文学| 国产欧美日韩精品在线| 欧美一区二区三区免费视频| 久久成人精品一区二区三区| 国产三区二区一区久久| 久久99在线观看| 久久性色av| 91久久久久久久久| 欧美日韩在线观看视频| 亚洲特级片在线| 欧美一区二区三区在线观看| 国产亚洲欧美日韩一区二区| 欧美主播一区二区三区美女 久久精品人 | 亚洲欧美中文在线视频| 国产精品免费看| 亚洲免费视频观看| 久久精品女人| 亚洲经典在线看| 欧美日韩国产999| 亚洲在线视频| 免费亚洲电影在线| 亚洲视频中文字幕| 亚洲二区在线| 国产精品日韩欧美一区二区三区 | 国产欧美日韩亚洲一区二区三区 | 欧美性猛交视频| 亚洲欧美在线播放| 欧美第十八页| 在线一区欧美| 国产热re99久久6国产精品| 久久精品一本| 亚洲精品久久久久久一区二区| 亚洲砖区区免费| 在线观看成人av电影| 欧美日韩和欧美的一区二区| 亚洲欧美影音先锋| 亚洲国产黄色片| 欧美一级在线亚洲天堂| 在线日韩欧美| 国产精品国产自产拍高清av| 久久久人成影片一区二区三区观看 | 欧美一区2区视频在线观看| 免费亚洲电影| 亚洲欧美综合一区| 亚洲人线精品午夜| 国产视频一区三区| 欧美美女bb生活片| 久久精品在线播放| 亚洲在线观看| 一卡二卡3卡四卡高清精品视频| 麻豆久久久9性大片| 午夜亚洲影视| 一区二区高清视频| 亚洲国产综合在线看不卡| 国产精品自拍网站| 国产精品magnet| 欧美日韩国产精品一卡| 美女主播一区| 久久综合中文| 久久精品中文字幕一区二区三区 | 久久综合九色综合久99| 午夜在线a亚洲v天堂网2018|