
all: 
	@ if [ ! -f config ] ; then make config ; fi
	(cd src; make )
	@ echo ""
	@ echo "To test, cd to src and run ./shell"
	@ echo "Check src/account.tcl for the correct path to wish"
	@ echo ""

config:
	@ echo "Configuring System For Demo"
	@ TOP=`/bin/pwd` ; \
	for i in src/shell.c ; \
	do \
		if [ ! -f $$i.orig ] ; then \
			echo Fixing $$i ; \
			mv $$i $$i.orig ; \
			sed -e s,CONFIG_TOP,$$TOP, $$i.orig > $$i ; \
		fi; \
	done
	touch config
	@ if  chown root config  ; then \
		echo "Running as root" ; \
	else \
		echo "You must be root to finish the make"; \
		rm -f config; \
		exit 1; \
	fi
	@ if  chgrp uaccount config  ; then \
		echo "Found uaccount group"; \
	else \
		echo "You need to create the uaccount group" ; \
		rm -f config; \
		exit 1; \
	fi

tar:
	rm -f config
	(cd src; make clean )
	if [ -f src/shell.c.orig ] ; then mv src/shell.c.orig src/shell.c ; fi
	(cd ..; tar cf account1.0.tar ./account; gzip -9 account1.0.tar )
