# Generated automatically from Makefile.in by configure.
# Makefile for cyrus library
# 
# Generated automatically from Makefile.in by configure.
# 
#        Copyright 1998 by Carnegie Mellon University
#
#                      All Rights Reserved
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright notice and this permission notice appear in
# supporting documentation, and that the name of CMU not be
# used in advertising or publicity pertaining to distribution of the
# software without specific, written prior permission.
#
# CMU DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
# ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
# CMU BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
# ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
# ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
# SOFTWARE.

# Authorization namespace.
AUTH=auth_krb.o

# ACL interpretation.  Only one choice for now:
ACL=acl_afs.o

srcdir = .

CC = gcc

INSTALL = /usr/local/bin/install -c
RANLIB = ranlib

DEFS = -DHAVE_CONFIG_H
CPPFLAGS = -I.. -I/usr/local/include  
LIBS = -ldl  -lsocket -lnsl 

CFLAGS = -g -O2
LDFLAGS = -L/usr/local/lib -R/usr/local/lib 

SHELL = /bin/sh
MAKEDEPEND = @MAKEDEPEND@

prefix = /usr/local
exec_prefix = ${prefix}
cyrus_prefix = /usr/cyrus

HDRS = $(srcdir)/acl.h $(srcdir)/assert.h $(srcdir)/auth.h \
	$(srcdir)/bsearch.h $(srcdir)/charset.h $(srcdir)/glob.h \
	$(srcdir)/gmtoff.h $(srcdir)/imclient.h $(srcdir)/imparse.h \
	$(srcdir)/lock.h $(srcdir)/map.h $(srcdir)/mkgmtime.h \
	$(srcdir)/nonblock.h $(srcdir)/parseaddr.h $(srcdir)/prot.h \
	$(srcdir)/retry.h $(srcdir)/sysexits.h \
	$(srcdir)/util.h $(srcdir)/xmalloc.h $(srcdir)/imapurl.h

OBJS = acl.o assert.o bsearch.o charset.o glob.o retry.o util.o \
	mkgmtime.o prot.o parseaddr.o imclient.o imparse.o xmalloc.o \
	chartable.o imapurl.o nonblock_fcntl.o lock_fcntl.o \
	gmtoff_gmtime.o map_shared.o $(ACL) $(AUTH) \
	

all: libcyrus.a

install:
	$(INSTALL) -m 644 libcyrus.a $(DESTDIR)$(exec_prefix)/lib
	$(RANLIB) $(DESTDIR)$(exec_prefix)/lib/libcyrus.a
	for file in $(HDRS); \
	do \
		$(INSTALL) -m 644 $$file $(DESTDIR)$(prefix)/include/cyrus || exit 1; \
	done

.c.o:
	$(CC) -c $(CPPFLAGS) $(DEFS) -I$(srcdir) -I. $(CFLAGS) \
	$<

libcyrus.a: $(OBJS)
	rm -f libcyrus.a
	ar cr libcyrus.a $(OBJS)
	$(RANLIB) libcyrus.a

chartable.c: mkchartable 
	@echo "### Building chartables..."
	rm -f chartable.c
	./mkchartable \
	 -m $(srcdir)/charset/unifix.txt	\
	 -m $(srcdir)/charset/unidata2.txt \
	 $(srcdir)/charset/*.t \
	 > chartable.c \
	 || (rm -f chartable.c && exit 1)
	@echo "### Done building chartables."
#	./mkchartable -m $(srcdir)/charset/unicode.map $(srcdir)/charset/*.t >x-chartables.h
#	mv x-chartables.h chartables.h

mkchartable: mkchartable.o xmalloc.o assert.o
	$(CC) $(LDFLAGS) -o mkchartable mkchartable.o xmalloc.o assert.o

clean:
	rm -f *.o *.a chartable.c Makefile.bak mkchartable makedepend.log

distclean: clean
	rm -f Makefile

depend:
	${MAKEDEPEND} $(CPPFLAGS) $(DEFS) -I$(srcdir) $(CFLAGS) *.c $(srcdir)/*.c 1>makedepend.log 2>&1

# DO NOT DELETE THIS LINE -- make depend depends on it.
