####################################################################
#   Copyright (c)
#
#   You may copy, distribute, and modify it freely as long as you  #
#   preserve this copyright and permission notice.                 #
#                                                                  #
#
####################################################################

#
#  Makefile for Adlib/src/hpjava/spmd
#

SHELL   = /bin/sh

srcdir      = @srcdir@
top_srcdir  = @top_srcdir@

prefix      = @prefix@
exec_prefix = @exec_prefix@

bindir      = @bindir@
includedir  = @includedir@
libdir      = @libdir@

SUBDIR  = adlib

VPATH = .:${srcdir}

all: Makefile
	@echo "Making class file ..."
	env CLASSPATH=@CWD@/src javac *.java
	@echo "Recursively making subdir:" ${SUBDIR}
	@for i in ${SUBDIR}; \
	do (cd $$i; \
	echo "--- Making" $$i;\
	$(MAKE) "MAKE=$(MAKE)"); done

Makefile: ${srcdir}/Makefile.in
	@echo 
	@echo Please configure the package to generate new makefile ...
	@exit

clean:
	rm -f *.class
	@for i in ${SUBDIR}; \
	do (cd $$i; $(MAKE) "MAKE=$(MAKE)" clean); done

distclean:
	rm -f *.class
	@for i in ${SUBDIR}; \
	do (cd $$i; $(MAKE) "MAKE=$(MAKE)" distclean); done
	@rm -f Makefile

install:
	if [ ! -d ${libdir} ] ; then mkdir ${libdir} ; fi
	if [ ! -d ${libdir}/hpjava ] ; then mkdir ${libdir}/hpjava ; fi
	if [ ! -d ${libdir}/hpjava/spmd ] ; then mkdir ${libdir}/hpjava/spmd ; fi
	cp *.class ${libdir}/hpjava/spmd
	@echo "Recursively installing subdir:" ${SUBDIR}
	@for i in ${SUBDIR}; \
	do (cd $$i; \
	echo "--- Installing" $$i;\
	$(MAKE) "MAKE=$(MAKE)" install); done

uninstall: 
	rm -f ${libdir}/hpjava/spmd/*.class
	@for i in ${SUBDIR}; \
	do (cd $$i; $(MAKE) "MAKE=$(MAKE)" uninstall); done












