#
# $Id: Makefile.in,v 1.17 2000/01/23 09:44:10 lha Exp $
#

# This should really be set from configure
SHELL = /bin/sh

srcdir = @srcdir@
VPATH = @srcdir@

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

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

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

PICFLAGS = # @PICFLAGS@

LIBPREFIX = lib
#@LIBPREFIX@
LIBNAME = $(LIBPREFIX)rxkad
#LIBEXT = @LIBEXT@ Always build archive library!
LIBEXT = a
SHLIBEXT = @SHLIBEXT@
LDSHARED = @LDSHARED@
LIB = $(LIBNAME).$(LIBEXT)

SOURCES = rxk_locl.c rxk_clnt.c rxk_serv.c rxk_crpt.c rxk_info.c osi_alloc.c compat.c

OBJECTS = rxk_locl.o rxk_clnt.o rxk_serv.o rxk_crpt.o rxk_info.o osi_alloc.o compat.o

all: $(LIB)

install: all
	$(MKINSTALLDIRS) $(DESTDIR)$(includedir)/rx
	$(INSTALL_DATA) $(srcdir)/rxkad.h $(DESTDIR)$(includedir)/rx/rxkad.h
	$(MKINSTALLDIRS) $(DESTDIR)$(libdir)
	$(INSTALL_DATA) $(LIB) $(DESTDIR)$(libdir)/$(LIB)

uninstall:
	rm -f $(DESTDIR)$(includedir)/rx/rxkad.h
	rm -f $(DESTDIR)$(libdir)/$(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)/../include -I$(srcdir) -I$(srcdir)/..  $(CPPFLAGS) $(CFLAGS) $(PICFLAGS) @KRB4_INC_FLAGS@ $<

fc_test: rxk_crpt.c
	$(CC) -DTEST -o $@ $(DEFS) -I../include -I$(srcdir)/.. -I$(srcdir)/../lwp -I$(srcdir)/../include $(CPPFLAGS) $(CFLAGS) $(PICFLAGS) @KRB4_INC_FLAGS@ $(VPATH)/rxk_crpt.c


check:

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

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)

TAGS: $(SOURCES)
	etags $(SOURCES)

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

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