# Program:	SSL makefile
#
# Author:	Mark Crispin
#		Networks and Distributed Computing
#		Computing & Communications
#		University of Washington
#		Administration Building, AG-44
#		Seattle, WA  98195
#		Internet: MRC@CAC.Washington.EDU
#
# Date:		10 November 1998
# Last Edited:	31 May 2000
#
# Copyright 2000 by the University of Washington
#
# This software is provided under specific, written license from the
# University of Washington and may only be used, copied, modified, and
# distributed under the terms of such license.  This software is made
# available "as is", and
# THE UNIVERSITY OF WASHINGTON DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED,
# WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT LIMITATION ALL IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, AND IN
# NO EVENT SHALL THE UNIVERSITY OF WASHINGTON 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, TORT
# (INCLUDING NEGLIGENCE) OR STRICT LIABILITY, ARISING OUT OF OR IN CONNECTION
# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#
# Export Regulations. Software, including technical data, is subject to U.S.
# export control laws, including the U.S. Export Administration Act and its
# associated regulations, and may be subject to export or import regulations
# in other countries. Licensee agrees to comply strictly with all such
# regulations and acknowledges that it has the responsibility to obtain
# licenses to export, re-export, or import Software. Software may not be
# downloaded, or otherwise exported or re-exported (i) into, or to a
# national or resident of, Cuba, Iraq, Iran, North Korea, Libya, Sudan,
# Syria or any country to which the U.S. has embargoed goods; or (ii) to
# anyone on the U.S. Treasury Department's list of Specially Designated
# Nations or the U.S. Commerce Department's Table of Denial Orders.


IMAP=imap-4.7c

# *** TEMPORARY FOR PINE 4.10 BUILD ***
GSSDIR=/usr/local
# *** TEMPORARY FOR PINE 4.10 BUILD ***

# Normal command to build IMAP toolkit:
#  make <port> [EXTRAAUTHENTICATORS=xxx] [EXTRADRIVERS=xxx] [PASSWDTYPE=xxx]


# Extra authenticators (e.g. CRAM-MD5, OTP, Kerberos, etc.).  Adds linkage
# for auth_xxx.c and executes Makefile.xxx, where xxx is the name of the
# authenticator.  Some authenticators are only available from third parties.

EXTRAAUTHENTICATORS=


# The following extra drivers are defined:
# mbox	if file "mbox" exists on the home directory, automatically moves mail
#	 from the spool directory to "mbox" and uses "mbox" as INBOX.

EXTRADRIVERS=mbox


# The following plaintext login types are defined:
# afs	AFS authentication
# dce	DCE authentication
# krb	Kerberos IV (must also have krb as an extra authentication)
# nul	no plaintext authentication (note: this will break some secure
#	 authenticators -- don't use without checking first!!)
# std	system standard

PASSWDTYPE=std


# Miscellaneous command line options passed down to the c-client Makefile

EXTRACFLAGS=
EXTRALDFLAGS=

# Normal commands

CD=cd
LN=ln -s
MAKE=make
MKDIR=mkdir
RM=rm -rf
SH=sh
TOUCH=touch


# Make the IMAP Toolkit

all:
	@$(SH) -c '(test -d $(IMAP)) && ($(CD) $(IMAP);$(MAKE)) || (echo You must specify what type of system;false)'


a32 a41 aix bs3 bsf bsi bso d-g d54 drs epx gas gh9 ghp gso gsu gul hpp hpx lnx lyn mct mnt neb nxt nx3 osf os4 ptx qnx sc5 sco sgi shp sl4 sl5 slx snx sol sos uw2 aos art asv aux bsd cvx dpx dyn isc pyr s40 sv4 ult vul vu2 ssn sun sv2 bs2 pt1 hxd: $(IMAP)
	$(CD) $(IMAP);$(MAKE) $@ EXTRACFLAGS="$(EXTRACFLAGS)"\
	 EXTRALDFLAGS="$(EXTRALDFLAGS)" EXTRADRIVERS="$(EXTRADRIVERS)" \
	 EXTRAAUTHENTICATORS="$(EXTRAAUTHENTICATORS)" \
	 SPECIALAUTHENTICATORS="ssl" \
	 PASSWDTYPE=$(PASSWDTYPE) GSSDIR=$(GSSDIR)


$(IMAP):
	$(MKDIR) $(IMAP)
	$(CD) $(IMAP);$(LN) ../../$(IMAP)/* .;$(RM) src tools
	$(CD) $(IMAP);$(MKDIR) src tools
	$(CD) $(IMAP)/tools;$(LN) ../../../$(IMAP)/tools/* .
	$(CD) $(IMAP)/src;$(LN) ../../../$(IMAP)/src/* .;$(RM) osdep
	$(CD) $(IMAP)/src;$(MKDIR) osdep;$(MKDIR) osdep/unix
	$(CD) $(IMAP)/src/osdep/unix;$(LN) ../../../../../$(IMAP)/src/osdep/unix/* .
	$(LN) `pwd`/unix/* $(IMAP)/src/osdep/unix
	$(LN) $(IMAP)/c-client c-client
	$(LN) $(IMAP)/mtest mtest
	$(LN) $(IMAP)/ipopd ipopd
	$(LN) $(IMAP)/imapd imapd


# Courtesy entry for NT

nt:
	nmake /nologo /f makefile.nt

ntk:
	nmake /nologo /f makefile.ntk


# Courtesy entry for WCE

wce:
	nmake /nologo /f makefile.wce


clean:
	$(SH) -c '$(RM) rebuild c-client imapd ipopd mtest $(IMAP) || true'

# A monument to a hack of long ago and far away...
love:
	@echo not war?
