# Generated automatically from Makefile.in by configure.

BUILD_ROOT=/home/baallan/work/caff/cca-spec-2.95.3
BUILDDIRS= cxx/src java
CLEANDIRS= cxx/src cxx/lib java
BUILDDOCS= java/doc cxx/doc

# rerun configure with a different --prefix=... to change INSTALL_ROOT.
INSTALL_ROOT= /usr/local/cca-spec

INSTALL_DIRS= \
java \
cxx \
doc

INSTALL_FILES= \
MakeIncl.CCA_Component \
ccaConfig.sh \
ccaConfigTemporary.sh

DOCXX=@echo no-doc++
JAVADOC=/usr/local/java/j2sdk1.4.0_01/bin/javadoc

all: build doc done

done:
	@echo "#======================================"
	@echo "Done with our best shot at everything."
	@echo "#======================================"

# If doc++/doxygen or javadoc isn't found, tough cookies.
# It isn't totally impossible to read our headers directly.
doc:
	@for i in $(BUILDDOCS) /dev/null ; do \
		if test $$i != "/dev/null" -a -d $$i ; then \
			echo "#======================================" ; \
			echo "Building documentation in $$i" ; \
			echo "#======================================" ; \
			(cd $$i ; $(MAKE) JAVADOC=$(JAVADOC)) ; \
		fi ; \
		if test $$i != "/dev/null" -a ! -d $$i ; then \
			echo "* * * You need to checkout/update -d $$i"; \
			exit 1 ; \
		fi ; \
	done

build:
	@for i in $(BUILDDIRS) /dev/null ; do \
		if test $$i != "/dev/null" -a -d $$i ; then \
			(cd $$i ; $(MAKE) ) ; \
		fi ; \
		if test $$i != "/dev/null" -a ! -d $$i ; then \
			echo "* * * You need to checkout/update -d $$i"; \
			exit 1 ; \
		fi ; \
	done
	@echo "#====================================================="
	@echo " All configured bindings ($(BUILDDIRS)) built."
	@echo "#=====================================================" 

# check the existence of the install root location
$(INSTALL_ROOT):
	-mkdir -p $(INSTALL_ROOT)
	@if test ! -d $(INSTALL_ROOT) ; then \
		echo "* * * You don't have permission to install in $(INSTALL_ROOT)" ; \
		exit 1 ; \
	fi

install: $(INSTALL_ROOT)
	@if test $(INSTALL_ROOT) -ef $(BUILD_ROOT) ; then \
		echo "* * * Built in installation location. Nothing to do."; \
		exit 1; \
	fi
	@for i in $(INSTALL_DIRS) /dev/null ; do \
		if test $$i != "/dev/null" -a -d $$i ; then \
			echo "Installing $$i"; \
			(cd $$i ; $(MAKE) CCA_INSTALL_ROOT=$(INSTALL_ROOT) install.local) ; \
		fi ; \
	done
	@for i in $(INSTALL_FILES) /dev/null ; do \
		if test $$i != "/dev/null" -a -f $$i ; then \
			echo "Installing $$i"; \
			cp $$i $(INSTALL_ROOT) ; \
		fi ; \
	done

uninstall: $(INSTALL_ROOT)
	@if test $(INSTALL_ROOT) -ef $(BUILD_ROOT) ; then \
		echo "* * * Built in installation location. Nothing to do."; \
		exit 1; \
	fi
	rm -rf $(INSTALL_ROOT)


# Probably should clean out docs too oh well
clean:
	@for i in $(CLEANDIRS) /dev/null ; do \
		if test $$i != "/dev/null" -a -d $$i ; then \
			(cd $$i ; $(MAKE) clean) ; \
		fi ; \
		if test $$i != "/dev/null" -a ! -d $$i ; then \
			echo "* * * You need to checkout/update -d $$i"; \
			exit 1 ; \
		fi ; \
	done

distclean: clean
	$(RM) config.status config.log \
	ccaConfig.sh ccaConfigTemporary.sh \
	MakeIncl.CCA_Component Makefile java/Makefile

# we don't suggest you edit our configure, but if you must
# and you have autoconf 2.13...
configure: configure.in
	-/bin/rm configure
	autoconf configure.in | sed -e 's;# $$Header;# Source;' > configure
	chmod a+x configure

test-configure: configure
	./configure

.PHONY: clean distclean doc all done
