第一次自己写makefile,记录一下
#Compilers #CXX=/opt/compiler/gcc-4.8.2/bin/g++ CXX = g++ #Includes INCLUDE_FLAGS = -I${OPENCV_PATH}/include/ #Libraries LIB_FLAGS = -L${OPENCV_PATH}/lib/ #DLLs LD_FLAGS = -lopencv_objdetect -lopencv_highgui -ljasper -ljpeg -ltiff -lpng -lopencv_features2d -lopencv_flann -lopencv_imgproc -lopencv_core -lz -lrt -ldl -lm -lpthread -lstdc++ -fopenmp #CPP Flags CPP_FLAGS = -O3 -W -Wall -msse -msse2 -msse3 -msse4.1 -fopenmp -fPIC #EXES EXE_ExamReg = ExamReg SO_ExamReg = ExamReg.so #Files FILES = ExamReg.o ChoiceRecModule.o Convert.o ExamException.o Gradient.o Historgram.o MLSVM.o PoseAlignModule.o stringfunc.o #Tasks all: ${EXE_ExamReg} ${SO_ExamReg} ${EXE_ExamReg}: ${FILES} ${CXX} ${CPP_FLAGS} $^ -o [email protected] ${INCLUDE_FLAGS} ${LIB_FLAGS} ${LD_FLAGS} ${SO_ExamReg}: $(FILES) ${CXX} ${CPP_FLAGS} $^ -shared -o [email protected] ${INCLUDE_FLAGS} ${LIB_FLAGS} ${LD_FLAGS} #FILE_CC %.o : %.cpp ${CXX} ${CPP_FLAGS} -c $< -o [email protected] ${INCLUDE_FLAGS} #Clean clean: rm -f *.o rm -f ${EXE_ExamReg} rm -f ${SO_ExamReg} #Auto build done
时间: 2024-10-10 12:40:49