# 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 on 
#			the Sequent Symmetry using the ATS compilers
#

ARCH=symmetry
FORTRAN=fortran
CC=atscc
FFLAGS=-g
CFLAGS=-g
OFILE=o

PCNCC=/Net/alcaid/alcaid5/tuecke/PCN/Beta/Em/symmetry/pcncc
PCN=/Net/alcaid/alcaid5/tuecke/PCN/Beta/Em/symmetry/pcn

PCN_EXE=pcn

.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 *~

