#
#	Rules for updating a library with rc
#
LIBDIR=/sys/$OBJDIR/lib
LIBRARY=$LIBDIR/$LIB
LIBOBJ=${OFILES:%=$LIBRARY(%)}

default:V:	all

all install:V:	$LIBRARY

installall:V:
	for(objtype in $CPUS)
		mk $MKFLAGS install

clean:V: clean-std	

nuke:V:	nuke-std

LIB1=${LIBRARY:%=$ARPREFIX%}

$LIBRARY:	$LIBOBJ
	mkdir -p $LIBDIR
	$AR $ARFLAGS $LIB1 $OFILES

$LIBRARY(%.$O):N:	%.$O

%.$O:	$HFILES		# don't combine with following %.$O rules

%.$O:	%.c
	$CC $CFLAGS $stem.c

%.$O:	%.s
	$AS $ASFLAGS $stem.s
	
%.$O:	%.S$MACOSINF
	$AS $ASFLAGS $stem.S

y.tab.h y.tab.c:	$YFILES
	$YACC $YFLAGS $prereq

clean-std:V:
	rm -f *.[$OS] [$OS].out
	rm -f *.$O y.tmp.*
	rm -f y.tab.? y.output y.error *.pdb *.pch

nuke-std:V:	clean-std
	rm -f y.tab.? y.output y.error *.pdb *.pch
	rm -f $LIBRARY
