# $Id: Makefile.in,v 1.3 2000/07/18 15:29:20 m-hirano Exp $
# $RWC_Release: Omni-1.6 $
# $RWC_Copyright:
#  Omni Compiler Software Version 1.5-1.6
#  Copyright (C) 2002 PC Cluster Consortium
#  
#  This software is free software; you can redistribute it and/or modify
#  it under the terms of the GNU Lesser General Public License version
#  2.1 published by the Free Software Foundation.
#  
#  Omni Compiler Software Version 1.0-1.4
#  Copyright (C) 1999, 2000, 2001.
#   Tsukuba Research Center, Real World Computing Partnership, Japan.
#  
#  Please check the Copyright and License information in the files named
#  COPYRIGHT and LICENSE under the top  directory of the Omni Compiler
#  Software release kit.
#  
#  
#  $
SHELL=/bin/sh

SRCS=atmc001.f brir001.f cndcmp001.f crit001.f do001.f do002.f \
	do003.f gtnthd001.f lock001.f ordr001.f par001.f \
	par002.f pardo001.f pardo002.f parsec001.f sngl001.f stnthd001.f

prefix = @prefix@
exec_prefix = @exec_prefix@
OMPF77=${exec_prefix}/bin/omf77

all:	test

fullbuild:
	@for i in $(SRCS); do \
		(EXE=./`basename $$i .f`.exe; \
			rm -f $$EXE; \
			$(OMPF77) $$i -o $$EXE); \
	done

build:
	@for i in $(SRCS); do \
		(EXE=./`basename $$i .f`.exe; \
			if test ! -x $$EXE; then \
				$(OMPF77) $$i -o $$EXE; \
			fi); \
	done
	
test:	build
	@for i in $(SRCS); do \
		(OMP_NUM_THREADS=16; export OMP_NUM_THREADS; \
			EXE=./`basename $$i .f`.exe; NM=`basename $$i .f`; \
			if test -x $$EXE; then \
				okStr=`$$EXE 2>&1 | grep "$$NM PASSED" || true`; \
				if test ! -z "$$okStr"; then \
					echo "$$NM ...	PASSED"; \
				else \
					echo "$$NM ...	FAILED"; \
				fi; \
			else \
				exit 1; \
			fi); \
		(if test $$? -ne 0; then \
			echo "can't test `basename $$i .f`."; \
			fi); \
	done

install:
	true

clean:
	@for i in $(SRCS); do \
		(EXE=./`basename $$i .f`.exe; \
			rm -f $$EXE); \
	done
	rm -f *.o *~ core

distclean:	clean
	rm -f Makefile

Makefile::
	(cd ../../..; sh ./config.status)
