###############################################################
# Makefile for SQUID's testsuite
# CVS $Id: Makefile.in,v 1.4 2002/03/29 22:09:38 eddy Exp $
#
# Note: The autoconf variables in this file must be coordinated
#       with HMMER, if you change them, because HMMER will 
#       create a Makefile from this Makefile.in using its own
#       configure script, not SQUID's.
#
###########
# @LICENSE@
###########

SHELL  = /bin/sh
CC     = @CC@
CFLAGS = @CFLAGS@
MDEFS  = @MDEFS@ @DEFS@
LIBS   = -lsquid @LIBS@ -lm

TESTPROGS = iospeed rndspeed

X-BASE = x-base-afetch\
	x-base-alistat\
	x-base-seqstat\
	x-base-sfetch\
	x-base-shuffle\
	x-base-sindex\
	x-base-sreformat

BUGLIST = bug-1-sfetch-paths

################################################################
# Targets for building the test programs.
#
all: sqdconfig $(TESTPROGS) 

$(TESTPROGS): @EXEC_DEPENDENCY@ 
	$(CC) $(CFLAGS) -L../ -I../ $(MDEFS) -o $@ $@_main.o $(LIBS)

sqdconfig: @EXEC_DEPENDENCY@ 
	$(CC) $(CFLAGS) -L../ -I../ $(MDEFS) -o $@ $@_main.o $(LIBS)

.c.o:
	$(CC) $(CFLAGS) $(MDEFS) -L../ -I../ -c $<		

################################################################


################################################################
# 'make check' actually runs the tests.
#
check: $(TESTPROGS) sqdconfig
	@for testprog in $(TESTPROGS); do\
	   if ./$$testprog; then\
	      echo $$testprog: ok;\
	   else\
	      echo $$testprog: FAILED;\
	   fi;\
        done
	@for xprog in $(X-BASE); do\
	   ./$$xprog;\
	done        
	@for bugprog in $(BUGLIST); do\
	   ./$$bugprog;\
	done        
  
#######
## Miscellaneous
#######

clean:
	-rm -f *.o *~ Makefile.bak core $(TESTPROGS) TAGS gmon.out sqdconfig

distclean:
	make clean
	-rm -f Makefile

TAGS:
	etags -t *.c *.h Makefile.in


