#
#   Makefile for cgl (nonproprietary RGL) residing on the Cray2
#
#
TARGET = /usr/local/lib
NEWRGLLIB = libcgl.a
#DEBUG  = -DDEBUG
#
#  Use the following for BSD networking code on the CRAY2
#
CFLAGS = -c -O ${DEBUG} -DCRAY -DCRAY2 -I../include

IOOBJS = netio.o netinit.o float.o special.o

all:	${NEWRGLLIB}

${NEWRGLLIB}: libobjs ${IOOBJS}
	ar crv ${NEWRGLLIB} libobjs/*.o ${IOOBJS}

libobjs: libsrc
	cd libsrc; cc ${CFLAGS} -I../../include *.c
	-mkdir libobjs; 
	-mv libsrc/*.o libobjs;

libsrc: hostlibc.ed  hostlibc.c
	mkdir libsrc;
	ed hostlibc.c < hostlibc.ed
	ed hostlibf.c < hostlibf.ed

install: 
	mv ${NEWRGLLIB} ${TARGET}

clean:	
	-rm -rf libsrc 
	-rm -rf libobjs 
	-rm -f *.o

clobber:
	-rm -rf libsrc 
	-rm -rf libobjs 
	-rm -f *.o
	-rm -f *.a 
