xref: /plan9/sys/src/ape/lib/ap/syscall/genall (revision 6b0d5c8bb12970c457b2c2576a066aa15bf21d0d)
1#!/bin/rc
2# genall - generate the APE versions of the system call C interfaces.
3#	must be invoked by mk so that the right env variables are set.
4rfork e
5# ugh. sources's build process can't hack absolute path names.
6# we're in /sys/src/ape/lib/ap/syscall.
7SYSH=../../../../libc/9syscall/sys.h	# /sys/src/libc/9syscall/sys.h
8
9SYS=`{sed '/^#define._/d; s/#define.([A-Z0-9_]*).*/\1/' $SYSH}
10for(I in $SYS) {
11	i=_^$I
12	n=`{sed -n '/[ 	]'$I'[ 	]/s/.*	//p' $SYSH}
13	gencall
14}
15ar vu /$objtype/lib/ape/libap.a *.$O
16rm -f *.$O *.s
17