Makefile
2 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
BINNAME = acd_server
DEP_ROOT = ../../dep/
INC_PATH = -Iinclude/
INC_PATH += -I../../interface/output/bgcc/include/
INC_PATH += -I../../interface/output/bgcc/include/libs/
INC_PATH += -I../../interface/output/acd/include/
INC_PATH += -I../../interface/output/ims/include/
INC_PATH += -I$(DEP_ROOT)/mysql/output/include/
INC_PATH += -I$(DEP_ROOT)/json-c/output/include
LIB_PATH = -L../../interface/output/bgcc//lib/
LIB_PATH += -L../../interface/output/acd/lib/linux/
LIB_PATH += -L../../interface/output/ims/lib/linux/
LIB_PATH += -L$(DEP_ROOT)/mysql/output/lib/
LIB_PATH += -L$(DEP_ROOT)/json-c/output/lib
VERSION = "1-1-2-14"
TAG = ${VERSION}
#VERSION = ${shell echo $$SCMPF_MODULE_VERSION}
#TAG = ${shell echo $$SCMPF_MODULE_TAG}
CXXFLAGS = -Wall -W -pipe -Wno-unused-parameter -Wreorder -Wwrite-strings -Wswitch -Wno-sign-compare\
-g -D__XDEBUG__ -D__YDEBUG__ \
-fPIC -finline-functions -Winline -Wreturn-type -Wtrigraphs -Wformat -Wparentheses -Wpointer-arith -Werror \
-DACD_VERSION=\"$(VERSION)\" -DCVSTAG=\"$(TAG)\" -DPROJECT_NAME=\"$(BINNAME)\"\
# -Dprotected=public -Dprivate=public
LDFLAGS = -lacd -lims -lbgcc -lmysqlclient_r -lz -luuid -lpthread -lssl -lcrypto -lm -lrt -ldl -ljson -lssl -ldl -lcrypto
SOURCES = $(wildcard src/*.cpp)
OBJS = $(patsubst %.cpp,%.o,$(SOURCES))
CXX = g++
OUTPUT_PATH=./output/
#-----------------------------------------------------------------#
# make all
#-----------------------------------------------------------------#
all: clean outputdir
outputdir: output
if [ ! -d $(OUTPUT_PATH) ]; then mkdir -p $(OUTPUT_PATH); fi
if [ ! -d $(OUTPUT_PATH)/conf ]; then mkdir -p $(OUTPUT_PATH)/conf; fi
cp $(BINNAME) $(OUTPUT_PATH)/
cp conf/* $(OUTPUT_PATH)/conf
# cp test.cov $(OUTPUT_PATH)/test.cov
output: $(OBJS)
$(CXX) $(CXXFLAGS) -o $(BINNAME) $(OBJS) $(INC_PATH) $(LIB_PATH) $(LDFLAGS)
ar -r lib$(BINNAME).a $(OBJS)
$(OBJS): %.o: %.cpp
$(CXX) $(CXXFLAGS) -c $< -o $@ $(INC_PATH)
clean:
rm -f $(OBJS)
rm -f *.a
rm -f $(BINNAME)
rm -fr $(OUTPUT_PATH)