Plan 9 from Bell Labs’s /usr/web/sources/contrib/rsc/linuxemu/libc/linux/syscall/mkfile

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


NPROC=1
objtype=386
</$objtype/mkfile

#
# BUG: should set errstr 
#
install:V:
	SYS=`{sed '/^#define._X[123]/d; s/#define.([A-Z0-9_]*).*/\1/' sys.h}
	for(I in $SYS) {
		i=`{echo $I|tr A-Z a-z}
		n=`{sed -n '/[ 	]'$I'[ 	]/s/.*	//p' sys.h}
		base=`{echo $i | sed 's/.*(.......................)/\1/'}
		if(~ $i exits) i=_exits
		{
			echo TEXT $i'(SB)', 1, '$0'
			echo MOVL '$'$n, AX
			echo 'MOVL a+0(FP), BX'
			echo 'MOVL b+4(FP), CX'
			echo 'MOVL c+8(FP), DX'
			echo 'MOVL d+12(FP), SI'
			echo 'MOVL e+16(FP), DI'
			echo 'INT $0x80'
			echo RET
		} > $base.s
		$AS $base.s
	}
	ar vu ../../libc.a *.$O
	rm -f *.$O *.s

nuke clean:V:
	rm -f *.[$OS]

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].