/* **********************************************************************
 *         Copyright IBM Corporation 1988,1991 - All Rights Reserved  
 *        For full copyright information see:'andrew/config/COPYRITE' 
 *
 * **********************************************************************
 *
 *	HOW TO CREATE AN AMS DEMONSTRATION FOLDER
 *
 *	This Imakefile will automatically create an AMS demonstration folder and store it
 *	in ${DESTDIR}/.MESSAGES/demo.  To read it, you will need to add the
 *	directory defined by ${DESTDIR}/.MESSAGES to your mspath preference.
 *	(Otherwise, you can type in its FULL path name to read it with "Read By Name"
 *	or ^X^V in Messages.)
 *
 *	Alternatively, you can also easily create a demo folder somewhere else.
 *	Using the "gendemo" script, found in this directory, type "gendemo folder-name" 
 *	where "folder-name" is the name of a creatable message folder.  For example, if 
 *	you've run an AMS application, you will have a .MESSAGES subdirectory in 
 *	your home directory, and can type "gendemo ~/.MESSAGES/amsdemo".  
 *	Be warned that if the directory you named already existed, it will be destroyed 
 *	and so will any subdirectories it had!!!
 *
 *	Also, if you want the folder subscription announcement demo to work, you should 
 *	make sure that the folder announcement referenced in d14.heads refers 
 *	to a real bboard/folder.  You should do this BEFORE running gendemo, or else 
 *	after you do it you should run gendemo again.
 *
 ************************************************************************ */

/*
	$Disclaimer: 
*Permission to use, copy, modify, and distribute this software and its 
*documentation for any purpose is hereby granted without fee, 
*provided that the above copyright notice appear in all copies and that 
*both that copyright notice, this permission notice, and the following 
*disclaimer appear in supporting documentation, and that the names of 
*IBM, Carnegie Mellon University, and other copyright holders, not be 
*used in advertising or publicity pertaining to distribution of the software 
*without specific, written prior permission.
*
*IBM, CARNEGIE MELLON UNIVERSITY, AND THE OTHER COPYRIGHT HOLDERS 
*DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING 
*ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.  IN NO EVENT 
*SHALL IBM, CARNEGIE MELLON UNIVERSITY, OR ANY OTHER COPYRIGHT HOLDER 
*BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY 
*DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, 
*WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS 
*ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
*OF THIS SOFTWARE.
* $
*/


InstallProgram(gendemo, ${DESTDIR}/etc)

DIRS = $(DESTDIR)/.MESSAGES $(DESTDIR)/.MESSAGES/demo

MkdirTarget($(DIRS))

install.time::
	-${DESTDIR}/bin/cui rebuild ${DESTDIR}/.MESSAGES \; exit
	-${CSHELL} -f gendemo  -force -DESTDIR ${DESTDIR} ${DESTDIR}/.MESSAGES/demo

InstallDocs(gendemo.help, ${DESTDIR}/help)

install.time:: 
	@cat ./cshline > amsdemo
	@echo 'if !($$?ANDREWDIR) then' >> amsdemo
	@echo  "setenv ANDREWDIR " DEFAULT_ANDREWDIR_ENV >> amsdemo
	@echo 'set path=($$ANDREWDIR/bin $$path)' >> amsdemo
	@echo "endif" >> amsdemo
	@echo '$$ANDREWDIR/bin/messages $$ANDREWDIR/.MESSAGES/demo' >> amsdemo
	chmod +x amsdemo
	
InstallProgram(amsdemo, $(DESTDIR)/etc)

CleanTarget(amsdemo)
