-
Notifications
You must be signed in to change notification settings - Fork 3
/
makefile
51 lines (41 loc) · 1.19 KB
/
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
41
42
43
44
45
46
47
48
49
50
TARGET_FILES = report.pdf
SOURCE_FILES = $(wildcard **/*.latex) 7-Appendices/code/*.java
FIGURES = $(wildcard figures/*)
.DEFAULT: all
.SUFFIXES:
.PHONY: all no-logs clean log-clean
.INTERMEDIATE: %.aux %.bbl %.dvi %.ptmp %.toc %.out
.PRECIOUS: %.log %.blg
all : $(TARGET_FILES)
no-logs : all log-clean
%.pdf : %.dvi
echo "========== $@ ==========="
dvipdf $< > $@
rm -f $(subst .dvi,.aux,$<)
%.dvi : %.latex %.toc %.bbl
echo "========== $@ ==========="
latex $<
latex $<
%.toc : %.latex %.ptmp
echo "========== $@ ==========="
latex $<
%.ptmp : %.latex $(SOURCE_FILES) $(FIGURES)
echo "========== $@ ==========="
latex $<
touch $@
%.blg %.bbl : %.ptmp $(wildcard *.bib)
echo "========== $@ ==========="
bibtex $(subst .ptmp,.aux,$<)
clean : log-clean
echo "========== $@ ==========="
rm -f $(TARGET_FILES)
rm -f $(subst .pdf,.aux, $(TARGET_FILES))
rm -f $(subst .pdf,.dvi, $(TARGET_FILES))
rm -f $(subst .pdf,.toc, $(TARGET_FILES))
rm -f $(subst .pdf,.bbl, $(TARGET_FILES))
rm -f $(subst .pdf,.ptmp,$(TARGET_FILES))
log-clean :
echo "========== $@ ==========="
rm -f $(subst .pdf,.blg,$(TARGET_FILES))
rm -f $(subst .pdf,.log,$(TARGET_FILES))
rm -f $(subst .dvi,.aux,$(TARGET_FILES))