linux makefile 基础
2014-05-05 18:45
363 查看
linux makefile基础
gcc -c -o test.o test.c
gcc -o helloworld test.o
1.做成makefile如下所示:
helloworld:test.o
gcc -o helloworld test.o
test.o:test.c
gcc -c -o test.o test.c
执行:ke -f helloworld
2.其中$@代表目标文件,$^代表依赖文件
可以改写为:
helloworld:test.o
gcc -o $@ $^
test.o:test.c
gcc -c -o $@ $^
注:1.运行makefile文件的命令是:make -f filename
2 直接运行 gcc -c -o test test.c 可直接生成 test可执行文件
gcc -c -o test.o test.c
gcc -o helloworld test.o
1.做成makefile如下所示:
helloworld:test.o
gcc -o helloworld test.o
test.o:test.c
gcc -c -o test.o test.c
执行:ke -f helloworld
2.其中$@代表目标文件,$^代表依赖文件
可以改写为:
helloworld:test.o
gcc -o $@ $^
test.o:test.c
gcc -c -o $@ $^
注:1.运行makefile文件的命令是:make -f filename
2 直接运行 gcc -c -o test test.c 可直接生成 test可执行文件
相关文章推荐
- ebs 12.1.3 clone for linux6
- Linux 读取文件n行并删除方法
- linux如何修改主机名
- Android Camera子系统之Linux C应用开发者View
- Hadoop集群(第1期)_CentOS安装配置
- linux之find命令
- Linux--批量安装centos
- linux查找目录下的所有文件中是否含有某个字符串
- linux 内存溢出(oom)和内存泄漏(leak)
- 关于Linux系统中文件或目录的s、t权限位的说明
- 大话USB驱动之基础概念
- Linux 下卸载MySQL 5
- Linux Makefile学习之旅(1)----规则
- linux下获取ip地址的命令行
- linux下拷贝目录下的所有文件(文件夹)
- Linux hosts.allow与hosts.deny文件设置
- sprintf,snprintf的用法(可以作为linux中itoa函数的补充)
- Linux-dhcpd
- Linux下搭建FTP服务器
- 浅析linux内核内存管理之buddy system