.SUFFIXES: .out .out_

.out.out_:
	cp $*.out $*.out_
	awk -f ../scripts/xstones.awk < $*.out >> $*.out_

.SUFFIXES: .out_ .out__

.out_.out__:
	awk -f ../scripts/summary.awk < $*.out_ > $*.out__

all:	
	echo must be called from Makefile

link:
	rm -f *.out
	ln ../results/*.out .

summary.raw: link $(SFILES)
	cat $(SFILES) > summary.raw

summary.sorted: link summary.raw
	sort -t! +9 -n -r <summary.raw >summary.sorted

summary.tbl: link summary.sorted
	-sh ../scripts/insSep.sh < summary.sorted > summary.tbl

summary.ms: link summary.tbl
	cat ../scripts/prefix.ms summary.tbl ../scripts/postfix.ms > summary.ms
	-(if grep "(2)" summary.ms > /dev/null; then\
	    echo ".br" >> summary.ms; \
	    echo "(2) corrupted benchmark data file" >> summary.ms ; \
	  fi);
	echo ".LP" >> summary.ms

detail.ms:  link
	    -rm detail.ms
	    -(for i in *.out; do     \
		awk -f ../scripts/detail.awk < $$i >> detail.ms ; \
	      done)
