From b6b1690dc26e20bfd11b34901aa02656a5264b28 Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Sun, 28 Nov 2010 19:27:15 -0300 Subject: [PATCH] =?utf8?q?Respetar=20opci=C3=B3n=20-s=20de=20Make?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- Makefile | 42 +++++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/Makefile b/Makefile index 1b34271..4b677d5 100644 --- a/Makefile +++ b/Makefile @@ -25,6 +25,7 @@ PROGS := bigarr conalloc concpu mcore rnddata sbtree split \ STATS := ./stats.py TEMPLITE := ./templite.py +AWK := awk EPSTOPDF := epstopdf GNUPLOT := gnuplot @@ -35,44 +36,47 @@ imgs := $O/img/mark-sweep-0.pdf \ $O/img/heap.pdf \ $(patsubst %,$O/img/norm-hist-%.pdf,$(PLOTS)) +# Verbosity flag (empty show nice messages, non-empty use make messages) +# When used internal, $V expand to @ is nice messages should be printed, this +# way it's easy to add $V in front of commands that should be silenced when +# displaying the nice messages. +override V := $(if $V,,@) +# honour make -s flag +override V := $(if $(findstring s,$(MAKEFLAGS)),,$V) + presentacion.pdf: $O/presentacion.tex $(imgs) - @echo "$(PDFLATEX) $< > $@" - @cd $O && $(PDFLATEX) $(PDFLATEXFLAGS) $( $@.log - @cd $O && $(PDFLATEX) $(PDFLATEXFLAGS) $(> $@.log - @mv $O/$@ $@ + $(if $V,@echo "$(PDFLATEX) $< > $@") + $V cd $O && $(PDFLATEX) $(PDFLATEXFLAGS) $( $@.log + $V cd $O && $(PDFLATEX) $(PDFLATEXFLAGS) $(> $@.log + $V mv $O/$@ $@ $O/presentacion.tex: presentacion.rst $(R2B) - @echo "$(R2B) $< > $@" - @$(R2B) $(R2BFLAGS) $< | $(R2BFILTER) > $@ + $(if $V,@echo "$(R2B) $< > $@") + $V $(R2B) $(R2BFLAGS) $< | $(R2BFILTER) > $@ $O/img/%.pdf: img/%.dot - @echo "$(DOT) $< > $@" - @$(DOT) $(DOTFLAGS) -Tpdf -o $@ $< - @#pdftops mark-sweep-$i.pdf && ps2pdf14 mark-sweep-$i.ps && rm mark-sweep-$i.ps + $(DOT) $(DOTFLAGS) -Tpdf -o $@ $< $O/img/%.pdf: img/%.aafig - @echo "$(AAFIG) $< > $@" - @$(AAFIG) $(AAFIGFLAGS) -t pdf -o $@ $< + $(AAFIG) $(AAFIGFLAGS) -t pdf -o $@ $< $O/img/norm-hist-%.csv: img/raw-hist-%.csv - @echo "norm $< > $@" - @awk -F, -v m=`cut -d, -f4 $< | $(STATS) '$$1' '%(max)s'` \ + $(if $V,@echo "norm $< > $@") + $V $(AWK) -F, -v m=`cut -d, -f4 $< | $(STATS) '$$1' '%(max)s'` \ '{print $$1 "," $$2/m "," $$3/m "," $$4/m "," $$5/m}' \ $< > $@ $O/img/norm-hist-%.eps: $(patsubst %,$O/img/norm-hist-\%-%.csv,$(PROGS)) - @echo "plot $< > $@" - @$(TEMPLITE) "progs=($(patsubst %,'%'$(comma),$(PROGS))), " \ + $(if $V,@echo "plot $< > $@") + $V $(TEMPLITE) "progs=($(patsubst %,'%'$(comma),$(PROGS))), " \ "files=($(patsubst %,'%'$(comma),$^))" \ < histogram-plot.tpl.gpi | $(GNUPLOT) > $@ $O/img/norm-hist-%.pdf: $O/img/norm-hist-%.eps - @echo "$(EPSTOPDF) $< > $@" - @$(EPSTOPDF) --outfile=$@ $< + $(EPSTOPDF) --outfile=$@ $< $O/img/%.pdf: img/%.pdf - @echo "cp $< > $@" - @cp $< $@ + cp $< $@ $O/heap.pdf: AAFIGFLAGS += -s 1.4 -a 0.8 -- 2.43.0