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; \
11 s/\\usepackage\[utf8\]{inputenc}/\\usepackage[utf8x]{inputenc}/'
17 PDFLATEXFLAGS := -halt-on-error -file-line-error
19 PLOTS := stw pause time mem
20 PROGS := bigarr conalloc concpu mcore rnddata sbtree split \
21 bh bisort em3d tsp voronoi dil
24 TEMPLITE := ./templite.py
32 imgs := $O/img/mark-sweep-0.pdf \
33 $(patsubst %.dot,$O/%.pdf,$(wildcard img/mark-sweep-*.dot)) \
34 $(patsubst %,$O/img/norm-hist-%.pdf,$(PLOTS))
36 # Verbosity flag (empty show nice messages, non-empty use make messages)
37 # When used internal, $V expand to @ is nice messages should be printed, this
38 # way it's easy to add $V in front of commands that should be silenced when
39 # displaying the nice messages.
40 override V := $(if $V,,@)
42 override V := $(if $(findstring s,$(MAKEFLAGS)),,$V)
44 targets := presentacion.pdf notas.pdf
50 $(if $V,@echo "$(PDFLATEX) $< > $@")
51 $V cd $O && $(PDFLATEX) $(PDFLATEXFLAGS) $(<F) $(if $V,> $@.log)
52 $V cd $O && $(PDFLATEX) $(PDFLATEXFLAGS) $(<F) $(if $V,>> $@.log)
55 presentacion.pdf: $(imgs)
57 $O/%.tex: %.rst $(R2B)
58 $(if $V,@echo "$(R2B) $< > $@")
59 $V $(R2B) $(R2BFLAGS) $< | $(R2BFILTER) > $@
61 $O/notas.tex: R2BFLAGS += --shownotes=only
63 $O/img/%.pdf: img/%.dot
64 $(DOT) $(DOTFLAGS) -Tpdf -o $@ $<
66 $O/img/norm-hist-%.csv: img/raw-hist-%.csv
67 $(if $V,@echo "norm $< > $@")
68 $V $(AWK) -F, -v m=`cut -d, -f4 $< | $(STATS) '$$1' '%(max)s'` \
69 '{print $$1 "," $$2/m "," $$3/m "," $$4/m "," $$5/m}' \
72 $O/img/norm-hist-%.eps: $(patsubst %,$O/img/norm-hist-\%-%.csv,$(PROGS))
73 $(if $V,@echo "plot $< > $@")
74 $V $(TEMPLITE) "progs=($(patsubst %,'%'$(comma),$(PROGS))), " \
75 "files=($(patsubst %,'%'$(comma),$^))" \
76 < histogram-plot.tpl.gpi | $(GNUPLOT) > $@
78 $O/img/norm-hist-%.pdf: $O/img/norm-hist-%.eps
79 $(EPSTOPDF) --outfile=$@ $<
81 $O/img/%.pdf: img/%.pdf
92 __dummy := $(shell mkdir -p $O/img)