CFLAGS = -Wall -std=gnu1x -I../matrix.gc LDLIBS = -lgc -lm all:out.txt cat $< out.txt:main ./$< > $@ main: main.o matrix.o QR_givens.o main.o matrix.o: ../matrix.gc/matrix.h matrix.o: ../matrix.gc/matrix.c $(CC) -c $(CFLAGS) $< -o $@ times:times.svg out.times.txt: main Makefile cat /dev/null > $@ for n in `seq 150 10 250`;\ do time --format "$$n %U" --append --output $@ ./main $$n;\ done times.svg: out.times.txt echo '\ set term svg background rgb "white"; \ set out "$@"; \ set xlabel "matrix size"; \ set ylabel "Givens QR-factorization time, sec"; \ set title "Givens QR-factorization time as function of matrix size (`uname -m`)"; \ set key left; \ f(x)=b+(x/a)**3; \ b=0.1; a=10; \ fit f(x) "$<" via b,a; \ T = sprintf("fit: %4.1f+(n/%3.0f)^3",b,a); \ plot "$<" title "measurement", f(x) title T; \ '|tee log.gpi|gnuplot clean: find . -type f -executable -delete rm -f *.o out* log* *.log *.svg