Blob


1 <$PLAN9/src/mkhdr
3 SYSOFILES=`{sh ./sysofiles.sh}
4 x=`{echo $SYSOFILES> xx}
5 LIB=libthread.a
6 OFILES=\
7 $SYSOFILES\
8 channel.$O\
9 daemonize.$O\
10 exec.$O\
11 ioproc.$O\
12 iorw.$O\
13 ref.$O\
14 thread.$O\
16 <$PLAN9/src/mksyslib
18 HFILES=thread.h threadimpl.h
20 tprimes: tprimes.$O
21 9l -o $target $target.$O $PLAN9/lib/$LIB -l9 -lpthread
22 tspawn: tspawn.$O
23 9l -o $target $target.$O $PLAN9/lib/$LIB -l9 -lpthread
24 tspawnloop: tspawnloop.$O
25 9l -o $target $target.$O $PLAN9/lib/$LIB -l9 -lpthread
27 %.$O: %.c
28 9c -I. $stem.c
30 test:V: tprimes tspawn
31 primes 1 10007 >p1.txt
32 $PLAN9/bin/time ./tprimes 10000 >tp1.txt
33 cmp p1.txt tp1.txt
34 primes 1 1009 >p2.txt
35 $PLAN9/bin/time ./tprimes 1000 >tp2.txt
36 cmp p2.txt tp2.txt
37 echo tspawn should take 3 seconds, not 6
38 $PLAN9/bin/time ./tspawn sleep 3 >/dev/null
40 CLEANFILES=p1.txt p2.txt tp1.txt tp2.txt