Makefile
2.71 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
BINNAME = ivrserver
DEP_ROOT = ../../dep/
INC_PATH = -Iinclude/
INC_PATH += -Iinclude/fs
INC_PATH += -Iinclude/cppconn
INC_PATH += -Iinclude/cppconn/nativeapi
INC_PATH += -I../../interface/output/bgcc/include/
INC_PATH += -I../../interface/output/bgcc/include/libs/
INC_PATH += -I../../interface/output/ims/include/
INC_PATH += -I../../interface/output/ivr/include
INC_PATH += -I$(DEP_ROOT)/mysql/output/include
INC_PATH += -I$(DEP_ROOT)/libcurl/output/include
INC_PATH += -I$(DEP_ROOT)/freeswitch/output/libs/esl/include
INC_PATH += -I$(DEP_ROOT)/json-c/output/include
INC_PATH += -I$(DEP_ROOT)/boost/output/include
LIB_PATH = -Llib
LIB_PATH += -L../../interface/output/ims/lib/linux/
LIB_PATH += -L../../interface/output/ivr/lib/linux/
LIB_PATH += -L../../interface/output/bgcc/lib/
LIB_PATH += -L$(DEP_ROOT)/mysql/output/lib
LIB_PATH += -L$(DEP_ROOT)/boost/output/lib
LIB_PATH += -L$(DEP_ROOT)/libcurl/output/lib
LIB_PATH += -L$(DEP_ROOT)/freeswitch/output/libs/esl/
LIB_PATH += -L$(DEP_ROOT)/json-c/output/lib
CXX = g++
OUTPUT_PATH = ./output
VERSION=${shell echo $$SCMPF_MODULE_VERSION}
LDFLAGS = -livr -lims -lesl -lbgcc -lcurl -lpthread -luuid -lmysqlclient -lmysqlclient_r -lmystrings -lmysys -lssl -lcrypto -lldap -llber -lrt -lz -ljson -lboost_system -ldl
CXX_FLAGS = -DSCMPF_MODULE_VERSION=\"$(VERSION)\" -Wall -pipe -Wno-unused-parameter -Wno-reorder -Wwrite-strings -Wswitch -g \
-fPIC -Winline -Wreturn-type -Wtrigraphs -Wformat -Wparentheses -Wpointer-arith \
-fthreadsafe-statics
OBJ_DIR = ./obj
SRC_DIR = ./src
SOURCES = $(wildcard $(SRC_DIR)/*.cpp) $(wildcard src/fs/*.cpp)
SOURCES += $(wildcard src/cppconn/*.cpp)
SOURCES += $(wildcard src/ims/*.cpp)
OBJS = $(patsubst %.cpp, $(OBJ_DIR)/%.o, $(SOURCES))
all: objdir outputdir
objdir:
if [ ! -d $(OBJ_DIR) ]; then mkdir -p $(OBJ_DIR); fi
if [ ! -d $(OBJ_DIR)/src ]; then mkdir -p $(OBJ_DIR)/src; fi
if [ ! -d $(OBJ_DIR)/src/ims ]; then mkdir -p $(OBJ_DIR)/src/ims; fi
if [ ! -d $(OBJ_DIR)/src/fs ]; then mkdir -p $(OBJ_DIR)/src/fs; fi
if [ ! -d $(OBJ_DIR)/src/cppconn ]; then mkdir -p $(OBJ_DIR)/src/cppconn; fi
outputdir: output
if [ ! -d $(OUTPUT_PATH) ]; then mkdir -p $(OUTPUT_PATH); fi
if [ ! -d $(OUTPUT_PATH)/conf ]; then mkdir -p $(OUTPUT_PATH)/conf; fi
if [ ! -d $(OUTPUT_PATH)/flow ]; then mkdir -p $(OUTPUT_PATH)/flow; fi
cp conf/bgcc.cfg $(OUTPUT_PATH)/conf
cp conf/*.conf $(OUTPUT_PATH)/conf
cp flow/*.flow $(OUTPUT_PATH)/flow
cp $(BINNAME) $(OUTPUT_PATH)/
output: $(OBJS)
ar -r libivrserver.a $(OBJS)
$(CXX) $(CXX_FLAGS) -o $(BINNAME) $(OBJS_BIDL) $(OBJS) $(INC_PATH) $(LIB_PATH) $(LDFLAGS)
$(OBJ_DIR)/%.o: %.cpp
$(CXX) $(CXX_FLAGS) -c $< -o $@ $(INC_PATH)
clean:
rm -rf output obj
rm -f libivrserver.a ivrserver