Makefile的规则如下:

target ... : prerequisites ...

command ... ...

target可以是一个目标文件,也可以是Object File(例如helloworld.obj),也可以是执行文件和标签。

prerequisites就是生成target所需要的文件或是目标。

command也就是要达到target这个目标所需要执行的命令。

 

下面就是编译helloworld的makefile。

helloworld : helloworld.o

    cc -o helloworld helloworld .o

helloworld.o : helloworld.c

    cc -c main.c

clean:

    rm helloworld helloworl.o

转自:http://blog.csdn.net/chief1985/article/details/4705123

相关文章:

  • 2021-07-23
  • 2021-12-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-23
  • 2021-10-14
猜你喜欢
  • 2021-04-30
  • 2022-12-23
  • 2021-08-06
  • 2021-12-02
  • 2021-04-22
  • 2022-02-08
  • 2022-12-23
相关资源
相似解决方案