-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmkf5.html
More file actions
34 lines (32 loc) · 6.14 KB
/
Copy pathmkf5.html
File metadata and controls
34 lines (32 loc) · 6.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<html><head><meta charset="utf-8" /><link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/shuzijun/[email protected]/src/main/resources/vditor/dist/index.css"/><script src="https://cdn.jsdelivr.net/gh/shuzijun/[email protected]/src/main/resources/vditor/dist/js/i18n/zh_CN.js"></script><script src="https://cdn.jsdelivr.net/gh/shuzijun/[email protected]/src/main/resources/vditor/dist/method.min.js"></script></head><body style="width: 1075px;"><div class="vditor-reset" id="preview"><h2 id="1---makefile中的伪目标--PHONY-clean-"><em><em>1 . makefile中的伪目标(.PHONY:clean)</em></em><a id="vditorAnchor-1---makefile中的伪目标--PHONY-clean-" class="vditor-anchor" href="#1---makefile中的伪目标--PHONY-clean-"><svg viewBox="0 0 16 16" version="1.1" width="16" height="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a></h2>
<blockquote>
<blockquote>
<p>声明到伪目标之后,makefile将不会判断目标是否存在或者目标是否需要更新;<br />
避免Makefile中定义的执行命令的目标和实际文件名冲突</p>
</blockquote>
</blockquote>
<h2 id="2---模式匹配---目标--依赖"><em><em>2 . 模式匹配——%目标:%依赖</em></em><a id="vditorAnchor-2---模式匹配---目标--依赖" class="vditor-anchor" href="#2---模式匹配---目标--依赖"><svg viewBox="0 0 16 16" version="1.1" width="16" height="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a></h2>
<h4 id="-是目标和依赖的相同部分的通配">%是目标和依赖的相同部分的通配<a id="vditorAnchor--是目标和依赖的相同部分的通配" class="vditor-anchor" href="#-是目标和依赖的相同部分的通配"><svg viewBox="0 0 16 16" version="1.1" width="16" height="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a></h4>
<img src="../global-src/mod.png" alt="">
<h2 id="3---一个模式匹配的案例"><em><em>3 . 一个模式匹配的案例</em></em><a id="vditorAnchor-3---一个模式匹配的案例" class="vditor-anchor" href="#3---一个模式匹配的案例"><svg viewBox="0 0 16 16" version="1.1" width="16" height="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a></h2>
<pre><code>%.o : %.cpp
$(CXX) -c $^ -o $@
</code></pre>
<p>上面代码的模式匹配可以代替下面代码的方案,前提是你已声明了查找的规则</p>
<pre><code>add.o : add.cpp
$(CXX) -c $^ -o $@
main.o : main.cpp
$(CXX) -c $^ -o $@
</code></pre>
<pre><code># 这里是你已声明的规则
OBJ = add.o main.o(或者写OBJ = $(patsubst %.cpp, %.o, $(wildcard ./*.cpp)))
TARGET = main
</code></pre>
<h4 id="替换命令">替换命令<a id="vditorAnchor-替换命令" class="vditor-anchor" href="#替换命令"><svg viewBox="0 0 16 16" version="1.1" width="16" height="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a></h4>
<pre><code>SRC := main.c add.cpp
OBJF := $(SRC:.cpp=.o)
all:
@echo "SRC = $(SRC)"
@echo "OBJF = $(OBJF)"
</code></pre>
</div><script> const previewElement = document.getElementById('preview'); Vditor.setContentTheme('idea-light', 'https://cdn.jsdelivr.net/gh/shuzijun/[email protected]/src/main/resources/vditor/dist/css/content-theme'); Vditor.codeRender(previewElement); Vditor.highlightRender({"enable":true,"lineNumber":false,"style":"dracula"}, previewElement, 'https://cdn.jsdelivr.net/gh/shuzijun/[email protected]/src/main/resources/vditor'); Vditor.mathRender(previewElement, { cdn: 'https://cdn.jsdelivr.net/gh/shuzijun/[email protected]/src/main/resources/vditor',math: {"engine":"KaTeX","inlineDigit":true,"macros":{}}}); Vditor.mermaidRender(previewElement, 'https://cdn.jsdelivr.net/gh/shuzijun/[email protected]/src/main/resources/vditor', 'light'); Vditor.flowchartRender(previewElement, 'https://cdn.jsdelivr.net/gh/shuzijun/[email protected]/src/main/resources/vditor'); Vditor.graphvizRender(previewElement, 'https://cdn.jsdelivr.net/gh/shuzijun/[email protected]/src/main/resources/vditor'); Vditor.chartRender(previewElement, 'https://cdn.jsdelivr.net/gh/shuzijun/[email protected]/src/main/resources/vditor', 'light'); Vditor.mindmapRender(previewElement, 'https://cdn.jsdelivr.net/gh/shuzijun/[email protected]/src/main/resources/vditor', 'light'); Vditor.abcRender(previewElement, 'https://cdn.jsdelivr.net/gh/shuzijun/[email protected]/src/main/resources/vditor'); Vditor.mediaRender(previewElement); Vditor.speechRender(previewElement); </script> <script src="https://cdn.jsdelivr.net/gh/shuzijun/[email protected]/src/main/resources/vditor/dist/js/icons/ant.js"></script></body></html>