<1>.gdb调试 + -g 选项
gcc -g test.c -o test
gdb test
命令栏:
1.run 运行
2.list
3.quit (q)退出程序
4.next (n)逐步执行,不进入子函数
5.break + 行数 打断点
6. print + 变量名 打印变量名
7. continue 运行结束
8.info break 查看断电信息
9.delete + 断电编号
10. step 单步执行
11.finish 结束当前函数
<2>make
tree 查看当前目录结构
make 批处理,也就是自动编译
项目工程;c文件在不同文件下实行的不同功能的文件的综合
makefile 是逻辑功能,使得make能完成任务
<3>.编写 makefile
1.三元素:目标,依赖,命令
2.冒号前面是目标,冒号后面是依赖
从第一行开始执行
例如:hello:hello.o
tab gcc hello.o -o hello
hello.o:hello.c
tab gcc -c hello.c
.PHONY:clean 定义伪目标
clean: rm -f hello.o hello
make clean 通过检查时间戳
make -f 指定那个makefile