23,216
社区成员




g++ -g -O2 -std=gnu++11 -Isrc -Isrc/calcCenter -Isrc/datasources -Isrc/datasources/CTP -Isrc/datasources/CTP/foreign -Isrc/datasources/HB -Isrc/datasources/HB/foreign -Isrc/datasources/IB -Isrc/datasources/IB/foreign -Isrc/datasources/RTS -Isrc/datasources/RTS/foreign -Isrc/datasources/SP -Isrc/datasources/SP/foreign -Isrc/datasources/TT -Isrc/factory -Isrc/iniparser -Isrc/model -Isrc/odb -Isrc/quickfix -Isrc/socket -Isrc/state_define -Isrc/state_machine -Isrc/util -Isrc/zeromq -Iinclude -I/usr/include/python2.7 -MMD -c -o src/fix_datasources_router.o src/fix_datasources_router.cpp
####################################################
# Generic makefile - 万能Makefile
# for compiling and linking C++ projects on Linux
# Author: George Foot Modified:Jackie Lee
####################################################
### Customising
#
# Adjust the following if necessary; EXECUTABLE is the target
# executable's filename, and LIBS is a list of libraries to link in
# (e.g. alleg, stdcx, iostr, etc). You can override these on make's
# command line of course, if you prefer to do it that way.
#
#
#编译odb模块
#$(shell python src/odb/odbCompile.py)
# 可执行文件名
EXECUTABLE := lsad
exclude_dirs := svn doc .svn
#dirs_src := $(shell find ./src -maxdepth 10 -type d)
#适配Linux下svn。
dirs_src := $(shell find ./src -type d ! -path "*.svn*")
dirs_src := $(basename $(patsubst ./%,%,$(dirs_src)))
dirs_src := $(filter-out $(exclude_dirs),$(dirs_src))
#dirs_lib := $(shell find ./lib -maxdepth 10 -type d)
dirs_lib := $(shell find ./lib -type d ! -path "*.svn*")
dirs_lib := $(basename $(patsubst ./%,%,$(dirs_lib)))
dirs_lib := $(filter-out $(exclude_dirs),$(dirs_lib))
#dirs_include := $(shell find ./include -maxdepth 10 -type d)
dirs_include := $(shell find ./include -type d ! -path "*.svn*")
dirs_include := $(basename $(patsubst ./%,%,$(dirs_include)))
dirs_include := $(filter-out $(exclude_dirs),$(dirs_include))
# 动态库目录
LIBDIR:=$(dirs_lib)
# 动态库文件名
LIBS := log4cplus rt pthread rt ev mysqlpp python2.7
LIBS += quickfix quickttfix
LIBS += thostmduserapi thosttraderapi rtsapi securitymduserapi securitytraderapi
#thostmduserapi, thosttraderapi : CTP的lib
#rtsapi : RTS的lib
#securitymduserapi securitytraderapi: 华宝 CTP的lib
LIBS += odb-mysql odb-boost boost_date_time odb
#odb依赖的lib
# 头文件目录
INCLUDES:=$(dirs_src) $(dirs_include) /usr/include/python2.7
# 除了当前目录外,其他的源代码文件目录
SRCDIR:=$(dirs_src) $(dirs_include)
#
# # Now alter any implicit rules' variables if you like, e.g.:
# 避免clean子目录操作同名,加上_clean_前缀 -std=gnu++11 -Wall -Wunreachable-code -Wshadow -Wpointer-arith -Winline -Wnon-virtual-dtor
# -Wunknown-pragmas -Wunused-function -Wunused-label -Wunused-value -Wunused-variable -Wl,-Map,lsad.map
CC:=g++
#CFLAGS := -g -O2 -Wextra -Wunreachable-code -Wpointer-arith -std=gnu++11 -DMYSQLPP_MYSQL_HEADERS_BURIED
CFLAGS := -g -O2 -std=gnu++11
CPPFLAGS := $(CFLAGS)
CPPFLAGS += $(addprefix -I,$(INCLUDES))
CPPFLAGS += -MMD
#-std=gnu++11
#
# # The next bit checks to see whether rm is in your djgpp bin
# # directory; if not it uses del instead, but this can cause (harmless)
# # `File not found' error messages. If you are not using DOS at all,
# # set the variable to something which will unquestioningly remove
# # files.
#
RM-F := rm -f
# # You shouldn't need to change anything below this point.
#
SRCS := $(wildcard *.cpp) $(wildcard $(addsuffix /*.cpp, $(SRCDIR)))
OBJS := $(patsubst %.cpp,%.o,$(SRCS))
DEPS := $(patsubst %.o,%.d,$(OBJS))
MISSING_DEPS := $(filter-out $(wildcard $(DEPS)),$(DEPS))
MISSING_DEPS_SOURCES := $(wildcard $(patsubst %.d,%.cpp,$(MISSING_DEPS)))
.PHONY : all deps objs clean cleanall rebuild info odb
all: $(EXECUTABLE)
#当表结构改变时,重新编译odb
odb:
@/usr/bin/env python src/odb/odbCompile.py
deps : $(DEPS)
objs : $(OBJS)
clean :
@$(RM-F) $(DEPS)
@$(RM-F) $(OBJS)
@$(RM-F) src/odb/odb_tables-odb*
cleanall: clean
@$(RM-F) $(EXECUTABLE)
@$(RM-F) src/odb/odb_tables.sql
rebuild: cleanall all
ifneq ($(MISSING_DEPS),)
$(MISSING_DEPS) :
@$(RM-F) $(patsubst %.d,%.o,$@)
endif
-include $(DEPS)
$(EXECUTABLE) : $(OBJS)
$(CC) -o $(EXECUTABLE) $(OBJS) $(addprefix -L,$(LIBDIR)) $(addprefix -l,$(LIBS)) -DDATABASE_MYSQL
info:
@echo "[dirs_lib]" $(dirs_lib)
@echo "[dirs_src]" $(dirs_src)
@echo "[dirs_include]" $(dirs_include)
@echo "[LIBS]" $(LIBS)
@echo "[LIBDIR]" $(LIBDIR)
@echo "[INCLUDES]" $(INCLUDES)
@echo "[SRCS]" $(SRCS)
@echo "[OBJS]" $(OBJS)
@echo "[DEPS]" $(DEPS)
@echo "[MISSING_DEPS]" $(MISSING_DEPS)
@echo "[MISSING_DEPS_SOURCES]" $(MISSING_DEPS_SOURCES)