# $Id: Makefile.in,v 1.47 1997/12/08 14:43:03 joda Exp $

srcdir		= @srcdir@
VPATH		= @srcdir@

SHELL		= /bin/sh

CC		= @CC@
DEFS		= @DEFS@ -DHOST=\"@CANONICAL_HOST@\"
CFLAGS		= @CFLAGS@
LD_FLAGS	= @LD_FLAGS@

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

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

HAVE_ERR_H	= @ac_cv_header_err_h@

@SET_MAKE@

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

HEADERS = \
	acl.h com_err.h des.h error.h kadm.h kafs.h kdc.h \
	klog.h krb.h krb-protos.h krb-archaeology.h krb_db.h \
	ktypes.h otp.h prot.h sl.h

CLEAN_FILES = roken.h krb_err.h kadm_err.h

BITS_OBJECTS = bits.o

SOURCES = bits.c

LOCL_HEADERS = base64.h roken-common.h protos.h resolve.h xdbm.h krb_log.h getarg.h

MAYBE_HEADERS = err.h

SUBDIRS		= sys

all: stamp-headers
	for i in $(SUBDIRS); \
	do (cd $$i && $(MAKE) $(MFLAGS) all); done

Wall:
	$(MAKE) CFLAGS="-g -Wall -Wno-comment -Wmissing-prototypes -Wmissing-declarations -D__USE_FIXED_PROTOTYPES__"

install:
	$(MKINSTALLDIRS) $(includedir)
	for x in $(HEADERS); \
		do $(INSTALL_DATA) $$x $(includedir)/$$x; done
	-if test "$(HAVE_ERR_H)" != yes; then \
	  $(INSTALL_DATA) err.h $(includedir)/err.h; \
	fi
	for i in $(SUBDIRS); \
	do (cd $$i && $(MAKE) $(MFLAGS) install); done

uninstall:
	for x in $(HEADERS); do \
	  rm -f $(includedir)/$$x; \
	done
	-if test "$(HAVE_ERR_H)" != yes; then \
	  rm -f $(includedir)/err.h; \
	fi
	for i in $(SUBDIRS); \
	do (cd $$i && $(MAKE) $(MFLAGS) uninstall); done

clean:
	rm -f $(HEADERS) $(LOCL_HEADERS) $(MAYBE_HEADERS) \
		$(CLEAN_FILES) *.o bits stamp-headers
	for i in $(SUBDIRS); \
	do (cd $$i && $(MAKE) $(MFLAGS) clean); done

mostlyclean:	clean

distclean:
	$(MAKE) clean
	rm -f config.h version.h version.h.in
	for i in $(SUBDIRS); \
	do (cd $$i && $(MAKE) $(MFLAGS) distclean); done
	rm -f Makefile config.status *~

realclean:
	for i in $(SUBDIRS); \
	do (cd $$i && $(MAKE) $(MFLAGS) realclean); done

err.h:
	if test "$(HAVE_ERR_H)" != yes; then \
	  $(LN_S) $(srcdir)/../lib/roken/err.h err.h; \
	fi || true

acl.h:
	$(LN_S) $(srcdir)/../lib/acl/acl.h .
com_err.h:
	$(LN_S) $(srcdir)/../lib/com_err/com_err.h .
des.h:
	$(LN_S) $(srcdir)/../lib/des/des.h .
error.h:
	$(LN_S) $(srcdir)/../lib/com_err/error.h .
kadm.h:
	$(LN_S) $(srcdir)/../lib/kadm/kadm.h .
kafs.h:
	$(LN_S) $(srcdir)/../lib/kafs/kafs.h .
kdc.h:
	$(LN_S) $(srcdir)/../lib/kdb/kdc.h .
klog.h:
	$(LN_S) $(srcdir)/../lib/krb/klog.h .
krb.h:
	$(LN_S) $(srcdir)/../lib/krb/krb.h .
krb-protos.h:
	$(LN_S) $(srcdir)/../lib/krb/krb-protos.h .
krb-archaeology.h:
	$(LN_S) $(srcdir)/../lib/krb/krb-archaeology.h .
resolve.h:
	$(LN_S) $(srcdir)/../lib/krb/resolve.h .
krb_db.h:
	$(LN_S) $(srcdir)/../lib/kdb/krb_db.h .
prot.h:
	$(LN_S) $(srcdir)/../lib/krb/prot.h .

protos.h:
	$(LN_S) $(srcdir)/protos.H protos.h
roken-common.h:
	$(LN_S) $(srcdir)/../lib/roken/roken-common.h .
base64.h:
	$(LN_S) $(srcdir)/../lib/roken/base64.h .
getarg.h:
	$(LN_S) $(srcdir)/../lib/roken/getarg.h .
xdbm.h:
	$(LN_S) $(srcdir)/../lib/roken/xdbm.h .
krb_log.h:
	$(LN_S) $(srcdir)/../lib/krb/krb_log.h .

otp.h:
	$(LN_S) $(srcdir)/../lib/otp/otp.h .

sl.h:
	$(LN_S) $(srcdir)/../lib/sl/sl.h .

bits$(EXECSUFFIX):	$(BITS_OBJECTS)
	$(CC) $(LD_FLAGS) $(LDFLAGS) -o $@ $(BITS_OBJECTS)

bits.o: bits.c

ktypes.h:	bits$(EXECSUFFIX)
	./bits$(EXECSUFFIX) $@

stamp-headers: Makefile
	$(MAKE) $(HEADERS) $(LOCL_HEADERS) $(MAYBE_HEADERS)
	touch stamp-headers
