CFLAGS = $(CCOPTS) $(DEFS) $(LOCALINCLUDES)

COMERRLIB=$(TOPLIBD)/libcom_err.a

all:: krb5_encode_test krb5_decode_test trval

LOCALINCLUDES = -I$(srcdir)/../../lib/krb5/asn.1

ENCOBJS = krb5_encode_test.o ktest.o ktest_equal.o utility.o trval.o

krb5_encode_test: $(ENCOBJS) $(DEPLIBS)
	$(LD) $(LDFLAGS) $(LDARGS) -o krb5_encode_test $(ENCOBJS) $(LIBS)

DECOBJS = krb5_decode_test.o ktest.o ktest_equal.o utility.o

krb5_decode_test: $(DECOBJS) $(DEPLIBS)
	$(LD) $(LDFLAGS) $(LDARGS) -o krb5_decode_test $(DECOBJS) $(LIBS)

trval: $(srcdir)/trval.c
	$(CC) -o trval $(CFLAGS) -DSTANDALONE $(srcdir)/trval.c

check:: krb5_decode_test krb5_encode_test
	LD_LIBRARY_PATH=$(TOPLIBD) ./krb5_decode_test
	$(RM) test.out
	LD_LIBRARY_PATH=$(TOPLIBD) ./krb5_encode_test > test.out
	cmp test.out $(srcdir)/reference_encode.out
	LD_LIBRARY_PATH=$(TOPLIBD) ./krb5_encode_test -t > test.out
	cmp test.out $(srcdir)/trval_reference.out
	$(RM) test.out	

install::

clean::
	rm -f *~ *.o krb5_encode_test krb5_decode_test test.out


################ Dependencies ################
krb5_decode_test.o: ktest.h utility.h ktest_equal.h debug.h
krb5_encode_test.o: utility.h ktest.h debug.h
ktest.o: ktest.h utility.h
ktest_equal.o: ktest_equal.h
#utility.o: utility.h
#utility.h: krbasn1.h asn1buf.h
##############################################

