# Build rules for the OpenAFS test suite.

srcdir=@srcdir@
abs_top_srcdir=@abs_top_srcdir@
abs_top_builddir=@abs_top_builddir@
include @TOP_OBJDIR@/src/config/Makefile.config
include @TOP_OBJDIR@/src/config/Makefile.pthread

MODULE_CFLAGS = -DSOURCE='"$(abs_top_srcdir)/tests"' \
	-DBUILD='"$(abs_top_builddir)/tests"'

SUBDIRS = tap common auth util cmd volser opr

all: runtests
	@for A in $(SUBDIRS); do cd $$A && $(MAKE) $@ && cd .. || exit 1; done

runtests: runtests.o
	$(AFS_LDRULE) runtests.o

check test tests: runtests
	@for A in $(SUBDIRS); do cd $$A && $(MAKE) $@ && cd .. || exit 1; done
	LD_LIBRARY_PATH=@TOP_OBJDIR@/lib \
	    ./runtests $(abs_top_srcdir)/tests/TESTS

install:

clean distclean:
	@for A in $(SUBDIRS); do cd $$A && $(MAKE) $@ && cd .. || exit 1; done
	$(RM) -f *.o core runtests
