码迷,mamicode.com
首页 > 其他好文 > 详细

My first makefile to compile multiple C files

时间:2016-10-10 23:53:50      阅读:394      评论:0      收藏:0      [点我收藏+]

标签:

I have three files to compile: main.c, func.c,  func.h

The steps:

           1   main.c   to   main.o

           2   func.c    to   func.o

           3    link main.o func.o to main(file that can execute)

So, u need to run at least three commands without a Makefile.Then if u have 100 files to compile, how to do?

If u have a Makefile, u just need to type one word ‘make‘.

EASY

技术分享

 

技术分享

 

技术分享

 

And I writed a Makefile:

技术分享

 

test:

技术分享

My first makefile to compile multiple C files

标签:

原文地址:http://www.cnblogs.com/rixiang/p/5947510.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!