# A makefile for the stuff now in libg++/etc/ADT-examples

srcdir = .

CC=gg
CXX=gcc
CPPFLAGS = -I. -I/d/libgp271/g++-include
LIBS = /d/libgp271/lib/libg++.a /d/libgp271/lib/libstdc++.a

TEST_PROGS = generic-q search keyhash tsort tsortinp genkey patricia kmp

#### package, host, target, and site dependent Makefile fragments come in here.
##

check: $(TEST_PROGS)
	-./generic-q < $(srcdir)/generic-q.cc
	-./tsortinp 20 | ./tsort
	-./keyhash < $(srcdir)/keyhash.cc
	-./search 1000
	-./genkey 1000 200 > input
	-./patricia ./input ./input | grep -v "is found"

#	-./dhrystone

run_tests: check

generic-q: generic-q.o
	$(CXX)  generic-q.o -o $@ $(LIBS)
	fixstk 32k $@

tsort: tsortinp tsort.o
	$(CXX)  tsort.o -o $@ $(LIBS)
	fixstk 32k $@

tsortinp: tsortinp.o
	$(CXX)  tsortinp.o -o $@ $(LIBS)

keyhash: keyhash.o
	$(CXX)  keyhash.o -o $@ $(LIBS)

search: search.o
	$(CXX)  search.o -o $@ $(LIBS)

genkey: genPatkey.o
	$(CXX)  genPatkey.o -o $@ $(LIBS)
   
Patricia.o: $(srcdir)/Patricia.h
Patmain.o: $(srcdir)/Patricia.h 

patricia: Patmain.o Patricia.o
	$(CXX)  Patmain.o Patricia.o -o $@ $(LIBS)

kmp: kmp.o
	$(CXX)  kmp.o -o $@ $(LIBS)
