CFLAGS = $(CCOPTS) $(DEFS) -I. -I$(srcdir) -DUSE_AUTOCONF_H

##DOSBUILDTOP = ..\..\..
##DOSLIBNAME=..\gssapi.$(LIBEXT)
##DOSsrcdir = .
##DOS!include $(BUILDTOP)\config\windows.in

all:: $(OBJS)

ETSRCS= gssapi_err_generic.c
ETOBJS= gssapi_err_generic.$(OBJEXT)
ETHDRS= gssapi_err_generic.h

gssapi_err_generic.$(OBJEXT): gssapi_err_generic.c

gssapi_err_generic.h: gssapi_err_generic.et

gssapi_err_generic.c: gssapi_err_generic.et

#if HasHashLibrary
# UTIL_VALIDATE_SRC= $(srcdir)/util_validate.c
# UTIL_VALIDATE_OBJ= util_validate.$(OBJEXT)
#else
UTIL_VALIDATE_SRC= $(srcdir)/utl_nohash_validate.c
UTIL_VALIDATE_OBJ= utl_nohash_validate.$(OBJEXT)
#endif

CCSRCS = \
	$(srcdir)/disp_major_status.c \
	$(srcdir)/disp_com_err_status.c \
	$(srcdir)/gssapi_generic.c \
	$(srcdir)/oid_ops.c \
	$(srcdir)/rel_buffer.c \
	$(srcdir)/rel_oid_set.c \
	$(srcdir)/util_buffer.c \
	$(srcdir)/util_canonhost.c \
	$(srcdir)/util_dup.c \
	$(srcdir)/util_oid.c \
	$(srcdir)/util_token.c \
	$(UTIL_VALIDATE_SRC)

CCOBJS = \
	disp_major_status.$(OBJEXT) \
	disp_com_err_status.$(OBJEXT) \
	gssapi_generic.$(OBJEXT) \
	oid_ops.$(OBJEXT) \
	rel_buffer.$(OBJEXT) \
	rel_oid_set.$(OBJEXT) \
	util_buffer.$(OBJEXT) \
	util_canonhost.$(OBJEXT) \
	util_dup.$(OBJEXT) \
	util_oid.$(OBJEXT) \
	util_token.$(OBJEXT) \
	$(UTIL_VALIDATE_OBJ)


EHDRDIR= $(BUILDTOP)$(S)include$(S)gssapi
EXPORTED_HEADERS= gssapi.h gssapi_generic.h

SRCS= $(ETSRCS) $(CCSRCS)
OBJS= $(ETOBJS) $(CCOBJS)
HDRS= $(ETHDRS)

all:: all-$(WHAT) $(SRCS) $(HDRS) includes $(OBJS)

all-unix::

all-mac::

all-windows::
	if not exist $(EHDRDIR)\nul mkdir $(EHDRDIR)
	copy gssapi.h $(EHDRDIR)
	copy gssapi_generic.h $(EHDRDIR)

unixmac: $(SRCS) $(HDRS) includes

clean:: clean-$(WHAT)

clean-unix::
	$(RM) $(ETHDRS) $(ETSRCS)

clean-mac::
	$(RM) $(ETHDRS) $(ETSRCS)

clean-windows::
	$(RM) $(EHDRDIR)\gssapi.h $(EHDRDIR)\gssapi_generic.h
	if exist $(EHDRDIR)\nul rmdir $(EHDRDIR)

# Krb5InstallHeaders($(EXPORTED_HEADERS), $(KRB5_INCDIR)/krb5)
install::
	@set -x; for f in $(EXPORTED_HEADERS) ; \
	do $(INSTALL_DATA) $(srcdir)$(S)$$f	\
		$(DESTDIR)$(KRB5_INCDIR)$(S)gssapi$(S)$$f ; \
	done

depend:: $(ETSRCS)

includes::
