#	Makefile to create rectangle library
#	$Header: /sl/VT/SRC/rectangle.make,v 3.1 84/02/13 17:35:26 mason Exp $

.SUFFIXES:	.o .s

CFLAGS = -O -c -I../h 

CC = 		cc
AS =		as
LD =		ld

RECTANGLE = 	within.o overlap.o adjacent.o intersect.o union.o top.o \
		bottom.o left.o right.o

rectangle.a:	${RECTANGLE}
		ar cru $@ ${RECTANGLE}
		ranlib $@

.s.o:	
		$(CC) $(CFLAGS) $< 

clean:
	rm -f rectangle.a $(RECTANGLE) core

bottom.o: bottom.s ../h/ashelp.h
	cp bottom.s bottom.c
	$(CC) -c -E bottom.c > bottom.i
	$(AS) bottom.i -o bottom.o
	rm -f bottom.c bottom.i
	
intersect.o: intersect.s ../h/ashelp.h
	cp intersect.s intersect.c
	$(CC) -c -E intersect.c > intersect.i
	$(AS) intersect.i -o intersect.o
	rm -f intersect.c intersect.i
	
left.o: left.s ../h/ashelp.h
	cp left.s left.c
	$(CC) -c -E left.c > left.i
	$(AS) left.i -o left.o
	rm -f left.c left.i
	
right.o: right.s ../h/ashelp.h
	cp right.s right.c
	$(CC) -c -E right.c > right.i
	$(AS) right.i -o right.o
	rm -f right.c right.i
	
top.o: top.s ../h/ashelp.h
	cp top.s top.c
	$(CC) -c -E top.c > top.i
	$(AS) top.i -o top.o
	rm -f top.c top.i
	
union.o: union.s ../h/ashelp.h
	cp union.s union.c
	$(CC) -c -E union.c > union.i
	$(AS) union.i -o union.o
	rm -f union.c union.i
	
