<../mkconfig

LIB=libinterp.a

OFILES=\
	alt.$O\
	comp-$OBJTYPE.$O\
	conv.$O\
	dec.$O\
#	dlm-$TARGMODEL.$O\
	draw.$O\
	gc.$O\
	geom.$O\
	heap.$O\
	heapaudit.$O\
	ipint.$O\
	link.$O\
	load.$O\
	math.$O\
	raise.$O\
	readmod.$O\
	runt.$O\
	sign.$O\
	stack.$O\
	validstk.$O\
	xec.$O\
	das-$OBJTYPE.$O\
	keyring.$O\
	string.$O\

HFILES=\
	../include/interp.h\
	../include/isa.h\
	runt.h\
	tab.h\

MODULES=\
	/module/runt.m\
	/module/sys.m\
	/module/draw.m\
	/module/math.m\
	/module/keyring.m\
	/module/loader.m\

<../mksyslib

runt.h:D: $MODULES
	rm -f $target && limbo -a -I/module /module/runt.m > $target

sysmod.h:D: $MODULES
	rm -f $target && limbo -t Sys -I/module /module/runt.m > $target

keyring.h:D: $MODULES
	rm -f $target && limbo -t Keyring -I/module /module/runt.m > $target

drawmod.h:D: $MODULES
	rm -f $target && limbo -t Draw -I/module /module/runt.m > $target

mathmod.h:D: $MODULES
	rm -f $target && limbo -t Math -I/module /module/runt.m > $target

loadermod.h:D: $MODULES
	rm -f $target && limbo -t Loader -I/module /module/runt.m > $target

xec.$O:		optab.h  ../include/pool.h
draw.$O: 	../include/draw.h ../include/drawif.h

runt.$O:	sysmod.h
draw.$O:	drawmod.h
math.$O:	mathmod.h
keyring.$O:	keyring.h ../libkeyring/keys.h
ipint.$O:	keyring.h
loader.$O:	loadermod.h
math.$O:	../include/mathi.h

das-spim.c:N:	das-mips.c
das-68000.c:N:	das-68020.c
comp-spim.c:N:	comp-mips.c

kif.c:	kif.h
	rm -f $target && kif -t $SYSTARG kif.h > $target
kif.$O: kif.c
	$CC $CFLAGS kif.c && rm -f kif.c

# optab.h:	../include/isa.h mkoptab
#	$SHELLNAME mkoptab > $target

#	Do not remove optab.h, because the script that builds
#	it works only on UNIX and Plan 9.

nuke:EV:	nuke-std
	rm -f runt.h sysmod.h drawmod.h prefabmod.h tkmod.h mathmod.h keyring.h readimagemod.h loadermod.h freetypemod.h kif.c
