Git Product home page Git Product logo

how-to-write-makefile's Introduction

Hi there 👋

I'm Dongdong, an Associate Professor of Geophysics at China University of Geosciences.

seisman's github stats

how-to-write-makefile's People

Contributors

8liang avatar allets avatar blindpirate avatar boltomli avatar fung-hwang avatar gaokuo510 avatar holyzfy avatar kpol-lgx avatar lewis1573 avatar lyq140 avatar mingchaoyan avatar mofelee avatar nikoladi avatar piggynl avatar rhanqtl avatar richardlcd avatar seisman avatar snowball-wang avatar warningroo avatar yihuajack avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

how-to-write-makefile's Issues

按照READ.ME运行该项目,遇到的Error

wl (master) how-to-write-makefile
$ e:/general/Firefox/firefox build/html/index.html&
[1] 7800
wl (master) how-to-write-makefile
$ make latexpdf
Running Sphinx v2.0.1
loading translations [zh_CN]... done
making output directory... done
loading pickled environment... done
WARNING: no Babel option known for language 'zh_CN'
building [mo]: targets for 0 po files that are out of date
building [latex]: all documents
updating environment: 0 added, 0 changed, 0 removed
looking for now-outdated files... none found
processing Makefile.tex... index overview introduction rules recipes variables c onditionals functions invoke implicit_rules archives postscript
resolving references...
done
writing... WARNING: no Babel option known for language 'zh_CN'
done
copying TeX support files... copying TeX support files...
done
build succeeded, 2 warnings.

The LaTeX files are in build\latex.
Latexmk: This is Latexmk, John Collins, 19 Jan. 2017, version: 4.52c.
Rule 'pdflatex': Rules & subrules not known to be previously run:
pdflatex
Rule 'pdflatex': The following rules & subrules became out-of-date:
'pdflatex'

Run number 1 of rule 'pdflatex'


Running 'xelatex -recorder "Makefile.tex"'

Latexmk: applying rule 'pdflatex'...
This is XeTeX, Version 3.14159265-2.6-0.99998 (TeX Live 2017/W32TeX) (preloaded format=xelatex)
restricted \write18 enabled.
entering extended mode
(./Makefile.tex
LaTeX2e <2017-04-15>
Babel <3.10> and hyphenation patterns for 6 language(s) loaded.
(./sphinxmanual.cls
Document Class: sphinxmanual 2018/12/23 v2.0 Document class (Sphinx manual)
(c:/texlive/2017/texmf-dist/tex/latex/base/report.cls
Document Class: report 2014/09/29 v1.4h Standard LaTeX document class
(c:/texlive/2017/texmf-dist/tex/latex/base/size10.clo)))
(c:/texlive/2017/texmf-dist/tex/latex/amsmath/amsmath.sty
For additional information on amsmath, use the `?' option.
(c:/texlive/2017/texmf-dist/tex/latex/amsmath/amstext.sty
(c:/texlive/2017/texmf-dist/tex/latex/amsmath/amsgen.sty))
(c:/texlive/2017/texmf-dist/tex/latex/amsmath/amsbsy.sty)
(c:/texlive/2017/texmf-dist/tex/latex/amsmath/amsopn.sty))
(c:/texlive/2017/texmf-dist/tex/latex/amsfonts/amssymb.sty
(c:/texlive/2017/texmf-dist/tex/latex/amsfonts/amsfonts.sty))
(c:/texlive/2017/texmf-dist/tex/generic/babel/babel.sty
(c:/texlive/2017/texmf-dist/tex/generic/babel-english/english.ldf
(c:/texlive/2017/texmf-dist/tex/generic/babel/babel.def
(c:/texlive/2017/texmf-dist/tex/generic/babel/xebabel.def))))
! Undefined control sequence.
l.21 \setmainfont
{FreeSerif}[
?

! LaTeX Error: Missing \begin{document}.

See the LaTeX manual or LaTeX Companion for explanation.
Type H for immediate help.
...

l.21 \setmainfont{F
reeSerif}[
?
! Undefined control sequence.
l.28 \setsansfont
{FreeSans}[
?
! Undefined control sequence.
l.35 \setmonofont
{FreeMono}[
?
(c:/texlive/2017/texmf-dist/tex/latex/fncychap/fncychap.sty) (./sphinx.sty
(c:/texlive/2017/texmf-dist/tex/generic/oberdiek/ltxcmds.sty)
(c:/texlive/2017/texmf-dist/tex/latex/graphics/graphicx.sty
(c:/texlive/2017/texmf-dist/tex/latex/graphics/keyval.sty)
(c:/texlive/2017/texmf-dist/tex/latex/graphics/graphics.sty
(c:/texlive/2017/texmf-dist/tex/latex/graphics/trig.sty)
(c:/texlive/2017/texmf-dist/tex/latex/graphics-cfg/graphics.cfg)
(c:/texlive/2017/texmf-dist/tex/latex/graphics-def/xetex.def)))
(c:/texlive/2017/texmf-dist/tex/latex/fancyhdr/fancyhdr.sty)
(c:/texlive/2017/texmf-dist/tex/latex/base/textcomp.sty
(c:/texlive/2017/texmf-dist/tex/latex/base/ts1enc.def))
(c:/texlive/2017/texmf-dist/tex/latex/titlesec/titlesec.sty)
(c:/texlive/2017/texmf-dist/tex/latex/tabulary/tabulary.sty
(c:/texlive/2017/texmf-dist/tex/latex/tools/array.sty))
(c:/texlive/2017/texmf-dist/tex/latex/tools/longtable.sty)
(c:/texlive/2017/texmf-dist/tex/latex/varwidth/varwidth.sty)
(./sphinxmulticell.sty) (c:/texlive/2017/texmf-dist/tex/latex/base/makeidx.sty)
(c:/texlive/2017/texmf-dist/tex/latex/framed/framed.sty)
(c:/texlive/2017/texmf-dist/tex/latex/xcolor/xcolor.sty
(c:/texlive/2017/texmf-dist/tex/latex/graphics-cfg/color.cfg))
(c:/texlive/2017/texmf-dist/tex/latex/fancyvrb/fancyvrb.sty
Style option: `fancyvrb' v2.7a, with DG/SPQR fixes, and firstline=lastline fix
<2008/02/07> (tvz)) (./footnotehyper-sphinx.sty)
(c:/texlive/2017/texmf-dist/tex/latex/float/float.sty)
(c:/texlive/2017/texmf-dist/tex/latex/wrapfig/wrapfig.sty)
(c:/texlive/2017/texmf-dist/tex/latex/parskip/parskip.sty)
(c:/texlive/2017/texmf-dist/tex/latex/base/alltt.sty)
(c:/texlive/2017/texmf-dist/tex/latex/upquote/upquote.sty)
(c:/texlive/2017/texmf-dist/tex/latex/capt-of/capt-of.sty)
(c:/texlive/2017/texmf-dist/tex/latex/needspace/needspace.sty)
(c:/texlive/2017/texmf-dist/tex/latex/carlisle/remreset.sty)
(./sphinxhighlight.sty)
(c:/texlive/2017/texmf-dist/tex/latex/oberdiek/kvoptions.sty
(c:/texlive/2017/texmf-dist/tex/generic/oberdiek/kvsetkeys.sty
(c:/texlive/2017/texmf-dist/tex/generic/oberdiek/infwarerr.sty)
(c:/texlive/2017/texmf-dist/tex/generic/oberdiek/etexcmds.sty
(c:/texlive/2017/texmf-dist/tex/generic/oberdiek/ifluatex.sty)))))
(c:/texlive/2017/texmf-dist/tex/latex/geometry/geometry.sty
(c:/texlive/2017/texmf-dist/tex/generic/oberdiek/ifpdf.sty)
(c:/texlive/2017/texmf-dist/tex/generic/oberdiek/ifvtex.sty)
(c:/texlive/2017/texmf-dist/tex/generic/ifxetex/ifxetex.sty))
(c:/texlive/2017/texmf-dist/tex/latex/hyperref/hyperref.sty
(c:/texlive/2017/texmf-dist/tex/generic/oberdiek/hobsub-hyperref.sty
(c:/texlive/2017/texmf-dist/tex/generic/oberdiek/hobsub-generic.sty))
(c:/texlive/2017/texmf-dist/tex/latex/oberdiek/auxhook.sty)
(c:/texlive/2017/texmf-dist/tex/latex/hyperref/pd1enc.def)
(c:/texlive/2017/texmf-dist/tex/latex/latexconfig/hyperref.cfg)
(c:/texlive/2017/texmf-dist/tex/latex/hyperref/puenc.def)
(c:/texlive/2017/texmf-dist/tex/latex/url/url.sty))

Package hyperref Message: Driver (autodetected): hxetex.

(c:/texlive/2017/texmf-dist/tex/latex/hyperref/hxetex.def
(c:/texlive/2017/texmf-dist/tex/generic/oberdiek/stringenc.sty)
(c:/texlive/2017/texmf-dist/tex/latex/oberdiek/rerunfilecheck.sty))
(c:/texlive/2017/texmf-dist/tex/latex/oberdiek/hypcap.sty)
(./sphinxmessages.sty) (c:/texlive/2017/texmf-dist/tex/latex/ctex/ctex.sty
(c:/texlive/2017/texmf-dist/tex/latex/l3kernel/expl3.sty
(c:/texlive/2017/texmf-dist/tex/latex/l3kernel/expl3-code.tex)
(c:/texlive/2017/texmf-dist/tex/latex/l3kernel/l3xdvipdfmx.def))
(c:/texlive/2017/texmf-dist/tex/latex/l3packages/xparse/xparse.sty)
(c:/texlive/2017/texmf-dist/tex/latex/l3packages/l3keys2e/l3keys2e.sty)
(c:/texlive/2017/texmf-dist/tex/latex/ctex/ctexhook.sty)
(c:/texlive/2017/texmf-dist/tex/latex/ctex/ctexpatch.sty)
(c:/texlive/2017/texmf-dist/tex/latex/base/fix-cm.sty
(c:/texlive/2017/texmf-dist/tex/latex/base/ts1enc.def))
(c:/texlive/2017/texmf-dist/tex/latex/ms/everysel.sty)
(c:/texlive/2017/texmf-dist/tex/latex/ctex/config/ctexopts.cfg)
(c:/texlive/2017/texmf-dist/tex/latex/ctex/engine/ctex-engine-xetex.def
(c:/texlive/2017/texmf-dist/tex/xelatex/xecjk/xeCJK.sty
(c:/texlive/2017/texmf-dist/tex/latex/l3packages/xtemplate/xtemplate.sty)
(c:/texlive/2017/texmf-dist/tex/latex/fontspec/fontspec.sty
(c:/texlive/2017/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty
(c:/texlive/2017/texmf-dist/tex/latex/base/fontenc.sty
(c:/texlive/2017/texmf-dist/tex/latex/base/tuenc.def))
(c:/texlive/2017/texmf-dist/tex/latex/fontspec/fontspec.cfg)))
(c:/texlive/2017/texmf-dist/tex/xelatex/xecjk/xunicode-addon.sty
(c:/texlive/2017/texmf-dist/tex/xelatex/xunicode/xunicode.sty
(c:/texlive/2017/texmf-dist/tex/latex/tipa/t3enc.def)))
(c:/texlive/2017/texmf-dist/tex/xelatex/xunicode/xunicode.sty
*** Reloading Xunicode for encoding 'TU' ***
) (c:/texlive/2017/texmf-dist/tex/xelatex/xecjk/xunicode-extra.def)
(c:/texlive/2017/texmf-dist/tex/xelatex/xecjk/xeCJK.cfg))
(c:/texlive/2017/texmf-dist/tex/xelatex/xecjk/xeCJKfntef.sty
(c:/texlive/2017/texmf-dist/tex/generic/ulem/ulem.sty)
(c:/texlive/2017/texmf-dist/tex/latex/environ/environ.sty
(c:/texlive/2017/texmf-dist/tex/latex/trimspaces/trimspaces.sty))
(c:/texlive/2017/texmf-dist/tex/latex/cjk/texinput/CJKfntef.sty)))
(c:/texlive/2017/texmf-dist/tex/latex/zhnumber/zhnumber.sty
(c:/texlive/2017/texmf-dist/tex/latex/zhnumber/zhnumber-utf8.cfg))
(c:/texlive/2017/texmf-dist/tex/latex/ctex/scheme/ctex-scheme-chinese.def
(c:/texlive/2017/texmf-dist/tex/latex/ctex/config/ctex-name-utf8.cfg))
(c:/texlive/2017/texmf-dist/tex/latex/tools/indentfirst.sty)
(c:/texlive/2017/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-windows.def
(c:/texlive/2017/texmf-dist/tex/latex/ctex/fontset/ctex-fontset-windowsnew.def)
)) (c:/texlive/2017/texmf-dist/tex/latex/ctex/config/ctex.cfg)
Writing index file Makefile.idx
(./Makefile.aux) (c:/texlive/2017/texmf-dist/tex/latex/tipa/t3cmr.fd)
geometry driver: auto-detecting
geometry detected driver: xetex
(c:/texlive/2017/texmf-dist/tex/latex/hyperref/nameref.sty
(c:/texlive/2017/texmf-dist/tex/generic/oberdiek/gettitlestring.sty))

Package hyperref Warning: Rerun to get /PageLabels entry.

ABD: EverySelectfont initializing macros [1]
(c:/texlive/2017/texmf-dist/tex/latex/amsfonts/umsa.fd)
(c:/texlive/2017/texmf-dist/tex/latex/amsfonts/umsb.fd) [1] [2] [1] [2]
Chapter 1.
[1] [2]
Chapter 2.
[3] [4] [5] [6] [7] [8]
Underfull \hbox (badness 10000) in paragraph at lines 497--502
[]\TU/SimSun(0)/m/n/10 默 认 的 情 况 下,| \TU/lmtt/m/n/10 make \TU/SimSun(0)/m /n/10
命 令 会 在 当 前 目 录 下 按 顺 序 找 寻 文 件 名 为 |“\TU/lmtt/m/n/10 GNUmake file\TU/SimSun(0)
/m/n/10 ” 、|
[9] [10]
Chapter 3.

LaTeX Font Warning: Font shape TU/FangSong(0)/m/it' undefined (Font) using TU/FangSong(0)/m/n' instead on input line 629.

[11] [12] [13] [14] [15] [16]
Underfull \hbox (badness 10000) in paragraph at lines 954--959
[]\TU/SimSun(0)/m/n/10 这 样 描 述 这 三 个 东 西,| 可 能 还 是 没 有 说 清 楚 ,| 还 是 举 个 例 子 来
说 明 一 下 吧。| 如 果 我 们 的

Underfull \hbox (badness 8056) in paragraph at lines 954--959
\TU/lmtt/m/n/10 \TU/SimSun(0)/m/n/10 定 义 成 \TU/lmtt/m/n/10 %.
o \TU/SimSun(0)/m/n/10 ,| 意 思 是 我 们 的 \TU/lmtt/m/n/10 ; \TU/SimS un(0)/
m/n/10 集 合 中 都 是 以 \TU/lmtt/m/n/10 .o \TU/SimSun(0)/m/n/10 结 尾 的,| 而 如 果
[17] [18] [19] [20]
Chapter 4.
[21] [22] [23]
Underfull \hbox (badness 10000) in paragraph at lines 1295--1297
[]\TU/SimSun(0)/m/n/10 但 是 \TU/lmtt/m/n/10 make \TU/SimSun(0)/m/n/10 命 令 中 的 有
几 个 参 数 并 不 往 下 传 递,| 它 们 是 \TU/lmtt/m/n/10 -C , -f , -h, -o \TU/ SimSun(0)/m/n
/10 和 \TU/lmtt/m/n/10 -W |\TU/SimSun(0)/m/n/10 (有 关

Underfull \hbox (badness 10000) in paragraph at lines 1321--1323
[]\TU/SimSun(0)/m/n/10 当 你 使 用 \TU/lmtt/m/n/10 -C \TU/SimSun(0)/m/n/10 参 数 来 指
定 \TU/lmtt/m/n/10 make \TU/SimSun(0)/m/n/10 下 层 \TU/lmtt/m/n/10 Makefile \TU/ Si
mSun(0)/m/n/10 时,| \TU/lmtt/m/n/10 -w \TU/SimSun(0)/m/n/10 会 被 自 动 打 开 的。| 如 果
参 数 中 有 \TU/lmtt/m/n/10 -s
[24] [25] [26]
Chapter 5.
[27] [28] [29] [30] [31] [32] [33] [34] [35] [36]
Chapter 6.
[37] [38] [39] [40]
Chapter 7.
[41]
Underfull \hbox (badness 10000) in paragraph at lines 2112--2117
\TU/lmtt/m/n/10 ) \TU/SimSun(0)/m/n/10 相 当 于 \TU/lmtt/m/n/10 $(patsubst ,,$(var)) \TU/SimSun(0)/m/n/10 ,| 而 \TU/lmtt/m/n/10 $(var:
[42] [43] [44]
Underfull \hbox (badness 10000) in paragraph at lines 2377--2380
[]\TU/SimSun(0)/m/n/10 如 果 我 们 的 \TU/lmtt/m/n/10 $(VPATH) \TU/SimSun(0)/m/n /10
值 是 \TU/lmtt/m/n/10 src:../headers \TU/SimSun(0)/m/n/10 ,| 那 么 \TU/lmtt/m/ n/10
$(patsubst %,-I%,$(subst :, ,
[45] [46] [47] [48]
Underfull \hbox (badness 10000) in paragraph at lines 2640--2642
[]\TU/lmtt/m/n/10 $ \TU/SimSun(0)/m/n/10 字 符。|
[49] [50] [51] [52]
Chapter 8.

Underfull \hbox (badness 10000) in paragraph at lines 2766--2768
[]\TU/SimSun(0)/m/n/10 前 面 我 们 说 过,| \TU/lmtt/m/n/10 GNU make \TU/SimSun( 0)/m/n
/10 找 寻 默 认 的 \TU/lmtt/m/n/10 Makefile \TU/SimSun(0)/m/n/10 的 规 则 是 在 当 前 目 录 下
依 次 找 三 个 文 件
[53] [54]

LaTeX Font Warning: Font shape TU/lmtt/bx/it' in size <10> not available (Font) Font shape TU/lmtt/b/sl' tried instead on input line 2892.

[55] [56]
Underfull \hbox (badness 10000) in paragraph at lines 2991--2994
[]\TU/SimSun(0)/m/n/10 假 定 目 标 \TU/lmtt/m/n/10 ;
[57] [58]
Chapter 9.
[59]
Underfull \hbox (badness 10000) in paragraph at lines 3072--3078
\TU/lmtt/m/n/10 .f, .F, .r, .y, .l, .s, .S, .mod, .sym, .def, .h, .info, .dvi,
.tex, .texinfo, .texi,
[60] [61]
Underfull \hbox (badness 10000) in paragraph at lines 3190--3192
[]\TU/lmtt/m/n/10 .ln |\TU/SimSun(0)/m/n/10 (\TU/lmtt/m/n/10 lint \TU/SimSu
n(0)/m/n/10 生 成 的 文 件)| 的 依 赖 文 件 被 自 动 推 导 为 \TU/lmtt/m/n/10 n.c \TU/SimSun(0
)/m/n/10 ,| 其 生 成 命 令 是:| \TU/lmtt/m/n/10 $(LINT)
[62] [63] [64]
Underfull \hbox (badness 5832) in paragraph at lines 3406--3413
[]\TU/SimSun(0)/m/n/10 这 条 规 则 告 诉 \TU/lmtt/m/n/10 make \TU/SimSun(0)/m/n/ 10 把
所 有 的 \TU/lmtt/m/n/10 .y \TU/SimSun(0)/m/n/10 文 件 都 以 \TU/lmtt/m/n/10 bis on -d
.y \TU/SimSun(0)/m/n/10 执 行,| 然 后 生 成 \TU/lmtt/m/n/10 .tab.c \TU/S imSun(
0)/m/n/10 和
[65] [66] [67] [68] [69] [70]
Chapter 10.
[71] [72]
Chapter 11.
[73]
No file Makefile.ind.
[74] (./Makefile.aux)

LaTeX Font Warning: Some font shapes were not available, defaults substituted.

LaTeX Warning: Label(s) may have changed. Rerun to get cross-references right.

)
Output written on Makefile.pdf (79 pages).
Transcript written on Makefile.log.
Latexmk: Index file 'Makefile.idx' was written
Latexmk: References changed.
===========Latexmk: Missing input file: 'Makefile.ind' from line
'No file Makefile.ind.'
Latexmk: Missing input file: 'Makefile.ind' from line
'No file Makefile.ind.'
Latexmk: References changed.
Latexmk: Log file says output to 'Makefile.pdf'
Collected error summary (may duplicate other messages):
pdflatex: Command for 'pdflatex' gave return code 1
Refer to 'Makefile.log' for details
Latexmk: Use the -f option to force complete processing,
unless error was exceeding maximum runs of latex/pdflatex.
=== TeX engine is 'XeTeX'
Latexmk: Errors, so I did not complete making targets
C:\texlive\2017\bin\win32\runscript.tlu:708: command failed with exit code 12:
perl.exe c:\texlive\2017\texmf-dist\scripts\latexmk\latexmk.pl -pdf -dvi- -ps- Makefile.tex
wl (master) how-to-write-makefile
$

fix: 「隐含规则」- 「定义模式规则」 - 「自动化变量」一节关于 $* 的举例有个小错误

「隐含规则」- 「定义模式规则」 - 「自动化变量」一节关于 $* 的举例有以下描述:

如果目标是 dir/a.foo.b ,并且目标的模式是 a.%.b ,那么, $* 的值就是 dir/a.foo 。

经过我的实测,这个例子中 $* 的取值应该为 dir/foo。我实测时的 Makefile 如下:

all: dir/a.foo.b

.PHONY: a.%.b
a.%.b:
	@echo $*

在我的 Ubuntu 20.04 下执行"make",打印结果为:dir/foo

隐含规则->定义模式规则->模式规则介绍 第二段有误

“如果 % 定义在目标中,那么,目标中的 % 的值决定了依赖目标中的 % 的值,也就是说,目标中的模式的 % 决定了依赖目标中 % 的样子。”
这一段应该写反了,应该是
“如果 % 定义在目标中,那么,依赖中的 % 的值决定了目标中的 % 的值,也就是说,依赖中的模式的 % 决定了目标中 % 的样子。”

期待后续的改进

如题,很多地方语句不通顺。语法错误太多以至于影响阅读效率,好多地方要反复读几遍才能搞清楚作者想表达什么。
在隐含规则搜索算法那一篇貌似与标准文档有出入。
不过还是要感谢作者,起码一个精简版的中文手册不用花很多时间也可以快速入门。

4.3节文字错误

原文4.3节最后一段

还有一个要提一下的make 的参数的是-k 或是--keep-going ,这个参数的意思是,如果某规则
中的命令出错了,那么就终目该规则的执行,但继续执行其它规则。

应该为终止

在阅读一个项目的makefile时遇到的问题

作者你好,我最近在看一个项目的makefile,有一些不明白的,希望借此平台请教一下你。
$(MAKE) $(MFLAGS) "OBJ = $(OBJ)" "INC = $(INC)" "EXE = ../$(EXE)" ../$(EXE)

这是一个makefile的命令部分,引号""部分是传递参数,我想请问以下引号后面的../$(EXE)是什么意思

等一个现成的pdf

请问楼主为什么不放一个pdf呢?折腾半天还是没弄出来。心累

每行80字符的显示问题

有断行的话,在 HTML 中上下两行拼接时浏览器会自动添加一个空格,对于英文没有问题,但是对于中文来说,太多的空格会影响视觉效果(个人感觉,或许别人不介意?)。

关于续行特性,在 CSS Text Module Level 3 草案中已经有规范,软断行(soft linebreak)处并合时应视前后字符所属语系而酌情添加空格,较新版本的 Firefox 已经实现了这一特性,而 Chrome 依然不支持。

在 RST 中,可以在行结尾处使用 \ 来表示续行,这样行合并时就不会出现空格,但是这给编辑带来了很大的不便。我基本不写中文的 RST 文档,如果写的话,也不会强制断行。

addprefix的功能解释存在错误

正确解释应该是:
$(addprefix ,<names...>)

  • 名称:加前缀函数——addprefix。
  • 功能:把前缀 加到 中的每个单词**前面**。
  • 返回:返回加过前缀的文件名序列。
  • 示例:$(addprefix src/,foo bar) 返回值是 src/foo src/bar 。

AxmlParser.c:121 in GetInt32 方法存在一个OOB-READ缺陷

我的测试单元为:
#include "AxmlParser.h"
#include "AxmlModify.h"
#include "options.h"

/Global vars. Used for AxmlModify/
uint32_t g_styleDataOff = 0x0;
uint32_t g_appTag_nameOff = 0x0;
uint32_t g_curStringCount = 0x0;
uint32_t g_appURIindex = 0x0;
uint32_t g_res_ChunkSizeOffset = 0x0;

int mian()
{
struct options_t *g_opts;
FILE *fp;
char *inbuf;
size_t insize;
char *outbuf;
size_t outsize;
int ret;
const char *target_filename;
target_filename = "fuzzing-7300437709702113099";
fp = fopen(target_filename, "rb");
if (fp == NULL)
{
fprintf(stderr, "Error: open input file failed.\n");
}

fseek(fp, 0, SEEK_END);
insize = ftell(fp);
fseek(fp, 0, SEEK_SET);

inbuf = (char *)malloc(insize * sizeof(char));
if (inbuf == NULL)
{
    fprintf(stderr, "Error: init file buffer.\n");
    fclose(fp);
}
else
{
    ret = fread(inbuf, 1, insize, fp);
    if (ret != insize)
    {
        fprintf(stderr, "Error: read file.\n");
        free(inbuf);
        fclose(fp);
    }
    else
    {
        ret = AxmlToXml(&outbuf, &outsize, inbuf, insize);
        if (ret < 0)
        {
            fprintf(stderr, "Error: parse file.\n");
        }
        else
        {
            if (g_opts->parserXml)
            {
                printf("%s", outbuf);
                return 0;
            }
            if (g_opts->modifyXml)
            {
                ret = axmlModify(inbuf, insize, g_opts->output_file);
                if (ret < 0)
                {
                    fprintf(stderr, "Error: modify file.\n");
                }
            }
            free(outbuf);
            free(inbuf);
            fclose(fp);

            return ret;
        }
    }
    // 无论是读取还是修改xml都需要先分析目标xml
}

}

其中fuzzing-7300437709702113099文件输入为
Len is = | 3
Hexvalue = | "\x23\x40\x5c"
Stringvalue = | "#@"

缺陷日志为:

==539977==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x6020000036f2 at pc 0x55c9152cf856 bp 0x7ffe86306720 sp 0x7ffe86306710
READ of size 1 at 0x6020000036f2 thread T0
#0 0x55c9152cf855 in GetInt32 /home/tj/digcve/ManifestAmbiguity/AxmlParser.c:121
#1 0x55c9152cfb39 in ParseHeadChunk /home/tj/digcve/ManifestAmbiguity/AxmlParser.c:153
#2 0x55c9152d0c6e in AxmlOpen /home/tj/digcve/ManifestAmbiguity/AxmlParser.c:328
#3 0x55c9152d46fe in AxmlToXml /home/tj/digcve/ManifestAmbiguity/AxmlParser.c:907
#4 0x55c9152ce6b3 in easyloop /home/tj/digcve/ManifestAmbiguity/test2.c:50

0x6020000036f2 is located 0 bytes to the right of 2-byte region [0x6020000036f0,0x6020000036f2)
allocated by thread T0 here:

SUMMARY: AddressSanitizer: heap-buffer-overflow /home/tj/digcve/ManifestAmbiguity/AxmlParser.c:121 in GetInt32
Shadow bytes around the buggy address:
0x0c047fff8680: fa fa fd fd fa fa 00 03 fa fa fd fd fa fa 00 04
0x0c047fff8690: fa fa fd fd fa fa 00 04 fa fa fd fd fa fa 00 06
0x0c047fff86a0: fa fa fd fd fa fa 00 04 fa fa fd fd fa fa 00 04
0x0c047fff86b0: fa fa fd fd fa fa 00 04 fa fa fd fd fa fa 00 04
0x0c047fff86c0: fa fa fd fd fa fa 00 04 fa fa fd fd fa fa 00 04
=>0x0c047fff86d0: fa fa fd fd fa fa 00 04 fa fa 02 fa fa fa[02]fa
0x0c047fff86e0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c047fff86f0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c047fff8700: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c047fff8710: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c047fff8720: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
Addressable: 00
Partially addressable: 01 02 03 04 05 06 07
Heap left redzone: fa
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack after return: f5
Stack use after scope: f8
Global redzone: f9
Global init order: f6
Poisoned by user: f7
Container overflow: fc
Array cookie: ac
Intra object redzone: bb
ASan internal: fe
Left alloca redzone: ca
Right alloca redzone: cb
Shadow gap: cc

关于此文的版权问题

我在读此文时发现其与官方GNU Make Manual的内容高度一致。对比后发现其就是对原文的翻译加少量解释,参考 http://blog.csdn.net/haoel/article/details/2886 94楼。
翻译很辛苦,也感谢作者的劳动,但是版权是另一回事,作者没有任何地方注明这是对原文的翻译。虽然你不是作者,但是希望你可以在Readme中加以说明,让后来者了解情况。

英文原文:https://www.gnu.org/software/make/manual/
中文翻译整理[徐海兵]:http://hacker-yhj.github.io/resources/gun_make.pdf

书写错误

在这个自动化变量章节中,有一句这个变量对于构造有关联的文件名是比较有较最后的有较可能是有用

几个错误的地方

3.8 自动生成依赖性
这里,我们给出了一个模式规则来产生 .d 文件:
%.d: %.c @set -e; rm -f $@; \ $(CC) -M $(CPPFLAGS) $< >; $@.$$$$; \ sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ >; $@; \ rm -f $@.$$$$
这里的$(CC) -M $(CPPFLAGS) $< >; $@.$$$$; \多了个分号,应该是$(CC) -M $(CPPFLAGS) $< > $@.$$$$; \

3.4 文件搜寻
如果定义了这个变量,那么,make 就会在当当前目录找不到的情况下,到所指定的目录中去找寻文件了。
这里就会在当当前目录中多个了

上面的的定义指定两个目录,“src”和“../headers”,make 会按照这个顺序进行搜索。目录由“冒号”分隔。(当然,当前目录永远是最高优先搜索的地方)
这里上面的的定义中多了个

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.