# Copyright (c) 1991 Bell Communications Research, Inc. (Bellcore)
# 
# Permission to use, copy, modify, and distribute this material 
# for any purpose and without fee is hereby granted, provided 
# that the above copyright notice and this permission notice 
# appear in all copies, and that the name of Bellcore not be 
# used in advertising or publicity pertaining to this 
# material without the specific, prior written permission 
# of an authorized representative of Bellcore.  BELLCORE 
# MAKES NO REPRESENTATIONS ABOUT THE ACCURACY OR SUITABILITY 
# OF THIS MATERIAL FOR ANY PURPOSE.  IT IS PROVIDED "AS IS", 
# WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES.
#

# Set the BINDIR directory to be the directory you want the executables
# installed in.
BINDIR=bin

# Set the MANDIR directory to be the location that the man pages in.
MANDIR=man

# For the ATOMICMAIL distribution, you want the second of the two following lines
# For the more freely-publishable without-ATOMICMAIL version, you want the first.
# ATOMICMAIL=
ATOMICMAIL=atomicmail

install: basics ${ATOMICMAIL} 

atomicmail::
	(cd atomicmail ; make)
	-ln -s `pwd`/atomicmail/src/atomicmail ${BINDIR}/atomicmail
	-ln -s `pwd`/atomicmail/apps/docdist.am ${BINDIR}
	-ln -s `pwd`/atomicmail/apps/mrwizard-seed.am ${BINDIR}
	-ln -s `pwd`/atomicmail/apps/mrwizard.am ${BINDIR}
	-ln -s `pwd`/atomicmail/apps/nametune.am ${BINDIR}
	-ln -s `pwd`/atomicmail/apps/scheduler.am ${BINDIR}
	-ln -s `pwd`/atomicmail/apps/surveyor.am ${BINDIR}


basics::
	@csh -c 'if (! -d ${BINDIR}) mkdir ${BINDIR}'
	@csh -c 'if (! -d ${MANDIR}) mkdir ${MANDIR}'
	(cd metamail ; make)
	(cd ezview ; make)
	(cd richmail ; make)
	(cd fonts ; make)
	-ln -s `pwd`/metamail/metamail ${BINDIR}/metamail
	-ln -s `pwd`/metamail/mmencode ${BINDIR}/mmencode
	-ln -s `pwd`/ezview/ezview ${BINDIR}/ezview
	-ln -s `pwd`/richmail/richtext ${BINDIR}/richtext
	-ln -s `pwd`/richmail/richtoatk ${BINDIR}/richtoatk
	-ln -s `pwd`/fonts/showhebrew ${BINDIR}/showhebrew
	cp misc/* ${BINDIR}
	-ln -s `pwd`/metamail/metamail.1 ${MANDIR}/metamail.1
	-ln -s `pwd`/metamail/mmencode.1 ${MANDIR}/mmencode.1
	-ln -s `pwd`/ezview/ezview.1 ${MANDIR}/ezview.1
	-ln -s `pwd`/richmail/richtext.1 ${MANDIR}/richtext.1

clean:
	-rm -rf bin man *.BAK
	(cd metamail ; make clean)
	(cd ezview ; make clean)
	(cd richmail ; make clean)
	-(cd atomicmail ; make clean)

