Makefile
4.48 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
CC = gcc
XX = g++
AR = ar
CUDA = /usr/local/cuda
NVCC = /usr/local/cuda/bin/nvcc
MNT_HOME = /home/cmhu/Project_VideoStructure
PROJECT_ROOT= $(MNT_HOME)/vehicle_structure_platform.git0708-3080-trt-face
DEPEND_DIR = $(MNT_HOME)/Linux_3rdparty
SDK_ROOT = $(MNT_HOME)/SDK
SRC_ROOT = $(PROJECT_ROOT)/src/VPT
SFX_DECODER_ROOT = $(PROJECT_ROOT)/src/SfxDecoder
CUDA_SRC_ROOT = $(PROJECT_ROOT)/src/cuda_src
UTOOLS_SSD_ROOT = $(DEPEND_DIR)/utools_trt_v1.4.0
HIDE_MODEL_CAFFE2 = $(PROJECT_ROOT)/model/hidemodel_caffe_1108
HIDE_MODEL_TRT = $(PROJECT_ROOT)/model/vptModeTrt
AUTHORITY_DIR = $(DEPEND_DIR)/authority_linux_20200114
TRT_ROOT = $(DEPEND_DIR)/TensorRT-8.6.1.6
OPENCV_ROOT = $(DEPEND_DIR)/opencv-4.5.4/release
FFMPEG_ROOT = $(DEPEND_DIR)/ffmpeg-5.0.1/release
SPDLOG_ROOT = $(DEPEND_DIR)/spdlog-1.9.2/release
TARGET = $(DEPEND_DIR)/video_structure_sdk_20220512/libmvpt.so
# DEFS=-DOS_LINUX -DLOG_INFO2
DEFS=-DOS_LINUX
INCLUDE= -I $(OPENCV_ROOT)/include/opencv4 \
-I $(OPENCV_ROOT)/include/opencv4/opencv2 \
-I $(UTOOLS_SSD_ROOT) \
-I $(SRC_ROOT) \
-I $(TRT_ROOT)/include \
-I $(DEPEND_DIR)/include/cairo \
-I $(SRC_ROOT)/sort \
-I $(SRC_ROOT)/snapshot_analysis \
-I $(HIDE_MODEL_CAFFE2) \
-I $(HIDE_MODEL_TRT) \
-I $(AUTHORITY_DIR) \
-I $(FFMPEG_ROOT)/include \
-I $(SDK_ROOT)/face_detect/face_detect \
-I $(SDK_ROOT)/human_car_parsing_trt/src/human_car_parsing \
-I $(SDK_ROOT)/human_parsing_trt/src/human_parsing \
-I $(SDK_ROOT)/non_vehicle_fea_trt/src/non_vehicle_fea_trt \
-I $(SDK_ROOT)/vehicle_color_trt/src/vehicle_color \
-I $(SDK_ROOT)/vehicle_fea_int8/vehicle_fea_int8 \
-I $(SDK_ROOT)/vehicle_plate_dr/vehicle_plate_dr \
-I $(SDK_ROOT)/vehicle_rear_recognition/src/vehicle_rear_recognition \
-I $(SDK_ROOT)/vehicle_recognize \
-I $(SDK_ROOT)/vpd2/vpd2 \
-I $(SPDLOG_ROOT)/include \
-I $(SFX_DECODER_ROOT) \
-I $(SFX_DECODER_ROOT)/common/inc \
-I $(SFX_DECODER_ROOT)/common/UtilNPP \
-I $(CUDA)/include \
-I $(CUDA_SRC_ROOT) \
LIBSPATH=-L/usr/local/cuda/lib64 -lcuda -lcudart -lcurand -lcublas \
-L/usr/lib/x86_64-linux-gnu -lnvcuvid \
-L$(DEPEND_DIR)/video_structure_sdk_20220512 -lSfxDecoder -lSfxStreamHandler -lSfxTranscoder -lSfxLog -lSfxHttpServer -lSfxNetwork\
-L$(DEPEND_DIR)/video_structure_sdk_20220512 -lface_detect -lvehicle_recognize -lvehicle_color -lhuman_parsing -lhuman_car_parsing -lnon_vehicle_fea_trt -lvehicle_rear_recognition -lvehicle_fea_int8 -lvehicle_plate_dr -lvpd2 \
-L$(UTOOLS_SSD_ROOT) -l:libutools.so \
-L$(DEPEND_DIR)/lib -l:liblibjasper.a -l:libIlmImf.a -l:liblibjpeg.a -l:liblibtiff.a -l:liblibpng.a \
-L $(FFMPEG_ROOT)/lib -lavformat -lavcodec -lswscale -lavutil -lavfilter -lswresample -lavdevice \
-L $(OPENCV_ROOT)/lib -lopencv_video -lopencv_highgui -lopencv_imgproc -lopencv_core -lopencv_imgcodecs\
-L$(AUTHORITY_DIR) -l:libauthority.a \
-L $(SPDLOG_ROOT)/lib -l:libspdlog.a \
CFLAGS_LIB=-g -O0 -Wall -Wno-deprecated $(DEFS) -lz -ldl -lpthread -fPIC -fvisibility=hidden -Wl,-Bsymbolic
CFLAGS = $(CFLAGS_LIB) $(INCLUDE) -std=c++11 -DUSE_CUDNN
# -DUNICODE -D_UNICODE
NFLAGS_LIB=-g -c $(DEFS) -shared -Xcompiler -fPIC -Xcompiler -fvisibility=hidden
NFLAGS = $(NFLAGS_LIB) $(INCLUDE) -std=c++11
LIBS=
SRCS:=$(wildcard $(SRC_ROOT)/*.cpp) \
$(wildcard ${SRC_ROOT}/sort/*.cpp) \
$(wildcard $(SRC_ROOT)/MD5/mID.cpp) \
$(wildcard $(HIDE_MODEL_CAFFE2)/*.cpp) \
$(wildcard $(HIDE_MODEL_TRT)/*.cpp) \
$(wildcard $(SRC_ROOT)/snapshot_analysis/*.cpp) \
$(wildcard $(SFX_DECODER_ROOT)/*.cpp) \
$(wildcard $(CUDA_SRC_ROOT)/*.cpp)
OBJS = $(patsubst %.cpp, %.o, $(notdir $(SRCS)))
CU_SOURCES = $(wildcard ${SRC_ROOT}/snapshot_analysis/*.cu) \
$(wildcard ${CUDA_SRC_ROOT}/*.cu) \
CU_OBJS = $(patsubst %.cu, %.o, $(notdir $(CU_SOURCES)))
all:$(TARGET)
$(TARGET):$(OBJS) $(CU_OBJS)
rm -f $(TARGET)
$(XX) $(CFLAGS) -shared -o $@ $^ $(LIBSPATH) $(LIBS) -Wl,-rpath=$(DEPEND_DIR)/video_structure_sdk_20220512
# rm -f *.o
%.o:$(SRC_ROOT)/%.cpp
$(XX) $(CFLAGS) -c $<
%.o:$(SRC_ROOT)/MD5/%.cpp
$(XX) $(CFLAGS) -c $<
%.o:$(SRC_ROOT)/sort/%.cpp
$(XX) $(CFLAGS) -c $<
%.o:$(HIDE_MODEL_CAFFE2)/%.cpp
$(XX) $(CFLAGS) -c $<
%.o:$(HIDE_MODEL_TRT)/%.cpp
$(XX) $(CFLAGS) -c $<
%.o:$(SRC_ROOT)/snapshot_analysis/%.cpp
$(XX) $(CFLAGS) -c $<
%.o:$(SRC_ROOT)/snapshot_analysis/%.cu
$(NVCC) $(NFLAGS) -o $@ $<
%.o:$(SFX_DECODER_ROOT)/%.cpp
$(XX) $(CFLAGS) -c $<
%.o:$(CUDA_SRC_ROOT)/%.cpp
$(XX) $(CFLAGS) -c $<
%.o:$(CUDA_SRC_ROOT)/%.cu
$(NVCC) $(NFLAGS) -o $@ $<
.PHONY:clean
clean:
rm -f *.o $(TARGET)