-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
40 lines (32 loc) · 980 Bytes
/
Makefile
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
# Makefile for urantia-es (Urantia Papers in Spanish)
MOD = urantia-es
WORKDIR = $(TMPDIR)/$(MOD)
# otherwise makeindex won't work with our choice of WORKDIR
export openout_any = a
LATEX = xelatex -output-directory=$(WORKDIR) -halt-on-error $(MOD) < /dev/null > /dev/null 2>&1
all:: $(MOD).pdf
.PHONY: clean
clean::
@rm -rf $(WORKDIR) select-book.tex missfont.log $(MOD).pdf
$(MOD).pdf: select-book.tex
@mkdir -p $(WORKDIR)
$(LATEX)
ifndef DRAFT
@if test -f $(WORKDIR)/$(MOD).idx; then makeindex -q $(WORKDIR)/$(MOD); fi
$(LATEX)
@if test -f $(WORKDIR)/$(MOD).idx; then makeindex -q $(WORKDIR)/$(MOD); fi
$(LATEX)
@if test -f $(WORKDIR)/$(MOD).idx; then makeindex -q $(WORKDIR)/$(MOD); fi
endif
@mv $(WORKDIR)/$(MOD).pdf .
select-book.tex:
ifdef LIST
$(shell export LINE="\includeonly{" ; \
for b in $(LIST) ; do \
LINE="$${LINE}tex/$${b}," ; \
done ; \
echo $${LINE}} | sed "s/,}/}/" > select-book.tex \
)
else
@> select-book.tex
endif