# Copyright (c): Uwe Schmidt, FH Wedel # # You may study, modify and distribute this source code # FOR NON-COMMERCIAL PURPOSES ONLY. # This copyright message has to remain unchanged. # # Note that this document is provided 'as is', # WITHOUT WARRANTY of any kind either expressed or implied. SOURCES = main.c Heap.h Heap.c List.h List.c Makefile HEAPSIZE = 1000000 all : heapTest traceTest profTest \ linkedlistTest optprofTest heapTest : $(SOURCES) cc -o $@ -DTRACE=0 -DNDEBUG=1 main.c profTest : $(SOURCES) cc -o $@ -pg -DTRACE=0 -DNDEBUG=1 main.c optprofTest : $(SOURCES) cc -o $@ -pg -DTRACE=0 -DNDEBUG=1 -DMACROS=1 main.c traceTest : $(SOURCES) cc -o $@ -DTRACE=1 main.c linkedlistTest : $(SOURCES) cc -o $@ -DTRACE=0 -DNDEBUG=1 -DLINKEDLIST=1 main.c test1 : traceTest ./traceTest 100 test2 : heapTest echo "priority queue with binary heap test :" \ "$(HEAPSIZE) elements" /usr/bin/time --format="runtime was %U sec" \ ./heapTest $(HEAPSIZE) test3 : profTest echo "priority queue with binary heap test :" \ "$(HEAPSIZE) elements (profile version)" rm -f gmon.out ./profTest $(HEAPSIZE) gprof --brief profTest gmon.out test3a : optprofTest echo "priority queue with binary heap test :" \ "$(HEAPSIZE) elements (profile optimized version)" rm -f gmon.out ./optprofTest $(HEAPSIZE) gprof --brief optprofTest gmon.out test4 : linkedlistTest echo "priorty queue with sorted linked list test :" \ "$(HEAPSIZE) elements" /usr/bin/time --format="runtime was %U sec" \ ./linkedlistTest $(HEAPSIZE) 10k 20k 100k 200k 500k 1M 2M : $(MAKE) test2 \ HEAPSIZE=`echo $@ | sed -e 's|k|000|' -e 's|M|000000|'` l10k l20k l30k l40k l50k l100k l200k l500k l1M l2M : $(MAKE) test4 \ HEAPSIZE=`echo $@ | sed -e 's|^l||g' -e 's|k|000|' -e 's|M|000000|'` p10k p100k p200k p500k p1M p2M : $(MAKE) test3 \ HEAPSIZE=`echo $@ | sed -e 's|^p||g' -e 's|k|000|' -e 's|M|000000|'` o10k o100k o200k o500k o1M o2M : $(MAKE) test3a \ HEAPSIZE=`echo $@ | sed -e 's|^o||g' -e 's|k|000|' -e 's|M|000000|'` clean : rm -f *.o *Test