diff options
author | Taru Karttunen <taruti@taruti.net> | 2011-03-30 15:46:40 +0300 |
---|---|---|
committer | Taru Karttunen <taruti@taruti.net> | 2011-03-30 15:46:40 +0300 |
commit | e5888a1ffdae813d7575f5fb02275c6bb07e5199 (patch) | |
tree | d8d51eac403f07814b9e936eed0c9a79195e2450 /sys/src/ape/lib/ap/syscall |
Import sources from 2011-03-30 iso image
Diffstat (limited to 'sys/src/ape/lib/ap/syscall')
-rwxr-xr-x | sys/src/ape/lib/ap/syscall/genall | 16 | ||||
-rwxr-xr-x | sys/src/ape/lib/ap/syscall/mkfile | 25 |
2 files changed, 41 insertions, 0 deletions
diff --git a/sys/src/ape/lib/ap/syscall/genall b/sys/src/ape/lib/ap/syscall/genall new file mode 100755 index 000000000..5aa992b95 --- /dev/null +++ b/sys/src/ape/lib/ap/syscall/genall @@ -0,0 +1,16 @@ +#!/bin/rc +# genall - generate the APE versions of the system call C interfaces. +# must be invoked by mk so that the right env variables are set. +rfork e +# ugh. sources's build process can't hack absolute path names. +# we're in /sys/src/ape/lib/ap/syscall. +SYSH=../../../../libc/9syscall/sys.h # /sys/src/libc/9syscall/sys.h + +SYS=`{sed '/^#define._/d; s/#define.([A-Z0-9_]*).*/\1/' $SYSH} +for(I in $SYS) { + i=_^$I + n=`{sed -n '/[ ]'$I'[ ]/s/.* //p' $SYSH} + gencall +} +ar vu /$objtype/lib/ape/libap.a *.$O +rm -f *.$O *.s diff --git a/sys/src/ape/lib/ap/syscall/mkfile b/sys/src/ape/lib/ap/syscall/mkfile new file mode 100755 index 000000000..080839d9a --- /dev/null +++ b/sys/src/ape/lib/ap/syscall/mkfile @@ -0,0 +1,25 @@ +NPROC=1 +</$objtype/mkfile + +all:V: install + +install:V: genall gencall + genall + +# ugh. sources's build process can't hack absolute path names. +# we're in /sys/src/ape/lib/ap/syscall. +gencall:D: ../../../../libc/9syscall/mkfile # /sys/src/libc/9syscall/mkfile + { + echo '#!/bin/rc' + sed -n -e 's/seek/_SEEK/g' -e '/switch/,/\$AS /p' $prereq + } >$target + chmod +x $target + +nuke clean:V: + rm -f *.[$OS] *.s gencall + +installall:V: + for(objtype in $CPUS) mk install + +update:V: + update $UPDATEFLAGS mkfile |