应用程序的makefile编写例程
2015-08-13 23:11
260 查看
假设应用程序源程序有三个文件main.c,printf.c,printf.h,生成执行文件为helloworld
假如main.c,printf.c,printf.h与makefile在同一目录,则makefile可以如下编写:
假如main.c,printf.c与makefile在同一目录,而printf.h在当前目录的/include下,则makefile可如下编写:
假如main.c,printf.c,printf.h与makefile在同一目录,则makefile可以如下编写:
helloworld : main.o printf.o gcc -o helloworld main.o printf.o main.o : main.c gcc -c main.c printf.o : printf.c gcc -c printf.c clean: rm main.o printf.o helloworld
假如main.c,printf.c与makefile在同一目录,而printf.h在当前目录的/include下,则makefile可如下编写:
helloworld : main.o printf.o gcc -o helloworld main.o printf.o CFLAGS := -I$(shell pwd)/include main.o : main.c gcc -c main.c $(CFLAGS) printf.o : printf.c gcc -c printf.c $(CFLAGS) clean: rm main.o printf.o helloworld
相关文章推荐
- 【系统编程】文件I/O编程
- Unity3D 调用Android与IOS的剪贴板
- Android ViewPager无限滑动(支持左右,存在传入数量限制)方式二
- eclipse部署web项目至本地的tomcat但在webapps中找不到
- 理解异步,同步,阻塞,非阻塞之间的关系
- 矩阵的理解
- Android编程之LocalBroadcastManager源码详解
- k8测试的一个问题
- jQuery Validate使用bootstrap错误提示样式
- linux 设备模型(一 bus)
- The last packet sent successfully to the server was 0 milliseconds ago, The driver has not received
- coj 1345: Grayscale
- c 语言 删除字符串中尾部的空格符 制表符与换行符
- 成为Java高手的25个学习目标
- 关于迭代和递归的思考
- 循环报数
- iOS设计模式---命令模式
- 自定义 URL Scheme 完全指南
- opencv特征提取
- swift-08-使用键值对儿统计字符在字符串中出现的次数