linux:最简单的makefile使用(自我复习使用)

1:创建makefile(大小写均可)

touch makefile

2:使用vim打开makefile

vim makefile

3.编写makefile

  test:test.c
      gcc -o $@ $^
  .PHONY:clean
  clean:
      rm -f test 

4:创建依赖文件test.c

touch test.c

5:使用vim打开并且编写test.c

vim test.c
#include<stdio.h>
int main()
{
  printf("i like linux");
}

6:在执行街面使用make和make clean指令

 

猜你喜欢

转载自blog.csdn.net/qq_62718027/article/details/128448800
今日推荐