#
# $Id: Makefile.in,v 1.26 1997/09/25 14:01:38 joda Exp $
#

SHELL = /bin/sh

srcdir = @srcdir@
VPATH = @srcdir@

CC = @CC@
AR = ar
RANLIB = @RANLIB@
DEFS = @DEFS@
CFLAGS = @CFLAGS@

INSTALL = @INSTALL@
INSTALL_DATA	= @INSTALL_DATA@
MKINSTALLDIRS = @top_srcdir@/mkinstalldirs

prefix = @prefix@
exec_prefix = @exec_prefix@
libdir = @libdir@

PICFLAGS = @PICFLAGS@
 
LIBNAME = $(LIBPREFIX)kdb
LIBEXT = @LIBEXT@
SHLIBEXT = @SHLIBEXT@
LIBPREFIX = @LIBPREFIX@
LDSHARED = @LDSHARED@
LIB = $(LIBNAME).$(LIBEXT)

SOURCES = krb_cache.c krb_kdb_utils.c copykey.c krb_lib.c \
	krb_dbm.c print_princ.c

OBJECTS = krb_cache.o krb_kdb_utils.o copykey.o krb_lib.o \
	krb_dbm.o print_princ.o

all: $(LIB)

Wall:
		make CFLAGS="-g -Wall -Wno-comment -Wmissing-prototypes -Wmissing-declarations -D__USE_FIXED_PROTOTYPES__"

.c.o:
	$(CC) -c $(CPPFLAGS) $(DEFS) -I../../include -I$(srcdir) $(CFLAGS) $(PICFLAGS) $<

install: all
	$(MKINSTALLDIRS) $(libdir)
	$(INSTALL_DATA) -m 0555 $(LIB) $(libdir)

uninstall:
	rm -f $(libdir)/$(LIB)

TAGS: $(SOURCES)
	etags $(SOURCES)

check:

clean:
	rm -f $(LIB) *.o *.a

mostlyclean: clean

distclean: clean
	rm -f Makefile *.tab.c *~

realclean: distclean
	rm -f TAGS

dist: $(DISTFILES)
	for file in $(DISTFILES); do \
	  ln $$file ../`cat ../.fname`/lib \
	    || cp -p $$file ../`cat ../.fname`/lib; \
	done

$(LIBNAME).a: $(OBJECTS)
	rm -f $@
	$(AR) cr $@ $(OBJECTS)
	-$(RANLIB) $@

$(LIBNAME).$(SHLIBEXT): $(OBJECTS)
	rm -f $@
	$(LDSHARED) -o $@ $(OBJECTS)

$(OBJECTS): ../../include/config.h
