P = /lib/libp.a
I = /srce/include

.c.a:
	cc -c -O $*.c
	@ld -rx $%
	@mv a.out $%
	@> FLAG

all:	$P(alpha.o) $P(finish.o) $P(frilly.o) $P(g_alpha.o) $P(g_chop.o) \
	$P(g_chtscr.o) $P(g_chtusr.o) $P(g_closetk.o) $P(g_cput.o) \
	$P(g_ekoff.o) $P(g_ekon.o) $P(g_graphics.o) $P(g_in.o) $P(g_opentk.o) \
	$P(g_point.o) $P(g_put.o) $P(g_putxy.o) $P(g_rubout.o) $P(g_solve.o) \
	$P(g_where.o) $P(init.o) $P(scursor.o) $P(sdasha.o) $P(sdrawa.o) \
	$P(senq.o) $P(smover.o) $P(spointa.o) $P(swindow.o) $P(sxputsa.o) \
	$P(syputsa.o) $P(ucursor.o) $P(udasha.o) $P(udrawa.o) $P(uenq.o) \
	$P(umover.o) $P(upointa.o) $P(uwindow.o) $P(uxputsa.o) $P(uyputsa.o) \
	$I/cplot.h
	if [ -f FLAG ] ; then ar rv $P ; rm *.o FLAG ; fi

$I/cplot.h:	cplot.h
	cp cplot.h $I/cplot.h
	chown bin $I/cplot.h
	chmod 644 $I/cplot.h

order:
	ar x $P
	ar r LIB `lorder *.o | tsort`
	install LIB bin 644 $P
	rm *.o

$P(alpha.o):		cplot.h
$P(finish.o):		cplot.h
$P(frilly.o):		cplot.h $I/math.h
$P(g_alpha.o):		cplot.h
$P(g_chop.o):		cplot.h
$P(g_chtscr.o):		cplot.h
$P(g_chtusr.o):		cplot.h
$P(g_closetk.o):	cplot.h
$P(g_cput.o):		cplot.h
$P(g_ekoff.o):		cplot.h
$P(g_ekon.o):		cplot.h
$P(g_graphics.o):	cplot.h
$P(g_in.o):		cplot.h
$P(g_opentk.o):		cplot.h
$P(g_point.o):		cplot.h
$P(g_put.o):		cplot.h
$P(g_putxy.o):		cplot.h
$P(g_rubout.o):		cplot.h
$P(g_solve.o):		cplot.h
$P(g_where.o):		cplot.h
$P(init.o):		cplot.h
$P(scursor.o):		cplot.h
$P(sdasha.o):		cplot.h
$P(sdrawa.o):		cplot.h
$P(senq.o):		cplot.h
$P(smover.o):		cplot.h
$P(spointa.o):		cplot.h
$P(swindow.o):		cplot.h
$P(sxputsa.o):		cplot.h
$P(syputsa.o):		cplot.h
$P(ucursor.o):		cplot.h
$P(udasha.o):		cplot.h
$P(udrawa.o):		cplot.h
$P(uenq.o):		cplot.h
$P(umover.o):		cplot.h
$P(upointa.o):		cplot.h
$P(uwindow.o):		cplot.h
$P(uxputsa.o):		cplot.h
$P(uyputsa.o):		cplot.h
