首页 > 其他 > 详细

最简单的makefile

时间:2015-06-16 19:12:24      阅读:217      评论:0      收藏:0      [点我收藏+]

hello.c的内容如下:
#include <stdio.h>
int main()
{
    printf("Hello World!\n");
    return 0;
}
makefile 的内容如下:
hello.exe : hello.o
    gcc -o hello.exe hello.o
hello.o : hello.c   
    gcc -c hello.c
clean :  
    rm hello.o hello.exe
Windows命令行(cmd.exe)下,先进入makefile 所在目录,执行 make 命令。

就会生成hello.exe了。

注意:
1, makefile 文件没有扩展名。
2, 第二、第四行、第六行前必须有一个tab

最简单的makefile

原文:http://blog.csdn.net/he_zhidan/article/details/46521563

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!