下面的代码复制后记得将tab替换成真正的tab符号
CC:=g++
LD:=ld
CPPFLAGS:=-std=c++11 -fpic
LDFLAGS:=-shared -fpic
SOURCE:=$(wildcard *.cpp)
OBJS:=$(patsubst %.cpp,%.o,$(SOURCE))
TARGET_LIB:=x.so
INCLUDE:=-I ./
LIB_PATH:=-L ./lib/zhongkong_linux64 \
-L ./lib/zmq
LIBS:=-lopencv_core -lopencv_highgui -lopencv_imgproc -lopencv_objdetect -lopencv_calib3d -lzmq -lrt -ldl -lpthread
all:$(OBJS)
echo $(OBJS)
$(LD) $(LDFLAGS) -o $(TARGET_LIB) $(OBJS) $(LIB_PATH) $(LIBS)
%.o:%.cpp
@echo Compiling $< ...
$(CC) -c $(CPPFLAGS) $< -o $*.o $(INCLUDE) $(LIB_PATH) $(LIBS)
.PHONY: clean
clean:
rm *.so *.o -rf