#$Id: Makefile,v 1.2 1996/10/30 16:24:29 srb Exp $

BASENAME= /usr

GCC_WARNINGS = -O2 -pedantic -Wreturn-type -Wunused -Wformat \
 -Wpointer-arith -Wconversion -Waggregate-return \
 #-Wimplicit -Wshadow #-Wuninitialized

CFLAGS	= -O #$(GCC_WARNINGS)
LDFLAGS =

O=o

BINDIR=$(BASENAME)/sbin
MANDIR=$(BASENAME)/man/man8

INSTALL=install -o root -m
BINPERM=02755 -s -g mail
REGPERM=0644

#
# When compiling without APOP support, the md5 library can be omitted.

MD5_OBJ=md5/md5c.$(O)

OBJS=cucipop.$(O) authenticate.$(O) locking.$(O) xcreat.$(O) $(MD5_OBJ)

all: cucipop

cucipop: $(OBJS)
	$(CC) $(CFLAGS) $(OBJS) -o $@ $(LDFLAGS) $(LIBS)

cucipop.$(O): config.h patchlevel.h cucipop.h authenticate.h

authenticate.$(O): config.h cucipop.h authenticate.h

locking.$(O): config.h cucipop.h locking.h

$(MD5_OBJ): md5/md5c.c md5/md5.h
	cd md5; $(CC) $(CFLAGS) -c md5c.c

install: cucipop cucipop.8
	$(INSTALL) $(BINPERM) cucipop $(BINDIR)
	$(INSTALL) $(REGPERM) cucipop.8 $(MANDIR)
	ls -l $(BINDIR)/cucipop $(MANDIR)/cucipop.8

deinstall:
	$(RM) $(BINDIR)/cucipop
	$(RM) $(MANDIR)/cucipop.8

clean:
	rm -f *.$(O) md5/*.$(O) cucipop *core*
