#-----------------------------------------------------------------------------
# Copyright (c) 1990 Regents of the University of Michigan.
# All rights reserved.
#
# Redistribution and use in source and binary forms are permitted
# provided that this notice is preserved and that due credit is given
# to the University of Michigan at Ann Arbor. The name of the University
# may not be used to endorse or promote products derived from this
# software without specific prior written permission. This software
# is provided ``as is'' without express or implied warranty.
#
#       dixie makefile
#
#-----------------------------------------------------------------------------

SRCS	= dixie.c read.c search.c bind.c write.c detach.c util.c packet.c \
	error.c ping.c list.c add.c remove.c modrdn.c get_filter.c \
	filteritem.c setproctitle.c compare.c
OBJS	= dixie.o read.o search.o bind.o write.o detach.o util.o packet.o \
	error.o ping.o list.o add.o remove.o modrdn.o get_filter.o \
	filteritem.o setproctitle.o compare.o

# LIBDIR and ISODEINCLUDEDIR defaults
LIBDIR=/usr/local/isode/lib
ISODEINCLUDEDIR=/usr/local/isode/include
ETCDIR=/usr/local/etc
# comment out -lgdbm if ISODE was not compiled with TURBO_DISK
ISODELIBS= -ldsap -lisode -lgdbm

CFLAGS	= -g -I$(ISODEINCLUDEDIR) -I../include -I. $(ADDCFLAGS)
LDFLAGS	= -L$(LIBDIR)
LIBS	= $(ISODELIBS)

all:	dixie

dixie:	$(OBJS) version.o
	$(CC) $(CFLAGS) -o dixie $(OBJS) version.o $(LDFLAGS) $(LIBS)

version.c: Version.c
	(u=$${USER-root} d=`pwd` h=`hostname` t=`date`; \
	sed -e "s|%WHEN%|$${t}|" \
	-e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \
	< Version.c > version.c)

install:	$(ETCDIR)/dixie

$(ETCDIR)/dixie:	dixie
	install -c -m 755 dixie $(ETCDIR)

lint:;
	lint -I$(ISODEINCLUDEDIR) -I../include $(SRCS)

5lint:;
	/usr/5bin/lint -I$(ISODEINCLUDEDIR) -I../include $(SRCS)

clean:;
	rm -f *.o core a.out dixie dixie.old dsap.log version.c version.o

depend:;
	../mkdep $(CFLAGS) $(SRCS)

# DO NOT DELETE THIS LINE -- mkdep uses it.
# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.

# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
