summaryrefslogtreecommitdiffstats
path: root/sphinx/templates/texinfo/Makefile
blob: e3b732cda78a79650901b3afc52a5a88359d6fe8 (plain)
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# Makefile for Sphinx Texinfo output

infodir ?= /usr/share/info

MAKEINFO = makeinfo --no-split
MAKEINFO_html = makeinfo --no-split --html
MAKEINFO_plaintext = makeinfo --no-split --plaintext
TEXI2PDF = texi2pdf --batch --expand
INSTALL_INFO = install-info

ALLDOCS = $(basename $(wildcard *.texi))

all: info
info: $(addsuffix .info,$(ALLDOCS))
plaintext: $(addsuffix .txt,$(ALLDOCS))
html: $(addsuffix .html,$(ALLDOCS))
pdf: $(addsuffix .pdf,$(ALLDOCS))

install-info: info
	for f in *.info; do \
	  mkdir -p $(infodir) && \
	  cp "$$f" $(infodir) && \
	  $(INSTALL_INFO) --info-dir=$(infodir) "$$f" && \
	  \
	  FIGURE_DIR="`basename \"$$f\" .info`-figures" && \
	  if [ -e "$$FIGURE_DIR" ]; then \
	    cp -r "$$FIGURE_DIR" $(infodir) ; \
	  fi; \
	done

uninstall-info: info
	for f in *.info; do \
	  rm -f "$(infodir)/$$f"  ; \
	  rm -rf "$(infodir)/`basename '$$f' .info`-figures" && \
	  $(INSTALL_INFO) --delete --info-dir=$(infodir) "$$f" ; \
	done

%.info: %.texi
	$(MAKEINFO) -o '$@' '$<'

%.txt: %.texi
	$(MAKEINFO_plaintext) -o '$@' '$<'

%.html: %.texi
	$(MAKEINFO_html) -o '$@' '$<'

%.pdf: %.texi
	-$(TEXI2PDF) '$<'
	-$(TEXI2PDF) '$<'
	-$(TEXI2PDF) '$<'

clean:
	rm -f *.info *.pdf *.txt *.html
	rm -f *.log *.ind *.aux *.toc *.syn *.idx *.out *.ilg *.pla *.ky *.pg
	rm -f *.vr *.tp *.fn *.fns *.def *.defs *.cp *.cps *.ge *.ges *.mo

.PHONY: all info plaintext html pdf install-info uninstall-info clean