L = ../lib0
I = /srce/include

all:	$L(l.o) $L(mch.o) $L(c.o)
	if [ -f FLAG ] ; then ar rv $L ; rm *.o FLAG ; fi

$L(l.o):	l.s
	as -o l.o l.s
	@> FLAG

$L(mch.o):	mch0.s mch.s
	as -o mch.o mch0.s mch.s
	@> FLAG

$L(c.o):	c.c $I/param.h $I/systm.h $I/buf.h $I/tty.h $I/sgtty.h \
	$I/conf.h $I/proc.h $I/text.h $I/dir.h $I/signal.h $I/user.h \
	$I/file.h $I/inode.h $I/acct.h $I/lnode.h $I/map.h $I/mx.h $I/lp.h \
	$I/mount.h
	cc -c c.c
	@ld -rx c.o
	@mv a.out c.o
	@> FLAG

order:
	ar x $L
	ar r LIB l.o mch.o c.o
	install LIB sys 640 $L
	rm *.o
