# 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.base   for the iPSC/860 'pcn' and 'runpcn' wrappers
#

CC=cc
INSTALL_BIN_DIR=/usr/local/pcn1.2/bin
EXE_FILE_MODE=755

runpcn:	runpcn.c config.h
	$(CC) -DRUNPCN -o runpcn runpcn.c -host

pcn:	runpcn.c config.h
	$(CC) -o pcn runpcn.c -host

config.h:	Makefile
		rm -f config.h
		/bin/echo \#define "DEFAULT_EXE" \"$(INSTALL_BIN_DIR)/pcn.ipsc860\" > config.h

install:	runpcn
	cp runpcn $(INSTALL_BIN_DIR)/.
	chmod $(EXE_FILE_MODE) $(INSTALL_BIN_DIR)/runpcn

#install:	runpcn pcn
#	cp runpcn pcn $(INSTALL_BIN_DIR)/.
#	chmod $(EXE_FILE_MODE) $(INSTALL_BIN_DIR)/runpcn $(INSTALL_BIN_DIR)/pcn

clean:
	rm -f pcn runpcn config.h *~

#
# The following is for testing runpcn on a non-SRM
#
#runpcn:	runpcn.c
#	$(CC) -DTEST -g -o runpcn runpcn.c
