summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/ryethesis/Makefile
blob: e92c0130ca6295fdc7c3f67db7a5a4f32ec1d220 (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
FILEROOT=
SHELL=/bin/sh

VERSION=1.2

LATEX=pdflatex

TEXFILES=ryesample.tex
BIBFILES=ryesample.bib
FIGS=figure1.pdf
FILES=README ryethesis.ins ryethesis.dtx ryethesis.pdf ryesample.pdf Makefile

TEXMFFLAGS=-file-line-error -halt-on-error -interaction=batchmode

TARGETS=ryethesis.cls ryethesis.pdf ryesample.pdf ryethesis-$(VERSION).zip
all: $(TARGETS)

.PHONY: again.and.again

again.and.again:
	@if [ $(MAKELEVEL) = 4 ]; then \
	   echo "Too many nesting levels of make!"; exit 1; \
	fi
	@$(LATEX) $(TEXMFFLAGS) $(FILEROOT) || ( rm -f $(FILEROOT).pdf && exit 2) 
	@bibtex -terse $(FILEROOT) 
	@if [ -f $(FILEROOT).ist ]; then makeglossaries -q $(FILEROOT) ; fi
	@if [ -f $(FILEROOT).idx ]; then makeindex -q $(FILEROOT) ; fi
	@if [ -f $(FILEROOT).glo ]; then makeindex -q $(FILEROOT).nlo -s nomencl.ist -o $(FILEROOT).nls; fi
	@$(LATEX) $(TEXMFFLAGS) $(FILEROOT) || ( rm -f $(FILEROOT).pdf && exit 2) 
	@if `grep -q -e "There were undefined references" -e "There were multiply-defined labels" -e "Label(s) may have changed. Rerun to get cross-references right" $(FILEROOT).log`; \
	  then $(MAKE) FILEROOT=$(FILEROOT) again.and.again; \
	fi

clean:
	@rm -rf $(TARGETS) *.aux *.lof *.lot *.loa *.log *.bbl *.blg *.ind *.ilg *.toc *.idx *.gls *.glo *.out *~ *.nls *.nlo *.ist *.toa *.glg auto 

ryesample.pdf: Makefile ${TEXFILES} ${BIBFILES} ${FIGS}
	$(MAKE) FILEROOT=ryesample again.and.again

ryethesis.pdf: Makefile ryethesis.dtx
	$(LATEX) $(TEXMFFLAGS) ryethesis.dtx
	$(LATEX) $(TEXMFFLAGS) ryethesis.dtx

ryethesis.cls: Makefile ryethesis.ins
	$(LATEX) $(TEXMFFLAGS) ryethesis.ins

ryethesis-$(VERSION).zip: ${FILES} ${TEXFILES} ${BIBFILES} ${FIGS}
	zip $@ $^