From 81bcf3ea87f0af992a7cdcc6078db0777487e4b8 Mon Sep 17 00:00:00 2001 From: Dorian Zedler Date: Wed, 20 Jul 2022 12:19:58 +0200 Subject: [PATCH] Fix: makefile benachmarks --- Implementierung/Makefile | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/Implementierung/Makefile b/Implementierung/Makefile index 465c11a..07a4b2b 100644 --- a/Implementierung/Makefile +++ b/Implementierung/Makefile @@ -5,7 +5,7 @@ OBJ = ${subst src,build,${SRC:.c=.o}} CC = gcc CFLAGS = -Ilib -ggdb -std=c11 -g -Wall -Wextra -no-pie -O3 LDFLAGS = -pthread -TESTFILES = t/1 t/10 t/100 #t/1000 t/2000 t/5000 t/10000 +TESTFILES = t/10000 t/1 t/10 t/100 t/1000 #t/2000 t/5000 t/10000 TESTFILES_SIZES = ${subst t/,,${TESTFILES}} all: md2 @@ -36,20 +36,19 @@ t/%: @echo "=== done ===" @echo -benchmarks.csv: ${TESTFILES} - @echo "" > $@ +benchmarks.csv: md2 ${TESTFILES} + @rm -f $@ @for i in 0 2 3; do \ echo ;\ echo "=== Testing implementation $$i ===";\ for t in $(TESTFILES_SIZES); do \ echo -n "- with $${t}MB ... "; \ - if ! r=$$(./md2 t/$${t} -B1 -V1); then \ + if ! rr=$$(./md2 t/$${t} -B1 -V$${i}); then \ echo; \ echo "ERROR!"; \ exit 1; \ fi; \ - r=$$(echo $$r | grep "cycles took" | sed 's/ seconds//g' | sed 's/took /\n/g' | tail -1) \ - echo $$?; \ + r=$$(echo $$rr | xargs | sed -e 's/.*took \(.*\) seconds.*/\1/'); \ echo "$${r}s"; \ echo "$${i};$${t};$${r}" >> $@; \ done; \ @@ -57,8 +56,6 @@ benchmarks.csv: ${TESTFILES} echo;\ done +benchmarks: benchmarks.csv -tests: md2 - - -.PHONY: all clean help \ No newline at end of file +.PHONY: all clean help benchmarks \ No newline at end of file