3 SYSOFILES=`{sh ./sysofiles.sh}
18 HFILES=thread.h threadimpl.h
19 OpenBSD.$O FreeBSD.$O: BSD.c
23 9l -o $target $target.$O $PLAN9/lib/$LIB -l9 -lpthread
25 9l -o $target $target.$O $PLAN9/lib/$LIB -l9 -lpthread
26 tspawnloop: tspawnloop.$O
27 9l -o $target $target.$O $PLAN9/lib/$LIB -l9 -lpthread
30 $CC $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 Linux-sparc64-swapcontext.$O: Linux-sparc64-swapcontext.c
43 $CC -m64 -mcpu=v9 $CFLAGS Linux-sparc64-swapcontext.c
45 test:V: tprimes tspawn
46 primes 1 10007 >p1.txt
47 $PLAN9/bin/time ./tprimes 10000 >tp1.txt
50 $PLAN9/bin/time ./tprimes 1000 >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