makefile 获取当前目录下.c .cpp .so文件

#根据当前目录添加自己的库
#获取所有.so文件全路径
ALL_LIBS = ${wildcard ppserver/obj/lib/*.so}
#去除前边拉路径,只剩下文件名
FILE_LIBS = $(notdir  $(ALL_LIBS))
#去除文件名后缀
NAME_LIBS = $(basename $(FILE_LIBS))
#去除文件名前缀
DEST_LIBS = $(patsubst lib%,%,$(NAME_LIBS))
#makefile变量只能在target外部定义和修改
all:
    @echo $(ALL_LIBS)
    @echo 
    @echo $(FILE_LIBS)
    @echo 
    @echo $(NAME_LIBS)

你可能感兴趣的:(makefile)