#
# $Id: Makefile.in,v 1.25 1999/11/15 10:20:48 assar Exp $
#

SHELL = /bin/sh

srcdir = @srcdir@
VPATH = @srcdir@

CC = @CC@
LINK = @LINK@
AR = ar
RANLIB = @RANLIB@
DEFS = @DEFS@
CFLAGS = @CFLAGS@ $(WFLAGS)
WFLAGS = @WFLAGS@

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

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

PICFLAGS = @REAL_PICFLAGS@
LDSHARED = @LDSHARED@
SHLIBEXT = @REAL_SHLIBEXT@
LD_FLAGS = @REAL_LD_FLAGS@

LIB_res_search = @LIB_res_search@
LIB_dn_expand = @LIB_dn_expand@
 
@lib_deps_yes@LIB_DEPS = -L../../kafs -L../../krb -L../../des \
@lib_deps_yes@	   -lkafs -lkrb -ldes \
@lib_deps_yes@     $(LIB_res_search) $(LIB_dn_expand) -lpam -lc
@lib_deps_no@LIB_DEPS =

LIBNAME = pam_krb4
LIB = $(LIBNAME).$(SHLIBEXT)

SOURCES = pam.c

OBJECTS = pam.o

all: $(LIB)

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

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

install: all
	$(MKINSTALLDIRS) $(DESTDIR)$(libdir)
	-if test "$(LIB)" != ""; then \
	  $(INSTALL_DATA) -m 0555 $(LIB) $(DESTDIR)$(libdir)/$(LIB) ; \
	fi

uninstall:
	-if test "$(LIB)" != ""; then \
	  rm -f $(DESTDIR)$(libdir)/$(LIB) ; \
	fi

TAGS: $(SOURCES)
	etags $(SOURCES)

check:

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

mostlyclean: clean

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

realclean: distclean
	rm -f TAGS

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

$(LIB): $(OBJECTS)
	rm -f $@
	$(LDSHARED) -o $@ $(OBJECTS) $(LD_FLAGS) $(LIB_DEPS)
#	$(LINK) -shared -Wl,-x -o $(LIB) $(OBJECTS)  ../../kafs/libkafs.a ../../krb/libkrb.a ../../des/libdes.a

.PHONY: all Wall install uninstall check clean mostlyclean distclean realclean
