#
# @(#)Makefile	1.5 6/11/96
#
# Makefile for Mailbot, by Mark Grant (mark@unicorn.com). Linux changes
# from David Summers (david@actsn.fay.ar.us) and Anders Baekgaard.
#

WWWHOME=http://www.c2.org/~mark/
USERNAME=Mark Grant
DOMAIN=unicorn.com
MAIL_FILE=/usr/spool/mail/mark
HOME=/u1/mark

#
# In theory, you could have different code to replace mail_reader.c and
# x.c (e.g. for Motif, Xt, etc). In practice, that's not done yet.
#

MAIL_OBJECT = mail_reader.o $(LINUX_OBJ)

OFILES = pgplib.o buffers.o $(MAIL_OBJECT) messages.o main.o defs.o

#
# Use the following lines if you don't have PGP Tools.
#
#PGPLDFLAGS=
#PGPTOOLDIR=

#
# Use the following lines if you do have PGP Tools, and set PGPTOOLDIR
# to the directory with the header files and libpgptools.a. You
# may want to simply create a link from this directory to the PGP Tools
# directory.
#
PGPTOOLDIR=./pgptools
PGPLDFLAGS=-L$(PGPTOOLDIR) -lpgptools

#
# Set the following to the path for your PGP executable - can be blank
# if using PGP Tools
#
PGPEXEC=$(HOME)/bin/pgp

#
# Set the version number to claim in encrypted/signed messages if using
# PGP Tools - can be blank if using PGP for everything. You'll probably
# want to set this to 2.6 now that has been released.
#
#PGPVERSION=2.3a
PGPVERSION=2.6

#
# If using SunOS/Solaris, use the first definition, if using Linux use the
# second definition.
#

LDFLAGS= -Bdynamic -lm \
	$(PGPLDFLAGS)

#LDFLAGS=-lm $(PGPLDFLAGS) \
#	-L/usr/X11/lib

#
# If you have PGP Tools, use the first line, otherwise use the
# second. 
#
# You should modify the flags after -I$(PGPTOOLDIR) to match the
# flags you used when compiling libpgptools.a.
#
# Removing USE_HASH will save memory, but decrease performance. Using
# the public key hash table *significantly* improves the speed of
# signature verification for small messages when you have a large
# pubring.pgp.
#

PGPTOOLS=-DPGPTOOLS -DUSE_HASH -I$(PGPTOOLDIR) -DUNIX -DDYN_ALLOC \
	-DNO_ASM -DHIGHFIRST -DIDEA32 
#PGPTOOLS=

#DEBUG=-g
DEBUG=-O

CFLAGS=$(DEBUG) -DPGPEXEC=\"$(PGPEXEC)\" -DPGPVERSION=\"$(PGPVERSION)\" \
	-DHOME=\"$(HOME)\" -DOUR_DOMAIN=\"$(DOMAIN)\" \
	-DOTHER_DOMAIN=\"$(OTHER_DOMAIN)\" -DMAIL_FILE=\"$(MAIL_FILE)\" \
	-DWWWHOME=\"$(WWWHOME)\" -DUSERNAME="\"$(USERNAME)\""

#
# Note: Keep -DSAFE until you are sure of correct operation on
# your machine !
#
# The SunOS strstr() code seems to take an age, so we define CRAP_STRSTR
# to use the simple C implementation in pgplib.c. Add -DACCEPT_PATH if
# you want to support Usenet archives that use Path: instead of From,
# but be aware that this may cause problems with mail....
#

#CPPFLAGS=-DSAFE $(PGPTOOLS) 
CPPFLAGS=$(PGPTOOLS)  

#
# Code is written for cc, but should work with gcc. However, I'm wary
# of trying to get the Xview code to with with gcc as I've had problems
# with that in the past.
#

#CC=gcc
CC=cc -DNON_ANSI

# Or, use acc for Solaris 2.x
#CC=acc -DSYSV

# For Linux, you should use the following :
#CC=gcc -Ilinux -DSYSV -DDONT_HAVE_TM_GMTOFF

# If using Linux, use the first line, otherwise use the second.

#LINUX_OBJ = linux/gettime.o linux/parsedate.o
LINUX_OBJ = 

#
# Following provides automatic dependencies on SunOS
#

.KEEP_STATE:

#
# Actually do the compilation...
#

all:		 mailbot

mailbot:	$(OFILES)
		$(CC) $(CFLAGS) $(OFILES) -o mailbot $(LDFLAGS)

.c.o:	
		$(CC) -c $< -o $@ $(CPPFLAGS) $(CFLAGS)

clean:
		$(RM) mailbot *.o

