# $Id: Makefile.in,v 1.1 2000/10/11 14:18:33 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 = tiny01.c  tiny05.c  tiny09.c  tiny13.c  tiny18.c    tiny19-4.c  tiny22-1.c \
	tiny02.c  tiny06.c  tiny10.c  tiny14.c  tiny19-1.c  tiny19-5.c  tiny22-2.c \
	tiny03.c  tiny07.c  tiny11.c  tiny15.c  tiny19-2.c  tiny20.c    tiny22-3.c \
	tiny04.c  tiny08.c  tiny12.c  tiny16.c  tiny19-3.c  tiny21.c


prefix		=	$${OMNI_HOME:=@orgPrefix@}
exec_prefix     =       @orgExec_prefix@

CC		=	${prefix}/bin/omcc

all:	test

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

build:
	@for i in $(SRCS); do \
		(EXE=./`basename $$i .c`.exe; \
			if test ! -x $$EXE; then \
				$(CC) $$i -o $$EXE; \
			fi); \
	done
	
test:	build
	@for i in $(SRCS); do \
		(OMP_NUM_THREADS=16; export OMP_NUM_THREADS; \
		OMP_NESTED=true; export OMP_NESTED; \
			EXE=./`basename $$i .c`.exe; NM=`basename $$i .c`; \
			if test -x $$EXE; then \
				okStr=`$$EXE 2>&1 | grep "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 .c`."; \
			fi); \
	done

install:
	true

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

distclean:	clean
	true

