makefile.mk 1.93 KB
Newer Older
Stefan Tauner's avatar
Stefan Tauner committed
1
2
3
4
5
6
7
8
9
10
11
12
13
TEX_MAIN ?= $(JOB)
# trailing / is important below
OUTDIR := ./
#shell escape needed for epstopdf, svg2pdf etc.
# TEX := pdflatex -shell-escape -output-directory $(OUTDIR) -jobname $(JOB)
TEX := pdflatex -shell-escape -jobname $(JOB)
BIB := bibtex
IDX := makeindex
ACR := makeglossaries
VIEW := "gnome-open"
TEX_OUT := $(OUTDIR)$(JOB).pdf


14
15
all: $(TEX_OUT)
# all: view
Stefan Tauner's avatar
Stefan Tauner committed
16
17

fast:
18
	@$(TEX) $(TEX_MAIN).tex
19
	@"$(VIEW)" "$(TEX_OUT)"
20

Stefan Tauner's avatar
Stefan Tauner committed
21
view: $(TEX_OUT)
22
	@"$(VIEW)" "$(TEX_OUT)"
Stefan Tauner's avatar
Stefan Tauner committed
23
24
	
clean:
25
	@rm -f $(TEX_OUT) $(OUTDIR)*.aux $(OUTDIR)*.bcf $(OUTDIR)*.bbl $(OUTDIR)*-blx.bib $(OUTDIR)*.run.xml $(OUTDIR)*.idx $(OUTDIR)*.ilg $(OUTDIR)*.lot $(OUTDIR)*.lof $(OUTDIR)*.lol $(OUTDIR)*.blg $(OUTDIR)*.alg $(OUTDIR)*.ind $(OUTDIR)*.toc $(OUTDIR)*.acl $(OUTDIR)*.acn $(OUTDIR)*.acr $(OUTDIR)*.out $(OUTDIR)*.log $(OUTDIR)*.gls $(OUTDIR)*.glo $(OUTDIR)*.glg $(OUTDIR)*.ist $(OUTDIR)*.brf $(OUTDIR)*.ver $(OUTDIR)*.hst $(OUTDIR)*.glsdefs
Stefan Tauner's avatar
Stefan Tauner committed
26

27
PREREQS := $(wildcard *.tex *.bib content/*.tex img/*.tex img/*.pdf img/*.png ../tex_common/*.tex ../tex_common/img/*.tex)
28

29
30
31
32
33
$(TEX_MAIN).aux: $(PREREQS)
	@rm -f "$(TEX_OUT)"
	$(TEX) -draftmode $(TEX_MAIN).tex

$(TEX_OUT): $(TEX_MAIN).aux $(PREREQS)
Stefan Tauner's avatar
Stefan Tauner committed
34
35
36
37
38
39
40
41
# only run bibtex if there exist bib files
ifneq (,$(filter %.bib,$(PREREQS)))
	$(BIB) $(OUTDIR)$(JOB)
endif
	$(ACR) $(JOB)
	$(TEX) $(TEX_MAIN)
	$(TEX) $(TEX_MAIN)

42
43
# No prerequisites because we want to trigger this rule manually only
content/protocol_host_to_fic.tex:
Stefan Tauner's avatar
Stefan Tauner committed
44
45
	bin/generate_host_to_fic_protocol.sh > $@

46
47
48
49
50
51
52
53
54
55
# The following rule converts Doxygen-generated .dot files into tikz-based figures
# Currently used files:
#  - content/FIJISettingsViewer_8pm__incl.dot.tex
#  - content/Downloader_8pm__incl.dot.tex
# No prerequisites because we want to trigger this rule manually only
content/%.dot.tex:
	$(info Preparing file $*.dot for tex)
	@bin/remove_undocumented_from_dot.sh ../doxygen/html/$*.dot
	@dot2tex -c --figonly ../doxygen/html/$*-converted.dot -o content/$*.dot.tex

Stefan Tauner's avatar
Stefan Tauner committed
56
.PHONY = clean view all fast