blob: 3750c796559913baf92e77bee1421596528582b4 [file] [log] [blame]
rsc619085f2004-12-25 21:57:50 +00001<$PLAN9/src/mkhdr
2
rsc4dbefdd2004-12-27 16:52:26 +00003SYSOFILES=`{sh ./sysofiles.sh}
rsc619085f2004-12-25 21:57:50 +00004LIB=libthread.a
5OFILES=\
rsc4dbefdd2004-12-27 16:52:26 +00006 $SYSOFILES\
rsc619085f2004-12-25 21:57:50 +00007 channel.$O\
rsc2c87dda2004-12-28 01:35:38 +00008 daemonize.$O\
rsc619085f2004-12-25 21:57:50 +00009 exec.$O\
10 ioproc.$O\
11 iorw.$O\
rsc619085f2004-12-25 21:57:50 +000012 ref.$O\
13 thread.$O\
14
15<$PLAN9/src/mksyslib
16
17HFILES=thread.h threadimpl.h
rsccea10002005-05-01 18:38:12 +000018OpenBSD.$O FreeBSD.$O: BSD.c
19NetBSD.$O: Linux.c
rsc619085f2004-12-25 21:57:50 +000020
21tprimes: tprimes.$O
22 9l -o $target $target.$O $PLAN9/lib/$LIB -l9 -lpthread
23tspawn: tspawn.$O
24 9l -o $target $target.$O $PLAN9/lib/$LIB -l9 -lpthread
25tspawnloop: tspawnloop.$O
26 9l -o $target $target.$O $PLAN9/lib/$LIB -l9 -lpthread
27
28%.$O: %.c
rsccea10002005-05-01 18:38:12 +000029 $CC $CFLAGS -I. $stem.c
rsc5ba33c02005-03-28 15:58:14 +000030
rsc619085f2004-12-25 21:57:50 +000031
32test:V: tprimes tspawn
33 primes 1 10007 >p1.txt
34 $PLAN9/bin/time ./tprimes 10000 >tp1.txt
35 cmp p1.txt tp1.txt
36 primes 1 1009 >p2.txt
37 $PLAN9/bin/time ./tprimes 1000 >tp2.txt
38 cmp p2.txt tp2.txt
39 echo tspawn should take 3 seconds, not 6
40 $PLAN9/bin/time ./tspawn sleep 3 >/dev/null
41
42CLEANFILES=p1.txt p2.txt tp1.txt tp2.txt
43