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:

posted on 2016-10-10 22:13  J·Marcus  阅读(214)  评论(0编辑  收藏  举报

导航