#
# $Id: Makefile.in,v 1.4 2004/06/02 10:24:24 mnwaitz Exp $
# vim:tabstop=8:shiftwidth=8:textwidth=72
#

LANG=C
LC_ALL=C

prefix=/usr
datadir=${prefix}/share
docdir=${datadir}/doc/faumachine
examplesdir=${docdir}/examples


thisexdir=$(examplesdir)/single-node

all: experiment

experiment: \
	../install-Debian-3.0r0-serial/node.pc/ide-0/unit-0/media \
	system.vhdl \
	simulation.setup
	@echo
	@echo "This example is very simple:"
	@echo "It just logs into the system and waits for 5 minutes"
	@echo "before it shuts down the system again."
	@echo
	@echo "Do a tail -f ./expect-run.log to view progress output."
	@echo
	faum-expect >  ./expect-run.log 2> ./expect-errors.log
	touch experiment

clean distclean::
	rm -f start_all.sh kill_all.sh
	rm -f errors.*
	rm -f expect-*.log
	rm -f log.*
	rm -f fault_list.expect
distclean::
	rm -f experiment
	rm -rf node.*

../install-Debian-3.0r0-serial/node.pc/ide-0/unit-0/media:
	cd ../install-Debian-3.0r0-serial; make experiment

install:
	mkdir -p $(DESTDIR)$(thisexdir)
	for file in \
		simulation.setup \
		software.setup \
		system.vhdl \
		Makefile \
		; do \
		cp $${file} $(DESTDIR)$(thisexdir) ; \
	done ;

test: experiment
	@if  [ -z "`grep 'END of process REACHED' expect-run.log`" ] ; then \
		touch experimentFailed ; \
		echo "Experiment failed!" ; \
	fi
distclean::
	rm -f experimentFailed
