# make file for the IP/TCP/POP3 server for UNIX

#
# Compile-time conditional compilation flags
#
# Select one or more options that are applicable to your UNIX environment
#
# add -DSYSV  for SVR3.2 support
# add -DSVR4  for SVR4 support
# add -DAIX for AIX support
# add -DANSIC for an ANSIC compiler
# add -DNO_SHADOW if you don't have shadow password support (as in, no libs
# 	for it).  Almost everyone does have this.
# add -DUIDL_OKAY for 'Leave Mail on Server' support
# add -DNO_MULTIPLE to disallow multiple ( simultaneous ) POP3 sessions
#                   on a single POP mailbox file
# add -DTLI   for TLI support
# add -DDEBUG for debugging output in logfile
# add -DLOG_SESSIONS for syslog tracking of POP3 sessions
# add -DHOST_EXT for HOST and MBOX extension commands
# add -DQMAIL for Qmail ~/Mailbox support (instead of standard 
#             /var/spool/mail/<username>
# add -DPOPMOTD for popmotds.
# add -UCD for UC Davis specific NIS lookups
# add -DPINE_IMAP to allow pop to skip over pine's imap index messages.  
# 	This is generally a good thing if your users use pine w/IMAP, and 
#	then go home and pop.
# add -DSTANDALONE to run the pop daemon in standalone mode, rather than
# 	spawning out of inetd.  This is pretty much untested.  Please let me
#	know if you use this.
# add -DRESOLVE_IPS if you want IP's to be resolved (duh).  The default for
# 	logging is now to just log the remote machine's IP, not the actual
#	hostname.  I figured this was reasonable, and will certainly speed
#	things up.
#
DEFS	=-DSVR4 -DANSIC -DUIDL_OKAY -DNO_MULTIPLE -DLOG_SESSIONS -DPINE_IMAP -DPOPMOTD

# for the 'gcc' compiler under SVR4 uncomment the following
CC	=gcc -Wall -fpcc-struct-return
#CC	=gcc
CFLAGS=-O2 $(DEFS)

#
# Library complilation flags
#
#
# Select the set of library compilation flags appropriate for your
# UNIX environment
#
# Note: if you are outside of the USA, you should add a    -lcrypt
#       flag to the other library flags
#
# for socket libraries under SVR4 uncomment the following
LFLAGS	=-lsocket -lnsl -lcrypt
# for socket libraries under SVR3.2 uncomment the following
#LFLAGS =-lsocket -linet -lnsl -lsec
# for socket libraries under BSD uncomment the following
#LFLAGS = -lcrypt

OBJS	= main.o folder.o util.o

all: pop3d

install: all
	install -c -m 711 pop3d $(DESTDIR)/etc/pop3d

clean::
	rm -f *.o core pop3d

pop3d: $(OBJS)
	$(CC) -o pop3d $(OBJS) $(LFLAGS)

main.o:	main.c pop3.h Makefile
folder.o: folder.c pop3.h popmotd.h Makefile
util.o: util.c pop3.h Makefile

