rsc | 619085f | 2004-12-25 21:57:50 +0000 | [diff] [blame^] | 1 | <$PLAN9/src/mkhdr |
| 2 | |
| 3 | LIB=libthread.a |
| 4 | OFILES=\ |
| 5 | channel.$O\ |
| 6 | exec.$O\ |
| 7 | ioproc.$O\ |
| 8 | iorw.$O\ |
| 9 | pthread.$O\ |
| 10 | qlock.$O\ |
| 11 | ref.$O\ |
| 12 | thread.$O\ |
| 13 | |
| 14 | <$PLAN9/src/mksyslib |
| 15 | |
| 16 | HFILES=thread.h threadimpl.h |
| 17 | |
| 18 | tprimes: tprimes.$O |
| 19 | 9l -o $target $target.$O $PLAN9/lib/$LIB -l9 -lpthread |
| 20 | tspawn: tspawn.$O |
| 21 | 9l -o $target $target.$O $PLAN9/lib/$LIB -l9 -lpthread |
| 22 | tspawnloop: tspawnloop.$O |
| 23 | 9l -o $target $target.$O $PLAN9/lib/$LIB -l9 -lpthread |
| 24 | |
| 25 | %.$O: %.c |
| 26 | 9c -I. $stem.c |
| 27 | |
| 28 | test:V: tprimes tspawn |
| 29 | primes 1 10007 >p1.txt |
| 30 | $PLAN9/bin/time ./tprimes 10000 >tp1.txt |
| 31 | cmp p1.txt tp1.txt |
| 32 | primes 1 1009 >p2.txt |
| 33 | $PLAN9/bin/time ./tprimes 1000 >tp2.txt |
| 34 | cmp p2.txt tp2.txt |
| 35 | echo tspawn should take 3 seconds, not 6 |
| 36 | $PLAN9/bin/time ./tspawn sleep 3 >/dev/null |
| 37 | |
| 38 | CLEANFILES=p1.txt p2.txt tp1.txt tp2.txt |
| 39 | |