##########################################################################
#									 #
# 		 Copyright (C) 1983, Silicon Graphics, Inc.		 #
#									 #
#  These coded instructions, statements, and computer programs  contain  #
#  unpublished  proprietary  information of Silicon Graphics, Inc., and  #
#  are protected by Federal copyright law.  They  may  not be disclosed  #
#  to  third  parties  or copied or duplicated in any form, in whole or  #
#  in part, without the prior written consent of Silicon Graphics, Inc.  #
#									 #
##########################################################################
#
# 10/31/86 JKH; Added -g to compile flags so dbx can be used on lib func.s
# 10/20/86 JKH; Added command to copy libfgl.a to /site/ic/dist/lib
# 10/16/86 JKH; Changed library name to libfgl.a to avoid conflict with C lib.
# 10/16/86 TC/JKH; Added -DUNIX4_2 to cc line for io.c for VAXStation 
# 10/15/86 JKH; Original copy from Silicon Graphics via Ray Miller
#
FC = f77
FLIBFLAGS = -g -c -O -u -Nx1000
FDEMOFLAGS = -w -O -o $@

CC = cc
CFLAGS = -c -O -D$$SYSTEM -D$$MACHINE
CINCLUDE = -I../c

RUN =  track floats curve star sqiral planets

all: libfgl.a $(RUN)

libfgl.a: lib.o io.o
	rm -f libfgl.a
	ar rc libfgl.a lib.o io.o
	ranlib libfgl.a
	cp libfgl.a /site/ic/dist/lib

# The constituents of libfgl.a

lib.o:	lib.f
	$(FC) $(FLIBFLAGS) lib.f

io.o:	io.c
# Line below was changed to run on Athena VAXStation   TC/JKH 10/16/86
	$(CC) $(CFLAGS) $(CINCLUDE) -DUNIX4_2 io.c

# The various demo programs

track: track.f gl.h device.h libfgl.a
	$(FC) $(FDEMOFLAGS) track.f libfgl.a

sqiral: sqiral.f gl.h device.h libfgl.a
	$(FC) $(FDEMOFLAGS) sqiral.f libfgl.a

floats: floats.f gl.h libfgl.a
	$(FC) $(FDEMOFLAGS) floats.f libfgl.a

curve: curve.f gl.h device.h libfgl.a
	$(FC) $(FDEMOFLAGS) curve.f libfgl.a

star: star.f gl.h libfgl.a
	$(FC) $(FDEMOFLAGS) star.f libfgl.a

planets: planets.f gl.h device.h libfgl.a
	$(FC) $(FDEMOFLAGS) planets.f libfgl.a

clean:
	rm -f *.o libfgl.a $(RUN)
