码迷,mamicode.com
首页 > 其他好文 > 详细

makefile 编译动态链接库模板

时间:2018-08-22 10:21:40      阅读:242      评论:0      收藏:0      [点我收藏+]

标签:color   get   and   链接库   flag   read   echo   Fix   code   

############################################################# 
# 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 $@ $(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)

 

makefile 编译动态链接库模板

标签:color   get   and   链接库   flag   read   echo   Fix   code   

原文地址:https://www.cnblogs.com/externzhang/p/9515790.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!