首页 > 代码库 > Makefile示例
Makefile示例
?
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 $< |
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。