Blob


1 <$PLAN9/src/mkhdr
3 LIB=libthread.a
4 OFILES=\
5 bg.$O\
6 channel.$O\
7 daemonize.$O\
8 exec.$O\
9 ioproc.$O\
10 iorw.$O\
11 pthread.$O\
12 ref.$O\
13 thread.$O\
14 wait.$O\
16 <$PLAN9/src/mksyslib
18 HFILES=thread.h threadimpl.h
20 tprimes: test/tprimes.$O
21 9l -o $target test/$target.$O
22 tspawn: test/tspawn.$O
23 9l -o $target test/$target.$O
24 tspawnloop: test/tspawnloop.$O
25 9l -o $target test/$target.$O
27 tprimes tspawn tspawnloop: $PLAN9/lib/$LIB
29 %.$O: %.c
30 $CC -o $target $CFLAGS -I. $stem.c
32 # cannot use generic .S rule because it conflicts
33 # with generic .s rule in mkcommon on case-insensitive
34 # systems like Mac OS X.
36 OpenBSD-%-asm.$O: OpenBSD-%-asm.S
37 $CC $CFLAGS OpenBSD-$stem-asm.S
39 Linux-sparc64-context.$O: Linux-sparc64-context.S
40 $CC -m64 -mcpu=v9 $CFLAGS Linux-sparc64-context.S
42 sparc64-ucontext.$O: sparc64-ucontext.c
43 $CC -m64 -mcpu=v9 $CFLAGS sparc64-ucontext.c
45 test:V: tprimes tspawn
46 primes 1 10007 >p1.txt
47 $PLAN9/bin/time ./tprimes 10000 >tp1.txt
48 cmp p1.txt tp1.txt
49 primes 1 1009 >p2.txt
50 $PLAN9/bin/time ./tprimes 1000 >tp2.txt
51 cmp p2.txt tp2.txt
52 echo tspawn should take 3 seconds, not 6
53 $PLAN9/bin/time ./tspawn sleep 3 >/dev/null
55 CLEANFILES=p1.txt p2.txt tp1.txt tp2.txt test/*.$O tprimes tspawn