trap 'rm -f $$.make; exit 1' 0 1 2 3 15

make -n -f - <<! $* >$$.make

ALL:		.wl .wd plh1;

.wx:;		cdm *.w >.wx

w1:.wx;		${LIB?}/bin/wir -b *.chp .wx >w1

w2:w1;		sort -u +0 -2 +2n +0 <w1 >w2

.pl:w2;		${LIB?}/bin/place-r -wc <w2 >.pl

.wd:.pl;	${LIB?}/bin/place-d .pl >.wd

.wr:.pl;		${LIB?}/bin/wrap-1 <.pl >.wr

.wl:.wr;		${LIB?}/bin/wrap-l .wr >.wl


plh1:w1;	plh -f *.w *.chp >plh1 2>plh2

clean:;		rm -f w1 w2 .pl .wr .wl .wd plh1 plh2

.SUFFIXES:	.w .g
.g.w:;		draw -w $<
!
sh -x $$.make
