#
# Makefile : BASEDIR/tests Makefile for utilfuncs package. It builds the
#            specified tests in current directory, when invoked via BASEDIR
#            Makefile.
#
# Copyright (C) 2006, Sandeep Kumar <shimple0@yahoo.com>
#                     Homepage : http://sandeepkumar.fortunecity.com/
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 2 of the License, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
#

SRCS := countalpha.c ffoz.c uint16.c
TESTS := test-countalpha$(EXEEXT) test-ffoz$(EXEEXT) test-uint16$(EXEEXT)

VPATH := $(BUILDDIR)

# Define the macro PROCESS_USER_INPUT during compilation, if you want tests
# to work with user input also.
CFLAGS := -D PROCESS_USER_INPUT 

%$(EXEEXT) : %.c $(UTILLIB)
	$(CC) $(CFLAGS) -I $(BASEDIR)/include -o $(BUILDDIR)/$@ $+

tests : $(TESTS)

runtests : $(TESTS)
	@for prog in $(TESTS) ; do \
		echo "" ; \
		echo "Make : Running $$prog ..." ; \
		echo "" ; \
		$(BUILDDIR)/$$prog ; \
	done
