# $Id: Makefile.in,v 1.21 2002/03/29 20:15:59 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.
#  
#  
#  $

TOPDIR		=	../..
SUBDIRS		=	object block openmp util flow tea ../shm ../st

ompcdir		=	@prefix@/lib/openmp
ompcclassdir	=	$(ompcdir)/java
INSTALLDIR      =       $(ompcclassdir)
INSTALL         =       @INSTALLCOM@
MKDIR           =       @MKDIRCOM@
GENJAR		=	@GENJAR@

XCODEDIR	= object/Xcodegen
TARGET		= exc.jar

all:	$(TARGET)

$(TARGET): target_clean
	(cd $(XCODEDIR); $(MAKE))
	for i in $(SUBDIRS) ; do \
		(cd $$i; CLASSPATH=.:..:../..:$$CLASSPATH @JAVACCOM@ *.java); \
	done
	rm -f $@
	(cd ../ ; \
		rm -f .classes ; \
		find ./exc ./shm ./st -name '*.class' -print > .classes ; \
		sh ../utils/genjar $@ `cat .classes` ; \
		mv $@ exc ; \
		rm -f .classes ;)

target_clean:
	rm -f $(TARGET)

install:	$(TARGET)
	@if [ ! -d $(INSTALLDIR) ]; then \
		(echo "Making directory $(INSTALLDIR)" ; \
                $(MKDIR) $(INSTALLDIR) ; \
                chmod 775 $(INSTALLDIR)); \
        else \
                true ; \
        fi
	$(INSTALL) -m 644 $(TARGET) $(INSTALLDIR)

clean:
	(cd $(XCODEDIR); $(MAKE) clean)
	rm -f ./.classes	
	find . ../shm ../st -name '*.class' -print > ./.classes
	rm -f `cat ./.classes`
	rm -f ./.classes
	rm -f $(TARGET)
	(cd ../; rm -f $(TARGET) etjClass.tar .classes)

distclean: clean
	(cd $(XCODEDIR); $(MAKE) distclean)
	rm -f config.* Makefile .depend*

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

etjTar:	$(TARGET)
	rm -f ./etjClass.tar
	(cd ../ ; \
		rm -f .classes ; \
		find ./exc ./shm ./st -name '*.class' -print > .classes ; \
		tar cvf ./etjClass.tar `cat .classes` ; \
		mv ./etjClass.tar ../utils; \
		rm -f .classes ;)

commit:	etjTar
	(cd ../../utils; cvs ci etjClass.tar)
