Linux原理与应用——专题2:Makefile.pptVIP

  • 5
  • 0
  • 约7.09千字
  • 约 14页
  • 2019-10-12 发布于山东
  • 举报
武汉大学计算机学院 李文海 lwhaymail@21 GNU Make简介 程序员通过Makefile创建代码生成的规则以便于生成。 规则包含的三个方面: 生成文件自身。当编译时该文件将被创建。 是形成最终可执行文件必需的过程。如将*.c与*.o通过规则关联起来,则*.o将通过*.c得到。 依赖性的列表。任意存在依赖的对象的前导对象在生成之初必需由Makefile指出其所依赖的对象。 一旦定义了依赖,则被依赖的对象的任意修改都将触发依赖对象相应的变化。 一、简单的Makefile # ?all? is the default target. Simply make it point to myprogram all: myprogram # Define the components of the program, and how to link them together my program: io.o init.o compute.o gcc -o myprogram io.o init.o compute.o # Define the dependencies and compile information for the three C source code files compute.o: compute.c gcc –Wall –c –o compute.o

文档评论(0)

1亿VIP精品文档

相关文档