首页 > 代码库 > makefile模板(生成.so)
makefile模板(生成.so)
# Make command to use for dependenciesRM=rmMKDIR=mkdirOUTDIR=_objSODIR=./binLIBNAME=pdk_ai.soOUTFILE=$(SODIR)/$(LIBNAME)INC=-I../../../../lib/svrlib/include -I../../../../lib/tinyxml -I../../../include LIB=-lpthread -lrt -ldl #obj dirTINYXML=../../../../lib/tinyxmlEXEFILE=$(EXEDIR)/$(APP)SRC := $(wildcard *.cpp $(TINYXML)/*.cpp)OBJ := $(patsubst %.cpp, $(OUTDIR)/%.o, $(notdir ${SRC})) COMPILE=g++ -c -o "$(OUTDIR)/$(*F).o" $(INC) -fPIC -w "$<"LINK=g++ -o "$(OUTFILE)" $(OBJ) $(LIB) -shared -fPIC# Pattern rules$(OUTDIR)/%.o : $(TINYXML)/%.cpp $(COMPILE)$(OUTDIR)/%.o : ./%.cpp $(COMPILE) # Build rulesall: $(OUTFILE)$(OUTFILE): $(OUTDIR) $(OBJ) $(LINK)# sh sh_ver.sh ./win/svrlib.rc $(OUTFILE) #update ver. ( read by "readelf -h libsvr.so")# sh sh_tar.sh ./win/*.rc $(SODIR) $(LIBNAME) #tar file$(OUTDIR): $(MKDIR) -p "$(OUTDIR)" $(MKDIR) -p "$(SODIR)" # Rebuild this projectrebuild: cleanall all# Clean this projectclean: $(RM) -f $(OUTFILE) $(RM) -f $(OBJ)# Clean this project and all dependenciescleanall: clean
makefile模板(生成.so)
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。