- 14
- 0
- 约7.26千字
- 约 8页
- 2018-11-07 发布于江苏
- 举报
从helloorld着手生成自动makefile
三、从helloworld 入手我们从大家最常使用的例子程序helloworld 开始。下面的过程如果简单地说来就是:新建三个文件:helloworld.cconfigure.inMakefile.am然后执行:aclocal; autoconf; automake --add-missing; ./configure; make; ./helloworld就可以看到Makefile 被产生出来,而且可以将helloworld.c 编译通过。很简单吧,几条命令就可以做出一个符合惯例的Makefile ,感觉如何呀。现在开始介绍详细的过程:1 、建目录在你的工作目录下建一个helloworld 目录,我们用它来存放helloworld 程序及相关文件,如在/home/my/build 下:$ mkdir helloword$ cd helloworld2 、 helloworld.c然后用你自己最喜欢的编辑器写一个hellowrold.c 文件,如命令:vi helloworld.c 。使用下面的代码作为helloworld.c 的内容。int main(int argc, char** argv){printf(Hello, Linux World!\n);return 0;}完成后保存退出。现在在h
原创力文档

文档评论(0)