读书笔记-2019年06月04日

Docker


docker commit -a="zzyy" -m="del tomcat docs" 容器ID atguigu/tomcat:1.2

//启动交互式终端 的tomcat 并绑定主机7788端口到容器8080端口
docker run -it -p 7788:8080 tomcat 

//启动
docker run -d -p 7788:8080 tomcat

Makefile

C语言:makefile自动编译,提高软件开发的效率,你会用吗?https://www.bilibili.com/video/av47568260
Windows 上一个文件的编译过程

从 .c .h 源码文本文件 经历了:

  1. 预编译
    库文件,头文件,宏展开
    gcc -E hello.c -o hello.i
  2. 汇编
    gcc -S hello.i -o hello.s
  3. 编译
    gcc -c hello.s -o hello.o
  4. 连接
    gcc hello.o -o hello
    变成了 .exe 可执行文件

Makefile: 编译神器。
全新脚本语言,语法,
使用Makefile去面对自己的多文件的c工程,快速编译。

创建Makefile: 新建一个没有扩展名的文件,命名为Makefile。

Makefile5层心法:

  1. 显式规则。
    1. 第一个目标文件是我们的终极目标(有点像递归)。
    2. 伪目标。
  2. 变量
    • = 替换
    • += 追加
    • := 常量
  3. 隐含规则
  4. 通配符

第一层. 显式规则:

语法格式:

#号是注释。

 目标文件:依赖文件
 Tab+指令

第一个目标文件是我们们的终极目标

#Makefile 必学
hello:hello.o
	gcc hello.o -o hello
hello.o:hello.s
	gcc -c hello.s -o hello.o
hello.s:hello.i
	gcc -S hello.i -o hello.s
hello.i:hello.c
	gcc -E hello.那个c -o hello.i
# 伪目标
.PHONY:

#  删除所有文件
clearall:
	rm -rf hello.i hello.s hello.o hello
# 删除过程文件
clear: 
	rm -rf hello.i hello.s hello.o

第二层. 变量

  1. = 替换
  2. += 追加
  3. := 常量

第三层. 隐含规则

两个例子:

  • %.c 任意的.c文件
  • %.o 任意的.o文件

第四层. 通配符

  • $^ 所有的目标文件
  • $@ 所有的依赖文件
  • $< 所有的依赖文件的第一个文件。

Darwin

Open Source - Releases

Building and Debugging Kernels

发布了100 篇原创文章 · 获赞 2 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/panda_8/article/details/90768694