#
# This distribution will run under SunOS4.0 - 4.1.  One should see the
# README4.1.x file in ../graphics if this is your first installation.
#
# Location of the libFree.a and libgraphics.a libraries.
#
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 (-cg89 switch for SPARCstation)
#         1.2      : -O3 -dalign /usr/lib/f77/libm.il 
#         1.1      : -O3 
#
FFLAGS = -O3 -dalign -cg87 -libmil
CFLAGS = -O
#
# Define where the mind and mindtool programs will be located.
#
BINDIR = /usr/local/bin
#
# Where to put the icon file for MindTool.
#
ICONDIR = /usr/local/icons
#
# What is the full specification of the bitmaps file.
# The raster file path must also be specified.
#
RASPATH = $(ICONDIR)
BITMAPS = $(RASPATH)/mindtool.bitmaps
#
# Where the local manual pages reside.
#
MANSEC = l
MANDIR = /usr/man/man$(MANSEC)
#
#
SVLIBS = -lsuntool -lsunwindow -lpixrect
MINDLIBS = -L$(LIBDIR) -lFree -lgraphics -L/usr/old -lcgi77 -lcgi -lsunwindow -lpixrect
LDFLAGS = -s
#
FOBJ =  mind.o bonds.o calc.o draw.o pick.o parse.o \
	labels.o arc.o line.o write.o macro.o grid.o hbonds.o

mind: $(FOBJ)
	f77 $(FFLAGS) $(FOBJ) $(MINDLIBS) $(LDFLAGS) -o mind

mindtool: mindtool.c help.c
	cc $(CFLAGS) -DMINDTOOL_ICON=\"$(ICONDIR)/mindtool.icon\" \
	-DCHILD=\"$(BINDIR)/mind\" -DBITMAPS=\"$(BITMAPS)\"       \
	-o mindtool mindtool.c $(LDFLAGS) $(SVLIBS) 

install: mind mindtool
	install -m 0755 mind $(BINDIR)/mind
	install -m 0755 mindtool $(BINDIR)
	install -m 0644 mindtool.man $(MANDIR)/mindtool.$(MANSEC)
	install -m 0644 mindtool.icon $(ICONDIR)
	echo $(RASPATH)/intro.rs        > $(BITMAPS)
	echo $(RASPATH)/support.rs      >>$(BITMAPS)
	echo $(RASPATH)/conventions1.rs >>$(BITMAPS)
	echo $(RASPATH)/conventions2.rs >>$(BITMAPS)
	echo $(RASPATH)/conventions3.rs >>$(BITMAPS)
	echo $(RASPATH)/conventions4.rs >>$(BITMAPS)
	echo $(RASPATH)/print.rs        >>$(BITMAPS)
	echo $(RASPATH)/misc.rs         >>$(BITMAPS)
	install -m 0644 intro.rs        $(RASPATH)
	install -m 0644 support.rs      $(RASPATH)
	install -m 0644 conventions1.rs $(RASPATH)
	install -m 0644 conventions2.rs $(RASPATH)
	install -m 0644 conventions3.rs $(RASPATH)
	install -m 0644 conventions4.rs $(RASPATH)
	install -m 0644 print.rs        $(RASPATH)
	install -m 0644 misc.rs         $(RASPATH)

$(FOBJ):

clean:
	rm -f *.o mind mindtool core
