博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
应用程序的makefile编写例程
阅读量:4286 次
发布时间:2019-05-27

本文共 589 字,大约阅读时间需要 1 分钟。

假设应用程序源程序有三个文件main.c,printf.c,printf.h,生成执行文件为helloworld

假如main.c,printf.c,printf.h与makefile在同一目录,则makefile可以如下编写:

helloworld : main.o printf.o    gcc -o helloworld main.o printf.omain.o : main.c    gcc -c main.cprintf.o : printf.c    gcc -c printf.cclean:    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.oCFLAGS := -I$(shell pwd)/includemain.o : main.c    gcc -c main.c $(CFLAGS)printf.o : printf.c    gcc -c printf.c $(CFLAGS)clean:    rm main.o printf.o helloworld

转载地址:http://kqigi.baihongyu.com/

你可能感兴趣的文章
NESSUS扫描操作指导
查看>>
C语言读取文件大小,载入文件全部内容
查看>>
C语言 static静态变量的作用
查看>>
Linux(C/C++)下的文件操作open、fopen与freopen
查看>>
C语言 文件操作的头文件
查看>>
C语言的常用库函数(dos)之四(dir.h文件下的一些函数)
查看>>
warning: jobserver unavailable: using -j1. Add `+' to parent make rule问题怎么解决
查看>>
防火墙报文转发流程
查看>>
以太坊创始人:17岁的亿万富翁养成记
查看>>
linux下IPTABLES配置详解
查看>>
关于iptables -m选项以及规则的理解
查看>>
linux系统中查看己设置iptables规则
查看>>
一些库函数的使用注意事项
查看>>
IPv6地址自动配置中的有状态(stateful)和无状态(stateless)的区别
查看>>
阿里云 ACP 云安全 题库总结
查看>>
阿里云 ACP 云安全 题库 -- 数据库审计部分
查看>>
GC 回收机制
查看>>
探究 Android MVC、MVP、MVVM 的区别以及优缺点
查看>>
深入分析 Handler 内存泄露
查看>>
解决 windows 文件被占用的问题 -- The action can‘t be completed because the folder is open in another program
查看>>