CPP = g++ FLAG = -g -O2 -W -Wall -D_DEBUG -static -std=c++0x INCLUDE_DIR = ../../protobuf-2.4.0a/include:../include:. \ ../../include/boost/crypto/:../../log4cplus-1.0.4/include LIB_DIR = ../../protobuf-2.4.0a/lib:../Debug:../librtmp: \ ../../log4cplus-1.0.4/lib:/opt/boost/lib LIB_FILES = log4cplus:protobuf:protoc:pthread:dl:rt:datamgr:\ boost_thread:boost_filesystem:boost_system:rtmp:nat:expad INCLUDE = $(patsubst %, -I%, $(subst :, , $(INCLUDE_DIR))) LIB = $(patsubst %, -L%, $(subst :, , $(LIB_DIR))) LIBS = $(patsubst %, -l%, $(subst :, , $(LIB_FILES))) TARGET=libp2sp.a OBJ=Channel.o ChannelMgr.o ChannelMgrStat.o http_session.o TaskItem.o \ players_service.o players_session.o CTClient.o Acceptor.o \ NATClient.o UPnP_Wrapped.o peerMgr.o tcp_connection.o Connector.o \ io_service_pool.o flvParser.o request_parser.o Scheduler.o \ SchedulerAlgorithm.o SchedulerCallBack.o SchedulerDistribute.o \ SchedulerStatusInfo.o $(TARGET): $(OBJ) ar cqs ../Debug/$@ $^ include $(OBJ:.o=.d) Channel.o: Channel.cpp IChannel.h Channel.h CTClient.o Connector.o \ Scheduler.o SchedulerAlgorithm.o SchedulerCallBack.o \ SchedulerDistribute.o SchedulerStatusInfo.o TaskItem.o @echo "********************************************* Compling" $@ $(CPP) -c $(FLAG) $(INCLUDE) $(LIB) $(LIBS) Channel.cpp \ Scheduler.o -o $@ ChannelMgr.o: ChannelMgr.cpp IChannelMgr.h ChannelMgr.h Channel.o CTClient.o \ Connector.o TaskItem.o NATClient.o UPnP_Wrapped.o Acceptor.o \ players_session.o request_parser.o @echo "********************************************* Compling" $@ $(CPP) -c $(FLAG) $(INCLUDE) $(LIB) $(LIBS) ChannelMgr.cpp \ Channel.o -o $@ ChannelMgrStat.o: ChannelMgrStat.cpp IChannelMgr.h ChannelMgr.h Channel.o \ CTClient.o Connector.o TaskItem.o NATClient.o UPnP_Wrapped.o \ Acceptor.o players_session.o request_parser.o @echo "********************************************* Compling" $@ $(CPP) -c $(FLAG) $(INCLUDE) $(LIB) $(LIBS) ChannelMgrStat.cpp \ -o $@ peerMgr.o: peerMgr.cpp peerMgr.h tcp_connection.o CTClient.o \ io_service_pool.o Connector.o @echo "******************************************** Compling" $@ $(CPP) -c $(Flag) $(INCLUDE) $(LIB) $(LIBS) peerMgr.cpp \ tcp_connection.o CTClient.o io_service_pool.o -o $@ http_session.o: http_session.cpp http_session.h io_service_pool.o TaskItem.o @echo "********************************************* Compling" $@ $(CPP) -c $(Flag) $(INCLUDE) $(LIB) $(LIBS) http_session.cpp \ io_service_pool.o -o $@ Scheduler.o: Scheduler.cpp RequestInterface.h Scheduler.h peerMgr.o \ http_session.o TaskItem.o @echo "********************************************* Compling" $@ $(CPP) -c $(FLAG) $(INCLUDE) $(LIB) $(LIBS) Scheduler.cpp peerMgr.o \ http_session.o -o $@ SchedulerAlgorithm.o: Scheduler.h SchedulerAlgorithm.cpp TaskItem.o @echo "********************************************* Compling" $@ $(CPP) -c $(FLAG) $(INCLUDE) $(LIB) $(LIBS) SchedulerAlgorithm.cpp SchedulerCallBack.o: SchedulerCallBack.cpp Scheduler.h TaskItem.o @echo "********************************************* Compling" $@ $(CPP) -c $(FLAG) $(INCLUDE) $(LIB) $(LIBS) SchedulerCallBack.cpp SchedulerDistribute.o: SchedulerDistribute.cpp Scheduler.h TaskItem.o @echo "********************************************* Compling" $@ $(CPP) -c $(FLAG) $(INCLUDE) $(LIB) $(LIBS) SchedulerDistribute.cpp SchedulerStatusInfo.o: SchedulerStatusInfo.cpp Scheduler.h TaskItem.o @echo "********************************************* Compling" $@ $(CPP) -c $(FLAG) $(INCLUDE) $(LIB) $(LIBS) SchedulerStatusInfo.cpp TaskItem.o: TaskItem.cpp ITaskItem.h TaskItem.h @echo "********************************************* Compling" $@ $(CPP) -c $(Flag) $(INCLUDE) $(LIB) $(LIBS) $< -o $@ players_service.o: players_service.cpp players_service.h \ players_session.o ChannelMgr.o ChannelMgrStat.o request_parser.o \ io_service_pool.o CTClient.o @echo "********************************************* Compling" $@ $(CPP) -c $(Flag) $(INCLUDE) $(LIB) $(LIBS) players_service.cpp \ players_session.o ChannelMgr.o io_service_pool.o -o $@ players_session.o: players_session.cpp players_session.h flvParser.o \ request_parser.o flvParser.o TaskItem.o @echo "********************************************* Compling" $@ $(CPP) -c $(Flag) $(INCLUDE) $(LIB) $(LIBS) players_session.cpp \ flvParser.o request_parser.o -o $@ CTClient.o: CTClient.cpp CTClient.h io_service_pool.o @echo "******************************************** Compling" $@ $(CPP) -c $(Flag) $(INCLUDE) $(LIB) $(LIBS) CTClient.cpp \ io_service_pool.o -o $@ Acceptor.o: Acceptor.cpp Acceptor.h tcp_connection.o io_service_pool.o @echo "******************************************** Compling" $@ $(CPP) -c $(Flag) $(INCLUDE) $(LIB) $(LIBS) Acceptor.cpp \ tcp_connection.o io_service_pool.o -o $@ Connector.o: Connector.cpp Connector.h io_service_pool.o tcp_connection.o @echo "******************************************** Compling" $@ $(CPP) -c $(Flag) $(INCLUDE) $(LIB) $(LIBS) Connector.cpp \ tcp_connection.o io_service_pool.o CTClient.o -o $@ NATClient.o: NATClient.cpp NATClient.h io_service_pool.o CTClient.o UPnP_Wrapped.o @echo "******************************************** Compling" $@ $(CPP) -c $(Flag) $(INCLUDE) $(LIB) $(LIBS) NATClient.cpp \ io_service_pool.o CTClient.o -o $@ UPnP_Wrapped.o: UPnP_Wrapped.cpp UPnP_Wrapped.h @echo "******************************************** Compling" $@ $(CPP) -c $(Flag) $(INCLUDE) $(LIB) $(LIBS) $< -o $@ tcp_connection.o: tcp_connection.cpp tcp_connection.h CTClient.o \ TaskItem.o @echo "******************************************** Compling" $@ $(CPP) -c $(Flag) $(INCLUDE) $(LIB) $(LIBS) tcp_connection.cpp \ CTClient.o TaskItem.o -o $@ io_service_pool.o: io_service_pool.cpp io_service_pool.h @echo "******************************************** Compling" $@ $(CPP) -c $(Flag) $(INCLUDE) $(LIB) $(LIBS) $< -o $@ flvParser.o: flvParser.cpp flvParser.h @echo "******************************************** Compling" $@ $(CPP) -c $(Flag) $(INCLUDE) $(LIB) $(LIBS) $< -o $@ request_parser.o: request_parser.cpp request_parser.h @echo "******************************************** Compling" $@ $(CPP) -c $(Flag) $(INCLUDE) $(LIB) $(LIBS) $< -o $@ %.d: %.cpp @echo "************************ Creating dependency info for: " $^ rm -f $@; \ $(CPP) -MM $(FLAG) $(INCLUDE) $(LIB) $(LIBS) $< > $@.$$$$; \ sed 's, \($*\)\.o[ :]*,\1.0 $@ : ,g' < $@.$$$$ > $@; \ rm -f $@.$$$$ .PHONY : clean clean : rm -f $(OBJ) $(TARGET) *.d