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)
47 presentacion.pdf: $O/presentacion.tex $(imgs)
48 $(if $V,@echo "$(PDFLATEX) $< > $@")
49 $V cd $O && $(PDFLATEX) $(PDFLATEXFLAGS) $(<F) > $@.log
50 $V cd $O && $(PDFLATEX) $(PDFLATEXFLAGS) $(<F) >> $@.log
53 $O/presentacion.tex: presentacion.rst $(R2B)
54 $(if $V,@echo "$(R2B) $< > $@")
55 $V $(R2B) $(R2BFLAGS) $< | $(R2BFILTER) > $@
57 $O/img/%.pdf: img/%.dot
58 $(DOT) $(DOTFLAGS) -Tpdf -o $@ $<
60 $O/img/%.pdf: img/%.aafig
61 $(AAFIG) $(AAFIGFLAGS) -t pdf -o $@ $<
63 $O/img/norm-hist-%.csv: img/raw-hist-%.csv
64 $(if $V,@echo "norm $< > $@")
65 $V $(AWK) -F, -v m=`cut -d, -f4 $< | $(STATS) '$$1' '%(max)s'` \
66 '{print $$1 "," $$2/m "," $$3/m "," $$4/m "," $$5/m}' \
69 $O/img/norm-hist-%.eps: $(patsubst %,$O/img/norm-hist-\%-%.csv,$(PROGS))
70 $(if $V,@echo "plot $< > $@")
71 $V $(TEMPLITE) "progs=($(patsubst %,'%'$(comma),$(PROGS))), " \
72 "files=($(patsubst %,'%'$(comma),$^))" \
73 < histogram-plot.tpl.gpi | $(GNUPLOT) > $@
75 $O/img/norm-hist-%.pdf: $O/img/norm-hist-%.eps
76 $(EPSTOPDF) --outfile=$@ $<
78 $O/img/%.pdf: img/%.pdf
81 $O/heap.pdf: AAFIGFLAGS += -s 1.4 -a 0.8
89 $(RM) presentacion.pdf
91 __dummy := $(shell mkdir -p $O/img)