makefile模板
来源:互联网 发布:禁止软件安装的软件 编辑:程序博客网 时间:2024/06/11 06:50
可执行文件
########################################### #Makefile for simple programs ########################################### INC= LIB= -lpthread CC=gcc CC_FLAG=-Wall PRG=test OBJ=test.o $(PRG):$(OBJ) $(CC) $(INC) $(LIB) -o $@ $(OBJ) .SUFFIXES: .c .o .c.o: $(CC) $(CC_FLAG) $(INC) -c $*.c -o $*.o .PRONY:clean clean: @echo "Removing linked and compiled files......" rm -f $(OBJ) $(PRG)
Linux执行结果就是test
动态库
############################################################# # Makefile for shared library. ############################################################# #set your own environment option CC = gcc CC_FLAG = #set your inc and lib INC = LIB = -lpthread -L./ #make target lib and relevant obj PRG = libtest.so OBJ = test.o #all target all:$(PRG) $(PRG):$(OBJ) $(CC) -shared -o $@ $(OBJ) $(LIB) .SUFFIXES: .c .o .c.o: $(CC) $(CC_FLAG) $(INC) -c $*.c -o $*.o .PRONY:clean clean: @echo "Removing linked and compiled files......; rm -f $(OBJ) $(PRG)
静态库
############################################################# # Makefile for static library. ############################################################# #set your own environment option CC = gcc CC_FLAG = #static library use 'ar' command AR = ar #set your inc and lib INC = LIB = -lpthread -L./ #make target lib and relevant obj PRG = libtest.a OBJ = test.o #all target all:$(PRG) $(PRG):$(OBJ) ${AR} rv ${PRG} $? .SUFFIXES: .c .o .c.o: $(CC) $(CC_FLAG) $(INC) -c $*.c -o $*.o .PRONY:clean clean: @echo "Removing linked and compiled files......" rm -f $(OBJ) $(PRG)
0 0
- makefile模板
- makefile模板
- makefile模板
- makefile 模板
- Makefile模板
- makefile模板
- Makefile 模板
- Makefile模板
- Makefile模板
- Makefile模板
- makefile 模板
- Makefile模板
- makefile 模板
- makefile模板
- makefile模板
- makefile模板
- Makefile 模板
- makefile模板
- python学习笔记--字符串str相关
- SwipeRefreshLayout配合RecyclerView实现下拉刷新和上拉加载更多以及没有数据的显示
- Linux网络NAT模式配置
- C++空类的作用一
- java设计模式的3种形式
- makefile模板
- weblogic 下异常 org.hibernate.QueryException: ClassNotFoundException: org.hibernate.hql.ast.HqlToken
- PHY芯片 AR8033 学习笔记
- Java 8 学习指南
- Servlet01
- ElasticSearch(三)--文档
- SIFT特征提取分析
- CodeForces - 141B Hopscotch (模拟)水
- 80端口被(Pid=4)占用的解决方法