# Makefile for libgraphics.a 
#  James Blake
# 
# @(#)Makefile	1.4 6/6/89
#
# Usage: 'make'
#        'make install'
#        'make clean' - cleans all .o files from source dir.
#
# This distribution relies on the SunCGI libraries, which are
# being phased out as of SunOS4.1.  The GCI libraries are placed in /usr/old
# with the standard OS distribution (part of the "optional graphics" 
# selection).  One should add /usr/old to the 'ld' search path with -L/usr/old
#
# Where the local library will be located.  Must be in the 
# search path of the linker for graphics code.
#
BINDIR = /usr/local/bin
LIBDIR = /usr/local/lib
# 
# Current FORTRAN flags are for a Sun4/SPARCstation with f771.4
#  
# for f77 1.3,1.4 : -O3 -dalign -cg87 -libmil 
#         1.2     : -O3 -dalign /usr/lib/f77/libm.il  
#
FFLAGS = -Nl30 -O3 -dalign -cg87 -libmil
#
# Define the location of the local manual pages.
#
MANSEC = l
MANDIR = /usr/man/man$(MANSEC)
#
# Our print spooler needs a <control-D> to flush the stream.  Undefine
# CONTROL_D if your printer complains.
#
CONTROL_D=-DCONTROL_D 
#
# Location of the prologue file.
#
PROLOGUE = $(LIBDIR)/graphics.prologue
#
CFLAGS = -O -DPROLOGUE=\"$(PROLOGUE)\" $(CONTROL_D)
#
COBJ = pl.o fb.o
#
FOBJ =  axis.o dshlin.o circle.o factor.o figure.o fontstyle.o getpoint.o \
	hide.o lenstr.o line.o newpen.o number.o oncenter.o \
	plot.o plots.o polycolor.o rubber_box.o scale.o screen.o \
	symbol.o where.o setdash.o polygon.o zoompan.o page.o \
	char_color.o bound_box.o arcs.o genline.o line_width.o \
	set_char.o cursor.o spec_str.o
#
libgraphics.a: device_type.h $(COBJ) $(FOBJ) prologue
	ar ru libgraphics.a $(FOBJ) $(COBJ)

install: libgraphics.a mugs
	install -m 0644 libgraphics.a $(LIBDIR)
	ranlib $(LIBDIR)/libgraphics.a
	install mugs $(BINDIR)
	install -m 0644 prologue $(PROLOGUE)
	install -m 0644 graphics.man $(MANDIR)/graphics.$(MANSEC)
	install -m 0644 mugs.man $(MANDIR)/mugs.$(MANSEC)

$(COBJ):

$(FOBJ):

mugs:	mugs.c
	cc $(CFLAGS) mugs.c -s -o mugs
clean:
	rm -f core *.o libgraphics.a mugs
