#      Copyright 1993, Center for Computer Vision and Visualization,
#      University of Florida.  All rights reserved.
#
# this is a GNUmakefile.  It must be processed with GNU make.
#

TARGET_ARCH=
TOP=../..
# You should define the make variables LOBJS and HEADERS before the
# include directive.  LOBJS is a list of Library OBJects that belong
# in ../../lib/libiac++.a.  HEADERS is a list of public header files 
# that belong in iac++/include -- they
#

LOBJS= # Cell.o Deque.o List.o

HEADERS= Cell.h Cell.c \
	Deque.h Deque.c \
	List.h List.c \
	Stack.h Stack.c

DISTFILES= GNUmakefile ${HEADERS}

XTRAFLAGS= -pg
XTRACCFLAGS= -pta -ptn


include ${TOP}/src/gnumake.templ


# The above include of gnumake.templ intoduces a few targets 
# that everyone will use
#
# all: install the header files, build the LOBJS and add them
# to the library
#
# ?? headers-force: force the header files to be copied into include
#
# headers: used by all to install the header files when changed
#
# lib: used by all to add LOBJS to ../../lib/libiac++.a.  libiac++.a is
# your own personal copy of the system libiac++.a that only contains the
# parts you are working on.  ../../librelease.a is a pointer to the
# shared version of /cis/vision/src/iac++/lib/libiac++.a -- rule of thumb:
# NEVER MODIFIY librelease.a -- modify libiac++.a instead.
#
# reallib: this puts your LOBJS into the real libiac++ so that
# everyone else can use them.  Make sure they work first.
#
# clean:: removes all .o and ~ files.  You may define additional
# clean targets to remove other files that you may have generated.
#
# spotless:: the same as clean, but more so.  It should remove
# binaries.  You should define additional spotless targets that
# remove your test binaries and other files that aren't deleted
# by clean.

##############################################################################
#	Define Utility targets
##############################################################################


##############################################################################
#	Define targets for the current implementation of Deques
##############################################################################

lib:

Cell.o:		Cell.c	Cell.h

Deque.o:	Deque.c	Deque.h Cell.o

List.o:		List.c  List.h  Deque.o

#Stack.o:	Stack.c Stack.h Deque.o

##############################################################################
#	Test program specific targets and dependency infomation
##############################################################################

IMPLEMENTATION_TESTS = \
	test-cell.c \
	test-deque.c \
	test-list.c #\
#	test-stack.c

${IMPLEMENTATION_TESTS} : Cell.h Cell.c \
	Deque.h Deque.c \
	List.h  List.c #\
#	Stack.h Stack.c

test-cell:	test-cell.c  Cell.o
test-deque:	test-deque.c Deque.o
test-list:	test-list.c  List.o
#test-stack:	test-stack.c Stack.o


test%: test%.o lib
	${LINK.cc} -o $@ $< ${LDLIBS}

clean::
	rm -f ${TESTS} ${LOBJS}
