###############################################################################
#
# SHELL         which UNIX shell to use per line in making objects
# MAKE          program builder (e.g., make or GNUmake)
# RANLIB        archive file symbol table maker
# CC            C compiler
# RAT           Chez77 preprocessor - in a pinch, plain old ratfor will do.
# FORTRAN       Fortran compiler
# CFLAGS        Compile line switches for the C compiler
# FFLAGS        Compile line switches for the Fortran compiler
# LFLAGS        Compile line switches for the loader
# LFLAGS        Compile line switches for the extended ratfor
#
###############################################################################

SHELL          = /bin/sh
MAKE           = make
RANLIB         = ranlib
CC             = cc
RAT            = rat
FORTRAN        = f77
SYMBOLS        = -g
CFLAGS         = -c -O $(SYMBOLS)
FFLAGS         = -c -O $(SYMBOLS)
LFLAGS         = $(SYMBOLS)
RFLAGS         = -i4 -C -l2000


###############################################################################
#
# Default rules for compiling
#
###############################################################################

.SUFFIXES: .o .rat .f

.rat.o:
	$(RAT) $(RFLAGS) $*
	$(FORTRAN) $(FFLAGS) $*.f

.f.o:
	$(FORTRAN) $(FFLAGS) $*.f

.c.o:
	$(CC) $(CFLAGS) $*.c


###############################################################################
#
# Dependencies
#
###############################################################################

ALL = conv
ALL_OBJECTS = conv.o lnblnk.o

$(ALL):	$(ALL_OBJECTS)
	$(FORTRAN) -o $(ALL) $(ALL_OBJECTS)

RUNEM = alpha.blas \
        c90.sci \
        es9000-982.essl \
        r6k560.blas \
        r6k560.essl \
        r6k560.nag \
        sun.blas \
        ymp.sci

runem2:	conv
	for name in $(RUNEM);          \
	do                            \
		echo $${name};                        \
		echo $${name} | conv > $${name}.out;  \
	done

###############################################################################
#
# Cleaning operations.
#
#       clean       Delete the executables and object (.o) files only
#
###############################################################################

clean:
	touch $(ALL) $(ALL_OBJECTS) 1.out
	rm    $(ALL) $(ALL_OBJECTS) *.out


###############################################################################
#
#                              End of Makefile
#
###############################################################################
