Makefile 1.08 KB
Newer Older
1
.PHONY: all loop clean
2 3 4

export TEXINPUTS=.:

5 6 7
DEPS = $(wildcard *.tex) $(wildcard *.bib) $(wildcard *.sty) $(wildcard *.mly)

SED := $(shell if hash gsed 2>/dev/null ; then echo gsed ; else echo sed ; fi)
8

9
all: main.pdf main.html
10

11
%.pdf: %.tex $(DEPS)
12 13 14
	pdflatex $*
	bibtex $*
	pdflatex $*
regisgia's avatar
regisgia committed
15
	pdflatex $*
16

17 18
main.html: main.tex $(DEPS) $(wildcard *.hva)
	hevea -fix main.tex
19 20 21 22 23 24 25
#
# Hevea interprets 'tabbing' environment in a way
# that creates spacing errors in the rendered output
# of "textual version of derivation trees": it
# asks for (padding:0px;) while the TeX rendering
# inserts spacing between columns. Change this
# to {padding:1px;}
26
	$(SED) -i -e "s/cellpadding0/cellpadding1/" main.html
27 28 29 30 31 32 33 34
#
# Hevea generates images main00{1,2,3}.png for the tikz pictures
# present in the manual. Rename them into manual-figure00{1,2,3}.png
# for consistency with the naming scheme of the deployed manual files.
	for f in 1 2 3; do \
	  mv main00$$f.png manual-figure00$$f.png; \
	done
	$(SED) --in-place 's/<img src="main/<img src="manual-figure/g' main.html
35

36 37 38
loop:
	latexmk -pdf -pvc main

39
clean:
40
	rm -f `cat .gitignore`