My first makefile to compile multiple C files

Posted NONE

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了My first makefile to compile multiple C files相关的知识,希望对你有一定的参考价值。

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的主要内容,如果未能解决你的问题,请参考以下文章