#-----------------------------------------------------------------------------
# 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 library makefile
#
#-----------------------------------------------------------------------------

SRCS	= read.c search.c bind.c modify.c util.c globals.c \
	send.c init.c parse.c error.c list.c add.c remove.c modrdn.c \
	compare.c
OBJS	= read.o search.o bind.o modify.o util.o globals.o \
	send.o init.o parse.o error.o list.o add.o remove.o modrdn.o \
	compare.o

# defaults
INSTLIBDIR=/usr/lib

CFLAGS	= -g -I../include $(ADDCFLAGS)
#CFLAGS	= -g -DDEBUG -I../include $(ADDCFLAGS)
LINTFLAGS= -DDEBUG -I../include $(ADDCFLAGS)

all:	ltest libdixie.a

libdixie.a:	$(OBJS) version.o
	ar ruv $@ $(OBJS) version.o
	ranlib $@

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)

ltest:	test.o libdixie.a
	$(CC) -g -o $@ test.o ./libdixie.a

install:	$(INSTLIBDIR)/libdixie.a

$(INSTLIBDIR)/libdixie.a:	libdixie.a
	install -c -m 755 libdixie.a $(INSTLIBDIR)
	(cd /tmp; ranlib $@)

lint:;
	lint $(LINTFLAGS) $(SRCS)

lintlib:;
	lint -Cdixie $(LINTFLAGS) $(SRCS)

clean:;
	rm -f *.o core a.out dsap.log libdixie.a ltest version.o \
	version.c llib-ldixie.ln

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
