# PCN Abstract Machine Emulator
# Authors:     Steve Tuecke and Ian Foster
#              Argonne National Laboratory
#
# Please see the DISCLAIMER file in the top level directory of the
# distribution regarding the provisions under which this software
# is distributed.
#
# Makefile	- makefile for Fortran I/O initialization test for iPSC/860
#

ARCH=ipsc860
FORTRAN=pgf77
CC=pgcc
FFLAGS=-g
CFLAGS=-g
OFILE=o

PCNCC=/home/sirius/tuecke/PCN/Beta/Em/ipsc860/pcncc.ipsc860
PCN=/home/sirius/tuecke/PCN/Beta/Em/sun4/pcn

PCN_EXE=pcn.ipsc860

.SUFFIXES: .pcn .pam

.pcn.pam: ;     echo 'Compiling $*.pcn ...'
		echo 'load("co"),compile("$*",[],D),exit(D)' | $(PCN)
		@ echo ""

$(PCN_EXE):		codes cr.pam
	$(PCNCC) -fortran cr.pam

codes:	  $(ARCH)/tf.o $(ARCH)/tc.o

$(ARCH)/tc.o: tc.c
		$(CC) $(CFLAGS) -c tc.c "-DARCH=\"$(ARCH)\""
		mv tc.$(OFILE) $(ARCH)/tc.o

$(ARCH)/tf.o: tf.f
		$(FORTRAN) $(FFLAGS) -c tf.f
		mv tf.$(OFILE) $(ARCH)/tf.o

.IGNORE:
clean: ;	rm -f $(ARCH)/*.o $(PCN_EXE) *.pam *.mod *~

