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 AAFIGFLAGS := --proportional
19 PDFLATEXFLAGS := -halt-on-error -file-line-error
21 PLOTS := stw pause time mem
22 PROGS := bigarr conalloc concpu mcore rnddata sbtree split \
23 bh bisort em3d tsp voronoi dil
26 TEMPLITE := ./templite.py
34 imgs := $O/img/mark-sweep-0.pdf \
35 $(patsubst %.dot,$O/%.pdf,$(wildcard img/mark-sweep-*.dot)) \
37 $(patsubst %,$O/img/norm-hist-%.pdf,$(PLOTS))
39 # Verbosity flag (empty show nice messages, non-empty use make messages)
40 # When used internal, $V expand to @ is nice messages should be printed, this
41 # way it's easy to add $V in front of commands that should be silenced when
42 # displaying the nice messages.
43 override V := $(if $V,,@)
45 override V := $(if $(findstring s,$(MAKEFLAGS)),,$V)
48 all: presentacion.pdf notas.pdf
50 presentacion.pdf: $O/presentacion.tex $(imgs)
51 $(if $V,@echo "$(PDFLATEX) $< > $@")
52 $V cd $O && $(PDFLATEX) $(PDFLATEXFLAGS) $(<F) > $@.log
53 $V cd $O && $(PDFLATEX) $(PDFLATEXFLAGS) $(<F) >> $@.log
56 notas.pdf: $O/notas.tex
57 $(if $V,@echo "$(PDFLATEX) $< > $@")
58 $V cd $O && $(PDFLATEX) $(PDFLATEXFLAGS) $(<F) > $@.log
59 $V cd $O && $(PDFLATEX) $(PDFLATEXFLAGS) $(<F) >> $@.log
62 $O/presentacion.tex: presentacion.rst $(R2B)
63 $(if $V,@echo "$(R2B) $< > $@")
64 $V $(R2B) $(R2BFLAGS) $< | $(R2BFILTER) > $@
66 $O/notas.tex: presentacion.rst $(R2B)
67 $(if $V,@echo "$(R2B) $< > $@")
68 $V $(R2B) $(R2BFLAGS) --shownotes=only $< | $(R2BFILTER) > $@
70 $O/img/%.pdf: img/%.dot
71 $(DOT) $(DOTFLAGS) -Tpdf -o $@ $<
73 $O/img/%.pdf: img/%.aafig
74 $(AAFIG) $(AAFIGFLAGS) -t pdf -o $@ $<
76 $O/img/norm-hist-%.csv: img/raw-hist-%.csv
77 $(if $V,@echo "norm $< > $@")
78 $V $(AWK) -F, -v m=`cut -d, -f4 $< | $(STATS) '$$1' '%(max)s'` \
79 '{print $$1 "," $$2/m "," $$3/m "," $$4/m "," $$5/m}' \
82 $O/img/norm-hist-%.eps: $(patsubst %,$O/img/norm-hist-\%-%.csv,$(PROGS))
83 $(if $V,@echo "plot $< > $@")
84 $V $(TEMPLITE) "progs=($(patsubst %,'%'$(comma),$(PROGS))), " \
85 "files=($(patsubst %,'%'$(comma),$^))" \
86 < histogram-plot.tpl.gpi | $(GNUPLOT) > $@
88 $O/img/norm-hist-%.pdf: $O/img/norm-hist-%.eps
89 $(EPSTOPDF) --outfile=$@ $<
91 $O/img/%.pdf: img/%.pdf
94 $O/heap.pdf: AAFIGFLAGS += -s 1.4 -a 0.8
102 $(RM) presentacion.pdf
104 __dummy := $(shell mkdir -p $O/img)