码迷,mamicode.com
首页 > 其他好文 > 详细

Makefile示例

时间:2014-05-26 00:40:59      阅读:252      评论:0      收藏:0      [点我收藏+]

标签:class   blog   c   code   a   com   

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
include ../../../makefile_comm/makefile.macro
 
INC = -I./ -I../include $(INC_CLIENT)  $(INC_CTLIB) $(INC_BYPROXY) $(INC_COMM_LIB) $(INC_HIREDIS) $(INC_MYSQL) $(INC_APP_PROTO)
 
#LIB =  -lz -lm $(LIB_BYPROXY) $(LIB_CTLIB) $(LIB_HIREDIS) $(LIB_MYSQL) ${LIB_APP_PROTO}
LIB =  -lz -lm -liconv $(LIB_CLIENT) $(LIB_APP_PROTO) $(LIB_BYPROXY)  $(LIB_CTLIB) $(LIB_HIREDIS) $(LIB_MYSQL)
 
BINARY = DBServer
BASEOBJS = $(patsubst ./%.cpp, ./%.o, $(wildcard ./*.cpp))
BASEOBJS += $(patsubst ./tablemodel/%.cpp, ./tablemodel/%.o, $(wildcard ./tablemodel/*.cpp))
BASEOBJS += $(patsubst ./redismodel/%.cpp, ./redismodel/%.o, $(wildcard ./redismodel/*.cpp))
BASEOBJS += $(patsubst ./command/%.cpp, ./command/%.o, $(wildcard ./command/*.cpp))
 
ifeq ($(MEMCHECK),1)
    CFLAGS += -DMEMCHECK
endif
    CXXFLAGS := $(CFLAGS)
 
#-----------------------------------------------------------
.PHONY: all clean so
 
all: $(BINARY)
 
$(BINARY): $(BASEOBJS)
    g++ $(CXXFLAGS) -o $@ $(BASEOBJS) $(LIB) -ldl
 
clean:
    rm -f $(BASESOOBJS) $(BASESO) $(BINARY) $(BASEOBJS) *.d ./tablemodel/*.d ./redismodel/*.d ./command/*.d
 
%.o: %.cpp
    g++ $(CXXFLAGS) $(INC) -fPIC -o $@ -c $<

  

Makefile示例,布布扣,bubuko.com

Makefile示例

标签:class   blog   c   code   a   com   

原文地址:http://www.cnblogs.com/binmaizhai/p/3750021.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!