#
#
# GCC Makefile for splash and tests
#
#

CC=gcc-2.6.3
CCFLAGS= -g -fno-implicit-templates
.c.o:
	$(CC) -c $(CCFLAGS) $*.c

.cc.o:
	$(CC) $(CCFLAGS) -c $*.cc

spltest: tsplash.o regex.o
	$(CC) $(CCFLAGS) -c -DTEST spltest.cc
	$(CC) $(CCFLAGS) -o spltest spltest.o tsplash.o regex.o -lg++

slicetst: slicetst.cc tsplash.o regex.o
	$(CC) -c $(CCFLAGS) -DTEST slicetst.cc
	$(CC) $(CCFLAGS) -o slicetst slicetst.o tsplash.o regex.o -lg++

tsplash.o: splash.cc regexp.h splash.h
	$(CC) -c $(CCFLAGS) -DTEST splash.cc
	mv splash.o tsplash.o

splash.o: regexp.h splash.h

regex.o: regex.c
	$(CC) $(CCFLAGS) -c regex.c

test: spltest slicetst
	spltest > x1
	diff x1 splash.v
	slicetst > x2
	diff x2 slicetst.v

