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)
44 all: presentacion.pdf notas.pdf
46 presentacion.pdf: $O/presentacion.tex $(imgs)
47 $(if $V,@echo "$(PDFLATEX) $< > $@")
48 $V cd $O && $(PDFLATEX) $(PDFLATEXFLAGS) $(<F) $(if $V,> $@.log)
49 $V cd $O && $(PDFLATEX) $(PDFLATEXFLAGS) $(<F) $(if $V,>> $@.log)
52 notas.pdf: $O/notas.tex
53 $(if $V,@echo "$(PDFLATEX) $< > $@")
54 $V cd $O && $(PDFLATEX) $(PDFLATEXFLAGS) $(<F) $(if $V,> $@.log)
55 $V cd $O && $(PDFLATEX) $(PDFLATEXFLAGS) $(<F) $(if $V,>> $@.log)
58 $O/presentacion.tex: presentacion.rst $(R2B)
59 $(if $V,@echo "$(R2B) $< > $@")
60 $V $(R2B) $(R2BFLAGS) $< | $(R2BFILTER) > $@
62 $O/notas.tex: presentacion.rst $(R2B)
63 $(if $V,@echo "$(R2B) $< > $@")
64 $V $(R2B) $(R2BFLAGS) --shownotes=only $< | $(R2BFILTER) > $@
66 $O/img/%.pdf: img/%.dot
67 $(DOT) $(DOTFLAGS) -Tpdf -o $@ $<
69 $O/img/norm-hist-%.csv: img/raw-hist-%.csv
70 $(if $V,@echo "norm $< > $@")
71 $V $(AWK) -F, -v m=`cut -d, -f4 $< | $(STATS) '$$1' '%(max)s'` \
72 '{print $$1 "," $$2/m "," $$3/m "," $$4/m "," $$5/m}' \
75 $O/img/norm-hist-%.eps: $(patsubst %,$O/img/norm-hist-\%-%.csv,$(PROGS))
76 $(if $V,@echo "plot $< > $@")
77 $V $(TEMPLITE) "progs=($(patsubst %,'%'$(comma),$(PROGS))), " \
78 "files=($(patsubst %,'%'$(comma),$^))" \
79 < histogram-plot.tpl.gpi | $(GNUPLOT) > $@
81 $O/img/norm-hist-%.pdf: $O/img/norm-hist-%.eps
82 $(EPSTOPDF) --outfile=$@ $<
84 $O/img/%.pdf: img/%.pdf
93 $(RM) presentacion.pdf
95 __dummy := $(shell mkdir -p $O/img)