blob: 99f899cc154023afd44fb17d84107379ed2c1dd1 [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\
rsc4940b552006-02-12 16:48:50 +000014 wait.$O\
rsc619085f2004-12-25 21:57:50 +000015
16<$PLAN9/src/mksyslib
17
18HFILES=thread.h threadimpl.h
rsccea10002005-05-01 18:38:12 +000019OpenBSD.$O FreeBSD.$O: BSD.c
20NetBSD.$O: Linux.c
rsc619085f2004-12-25 21:57:50 +000021
Russ Coxe7ae6112007-10-30 13:33:12 -040022tprimes: test/tprimes.$O
23 9l -o $target test/$target.$O
24tspawn: test/tspawn.$O
25 9l -o $target test/$target.$O
26tspawnloop: test/tspawnloop.$O
27 9l -o $target test/$target.$O
rsc619085f2004-12-25 21:57:50 +000028
29%.$O: %.c
Russ Coxe7ae6112007-10-30 13:33:12 -040030 $CC -o $target $CFLAGS -I. $stem.c
rsc5ba33c02005-03-28 15:58:14 +000031
rsc910ca532005-05-01 22:28:11 +000032# cannot use generic .S rule because it conflicts
33# with generic .s rule in mkcommon on case-insensitive
34# systems like Mac OS X.
35
rscfe8c9252005-07-21 18:29:04 +000036OpenBSD-%-asm.$O: OpenBSD-%-asm.S
37 $CC $CFLAGS OpenBSD-$stem-asm.S
rsc619085f2004-12-25 21:57:50 +000038
rsc76a78f42006-02-14 06:52:41 +000039Linux-sparc64-context.$O: Linux-sparc64-context.S
rsc07b075d2006-02-16 06:02:46 +000040 $CC -m64 -mcpu=v9 $CFLAGS Linux-sparc64-context.S
rsc76a78f42006-02-14 06:52:41 +000041
rscc33c1412006-02-16 06:22:03 +000042Linux-sparc64-swapcontext.$O: Linux-sparc64-swapcontext.c
43 $CC -m64 -mcpu=v9 $CFLAGS Linux-sparc64-swapcontext.c
44
rsc619085f2004-12-25 21:57:50 +000045test: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
54
55CLEANFILES=p1.txt p2.txt tp1.txt tp2.txt
56
rsc76a78f42006-02-14 06:52:41 +000057