6 R2BFLAGS := --halt=2 --lang es --codeblocks-use-pygments \
7 --input-encoding=utf-8 --output-encoding=utf-8 \
10 R2BFILTER := sed '/\\usepackage\[scaled=\.90\]{helvet}/d'
16 PDFLATEXFLAGS := -halt-on-error -file-line-error
18 PLOTS := stw pause time mem
19 PROGS := bigarr conalloc concpu mcore rnddata sbtree split \
20 bh bisort em3d tsp voronoi dil
23 TEMPLITE := ./templite.py
31 imgs := $O/img/mark-sweep-0.pdf \
32 $(patsubst %.dot,$O/%.pdf,$(wildcard img/mark-sweep-*.dot)) \
33 $(patsubst %,$O/img/norm-hist-%.pdf,$(PLOTS))
35 # Verbosity flag (empty show nice messages, non-empty use make messages)
36 # When used internal, $V expand to @ is nice messages should be printed, this
37 # way it's easy to add $V in front of commands that should be silenced when
38 # displaying the nice messages.
39 override V := $(if $V,,@)
41 override V := $(if $(findstring s,$(MAKEFLAGS)),,$V)
43 targets := presentacion.pdf notas.pdf
48 presentacion.pdf: $O/presentacion.tex $(imgs)
49 $(if $V,@echo "$(PDFLATEX) $< > $@")
50 $V cd $O && $(PDFLATEX) $(PDFLATEXFLAGS) $(<F) $(if $V,> $@.log)
51 $V cd $O && $(PDFLATEX) $(PDFLATEXFLAGS) $(<F) $(if $V,>> $@.log)
54 notas.pdf: $O/notas.tex
55 $(if $V,@echo "$(PDFLATEX) $< > $@")
56 $V cd $O && $(PDFLATEX) $(PDFLATEXFLAGS) $(<F) $(if $V,> $@.log)
57 $V cd $O && $(PDFLATEX) $(PDFLATEXFLAGS) $(<F) $(if $V,>> $@.log)
60 $O/presentacion.tex: presentacion.rst $(R2B)
61 $(if $V,@echo "$(R2B) $< > $@")
62 $V $(R2B) $(R2BFLAGS) $< | $(R2BFILTER) > $@
64 $O/notas.tex: presentacion.rst $(R2B)
65 $(if $V,@echo "$(R2B) $< > $@")
66 $V $(R2B) $(R2BFLAGS) --shownotes=only $< | $(R2BFILTER) > $@
68 $O/img/%.pdf: img/%.dot
69 $(DOT) $(DOTFLAGS) -Tpdf -o $@ $<
71 $O/img/norm-hist-%.csv: img/raw-hist-%.csv
72 $(if $V,@echo "norm $< > $@")
73 $V $(AWK) -F, -v m=`cut -d, -f4 $< | $(STATS) '$$1' '%(max)s'` \
74 '{print $$1 "," $$2/m "," $$3/m "," $$4/m "," $$5/m}' \
77 $O/img/norm-hist-%.eps: $(patsubst %,$O/img/norm-hist-\%-%.csv,$(PROGS))
78 $(if $V,@echo "plot $< > $@")
79 $V $(TEMPLITE) "progs=($(patsubst %,'%'$(comma),$(PROGS))), " \
80 "files=($(patsubst %,'%'$(comma),$^))" \
81 < histogram-plot.tpl.gpi | $(GNUPLOT) > $@
83 $O/img/norm-hist-%.pdf: $O/img/norm-hist-%.eps
84 $(EPSTOPDF) --outfile=$@ $<
86 $O/img/%.pdf: img/%.pdf
97 __dummy := $(shell mkdir -p $O/img)