# Makefile for g++ library test files

# Copyright (C) 1988 Free Software Foundation
#   written by Doug Lea (dl@rocky.oswego.edu)

# This file is part of GNU CC.

# GNU CC is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY.  No author or distributor
# accepts responsibility to anyone for the consequences of using it
# or for whether it serves any particular purpose or works at all,
# unless he says so in writing.  Refer to the GNU CC General Public
# License for full details.

# Everyone is granted permission to copy, modify and redistribute
# GNU CC, but only under the conditions described in the
# GNU CC General Public License.   A copy of this license is
# supposed to have been given to you along with GNU CC so you
# can know your rights and responsibilities.  It should be in a
# file named COPYING.  Among other things, the copyright notice
# and this notice must be preserved on all copies.


GXX = g++

# g++ compliation flags:
# the fchar-charconst flag is mandatory for some stream ops to work sensibly

GFLAGS= -g -O -fchar-charconst 


# compilation notes:
# ONLY the following g++ warnings are expected to appear:
#
# 1. In test5a.cc and test5b.cc, warnings about lazy prototyping
#    
# 2. Many warnings about vector delete
#
# 3. Many warnings about functions returning const values

# test files
TSRCS =  test1.cc test2.cc test3.cc test4.cc test5a.cc test5b.cc test6.cc \
 test7.cc test8.cc test9.cc test10.cc test11.cc test12.cc test13.cc \
 test14.cc test15.cc test16.cc test17.cc test18.cc test19.cc test20.cc

TOUTS =  test1 test2 test3 test4 test5a test5b test6 test7 test8 test9 \
  test10 test11 test12 test13 test14 test15 test16 test17 test18 test19 \
  test20

# all g++ files should have extension .cc
.SUFFIXES: .cc
.cc.o:
	$(GXX) $(GFLAGS) -c  $<

tests: $(TOUTS)

test1:  test1.o
	$(GXX) test1.o  -o test1

test2:  test2.o
	$(GXX) test2.o  -o test2 -lg++ -lm

test3:  test3.o
	$(GXX) test3.o  -o test3 -lg++ -lm

test4:  test4.o
	$(GXX) test4.o  -o test4 -lg++ -lm

test5a:  test5a.o
	$(GXX) test5a.o  -o test5a -lg++ -lm

test5b:   test5b.o
	$(GXX) test5b.o  -o test5b -lg++ -lm

test6:  test6.o
	$(GXX) test6.o  -o test6 -lg++ -lm

test7:  test7.o
	$(GXX) test7.o  -o test7 -lg++ -lm

test8:  test8.o
	$(GXX) test8.o  -o test8 -lg++ -lm

test9:  test9.o
	$(GXX) test9.o  -o test9 -lg++ -lm

test10:  test10.o
	$(GXX) test10.o  -o test10 -lg++ -lm

test11:  intList.o test11.o
	$(GXX) test11.o  intList.o -o test11 -lg++ -lm


test12:  intintOLSet.o test12.o
	$(GXX) test12.o  intintOLSet.o -o test12 -lg++ -lm

test13:  intSLList.o intDLList.o test13.o
	$(GXX) test13.o  intSLList.o intDLList.o  -o test13 -lg++ -lm

test14: intVec.o intAVec.o intVStack.o intVQueue.o test14.o
	$(GXX) intVec.o intAVec.o intVStack.o intVQueue.o test14.o -o test14 -lg++ -lm

test15: intPairingHeap.o test15.o
	$(GXX) intPairingHeap.o test15.o -o test15 -lg++ -lm

test16:  intintCHashSet.o intintCHashAssoc.o test16.o
	$(GXX) test16.o  intintCHashSet.o intintCHashAssoc.o -o test16 -lg++ -lm

test17:  intintVHashSet.o intintVHashAssoc.o test17.o
	$(GXX) test17.o  intintVHashSet.o intintVHashAssoc.o -o test17 -lg++ -lm


test18:  intintBSTSet.o intintBSTAssoc.o test18.o
	$(GXX) test18.o  intintBSTSet.o intintBSTAssoc.o -o test18 -lg++ -lm

test19:  intintOVSet.o test19.o
	$(GXX) test19.o  intintOVSet.o -o test19 -lg++ -lm

test20:  intintAVLSet.o  intintAVLAssoc.o test20.o
	$(GXX) test20.o  intintAVLSet.o intintAVLAssoc.o -o test20 -lg++ -lm



intintOLSet.cc: 
	genclass -2 int val int val OLSet

intintOVSet.cc: 
	genclass -2 int val int val OVSet

intList.cc: 
	genclass int val List

intSLList.cc: 
	genclass int val SLList

intDLList.cc: 
	genclass int val DLList

intVec.cc:
	genclass int val Vec

intAVec.cc:
	genclass int val AVec

intVStack.cc:
	genclass int val VStack

intVQueue.cc:
	genclass int val VQueue

intPairingHeap.cc:
	genclass int val PairingHeap

intintCHashSet.cc:
	genclass -2 int val int val CHashSet

intintCHashAssoc.cc:
	genclass -2 int val int val CHashAssoc

intintVHashSet.cc:
	genclass -2 int val int val VHashSet

intintVHashAssoc.cc:
	genclass -2 int val int val VHashAssoc

intintBSTSet.cc:
	genclass -2 int val int val BSTSet

intintBSTAssoc.cc:
	genclass -2 int val int val BSTAssoc


intintAVLSet.cc:
	genclass -2 int val int val AVLSet

intintAVLAssoc.cc:
	genclass -2 int val int val AVLAssoc


clean:
	rm -f *.o core $(TOUTS) plot.out int*

