📄 makefile
字号:
# Makefile for generating docs in a variety of formats# based upon DJGPP FAQ's makefile (by Eli Zaretskii)# Although I've shuffled things around quite a lot, the# basic effect is the same. I split it into lots of small # rules, because then the intermediate files are treated# as such. I also made it easier to adapt for your own# Texinfo files.# Set STEM to the stem of your filename, and set TLA to a# three letter acronym. Don't use something silly like# `txt' or `sed'!include makefile.cfg# If your main Texinfo file includes others, tag them on# the end of SOURCES. Note: I haven't tested this.SOURCES = $(STEM).txi# Supported formats: .info, .txt, .html, .dvi, .psFORMATS = .info .txt .html # .dvi .ps# Compilation setup for helper programsCC = gccCFLAGS = -Wall -O2LDFLAGS = -s# No need to touch anything below this point, unless either# something doesn't work or you just want to fiddle around.all: $(addprefix $(STEM), $(FORMATS))ifdef COMSPEC CP = copy /y RM = delelse CP = cp -f RM = rm -fendif.PRECIOUS: numbered.% contents.% chapters.% textprep.% textpost.% \ textint1.% textint2.% text.% htmltemp.% html.%# We want to use the TLA where possible, so copy the # main source filetxi.$(TLA): $(STEM).txi $(CP) $< $@######## # # # # # # # # # # # # generic# Generic thingsnumbered.$(TLA): txi.$(TLA) enum ./enum $< $@######## # # # # # # # # # # # # .info# For the Info target# How to make the STEM files from the target TLA files$(STEM).inf: $(TLA).inf $(CP) $< $@$(STEM).info: $(TLA).info $(CP) $< $@# How to make the target TLA files$(TLA).inf: $(TLA).info$(TLA).info: numbered.$(TLA) $(SOURCES) makeinfo --no-split --fill-column 64 -o $@ $<######## # # # # # # # # # # # # .html# For the HTML target# How to make the STEM files from the target TLA files$(STEM).html: $(TLA).html $(CP) $< $@# How to make the target TLA files$(TLA).html: numbered.$(TLA) $(SOURCES) makeinfo --no-split --fill-column 64 --html -o $@ $<######## # # # # # # # # # # # # .txt# For the plain text target# How to make the STEM file from the target TLA file$(STEM).txt: text.$(TLA) $(CP) $< $@# Generic rules for making text outputcontents.$(TLA): numbered.$(TLA) contents.sed sed -n -f contents.sed $< > $@chapters.$(TLA): numbered.$(TLA) chapters.sed sed -n -f chapters.sed $< > $@textprep.$(TLA): chapters.$(TLA) chapxref.sed sed -f chapxref.sed $< > $@textpost.$(TLA): chapters.$(TLA) idxref.sed sed -f idxref.sed $< > $@textint1.$(TLA): numbered.$(TLA) textprep.$(TLA) @echo 'The following command may take a long time. Be patient.' sed -f textprep.$(TLA) $< > $@textint2.$(TLA): textint1.$(TLA) contents.$(TLA) $(SOURCES) $(CP) contents.$(TLA) contents.idx makeinfo --no-split --no-headers --no-validate --fill-column 64 -Dtext -o $@ $< $(RM) contents.idxtext.$(TLA): textint2.$(TLA) textpost.$(TLA) sed -f textpost.$(TLA) $< > $@######## # # # # # # # # # # # # .dvi# For DVI output$(STEM).dvi: $(STEM).txi texi2dvi $<######## # # # # # # # # # # # # .ps# For Postscript output$(STEM).ps: $(STEM).dvi dvips $< -o $@######## # # # # # # # # # # # # minibook# For output as a little booklet## Print `...41.ps' first, then print `...23.ps' on the backs.minibook: $(STEM).ps mpage -O -o -M -m -A $< > $(STEM)41.ps mpage -E -o -M -m -A $< > $(STEM)23.psclean:ifdef COMSPEC command > nul /c for %f in (contents.idx *.$(TLA) enum enum.exe) do if exist %f del %f command > nul /c for %f in ($(addprefix $(STEM), .aux .log .toc .cp .fn .ky) do if exist %f del %f command > nul /c for %f in ($(addprefix $(STEM), .pg .tp .vr .cps .fns .vrs) do if exist %f del %felse rm -f contents.idx *.$(TLA) enum enum.exe $(addprefix $(STEM), .aux .log .toc .cp .fn .ky .pg .tp .vr .cps .fns .vrs)endifdistclean: cleanveryclean: distcleanifdef COMSPEC command > nul /c for %f in (*.htm *.html *.inf *.ps *.dvi *.txt) do if exist %f del %felse rm -f *.htm* *.inf* *.ps *.dvi *.txtendifdist: all distcleanlove: @echo 'Not war!'coffee: @echo 'Not yet. Maybe in v3.x...'
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -