makefile 编译动态链接库模板
Posted externzhang
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了makefile 编译动态链接库模板相关的知识,希望对你有一定的参考价值。
############################################################# # Makefile for shared library. # 编译动态链接库 ############################################################# #set your own environment option CC = g++ CC_FLAG = -D_NOMNG -D_FILELINE #set your inc and lib INC = LIB = -lpthread -L./ -lsvrtool #make target lib and relevant obj PRG = libsvrtool.so OBJ = Log.o #all target all:$(PRG) $(PRG):$(OBJ) $(CC) -shared -o [email protected] $(OBJ) $(LIB) .SUFFIXES: .c .o .cpp .cpp.o: $(CC) $(CC_FLAG) $(INC) -c $*.cpp -o $*.o .PRONY:clean clean: @echo "Removing linked and compiled files......; rm -f $(OBJ) $(PRG)