1 cmake安装
方法1:
sudo apt install cmake
安装是没问题了,但是版本有点旧,卸载:
sudo apt autoremove cmake
方法2:
参考:https://blog.csdn.net/u010472607/article/details/76166008
2 makefile和cmake基本知识
补充:
(1)只对c文件编译,若是h文件改变,则调用该h文件的c文件也需要重新生成。
(2)@echo 可以打印输出结果,不加@,直接使用echo会把输出过程一起输出
@echo hhh -> hhh
echo hhh -> echo hhh
(3)
objects = main.o input.o calcu.o
main: $(objects)
gcc -o main $(objects)
.PHONY : clean
%.o : %.c
gcc -c $<
clean:
rm *.o
rm main
(4)
g++ --help可以看相关指令的操作
assemble汇编
参考:
a)视频1:https://www.bilibili.com/video/BV1vE411h7Fi (P16—P18)
b)视频2:https://www.bilibili.com/video/BV16V411k7eF
c)http://www.openedv.com/docs/boards/arm-linux/zdyz-i.mx6ull.html PDF合集资料链接: https://pan.baidu.com/s/1FSJY3PdFgV2WV4lT6Ps8fA 提取码:qsxb
【正点原子】I.MX6U嵌入式Linux驱动开发指南V1.6.pdf,第三章 Linux C编程入门
d)https://www.cnblogs.com/QG-whz/p/5461110.html
e)book: 跟我一起写makefile https://seisman.github.io/how-to-write-makefile/introduction.html
文章:CMAKE常用指令总结