#
# 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 libiac++.a.  HEADERS is a list of public header files that belong
# in iac++/include.

LOBJS= ValueSet.o VS_Specials.o
HEADERS= ValueSet.h
REGTESTS= ${basename ${wildcard test2??.C}}
CLOSUREOBJS=closure.o

include ${TOP}/src/gnumake.templ

lib: closure

#WORKLIB= ${TOP}/lib/libiacc++.a

#lib: ${LOBJS}
#	ar r ${WORKLIB} ${LOBJS}
#	ranlib ${WORKLIB}
#	touch lib

# Testing:
#LDLIBS= -L${TOP}/lib/ -liac++ -lm /usr/lib/debug/malloc.o /usr/lib/debug/mallocmap.o

test%.C: test.h

test%.o: test%.C test.h

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

create:
	for x in test2??.C ; \
		do \
			y=`basename $$x .C` ;    \
			gnumake $$y ;            \
			$$y 1>$$y.expected 2>&1; \
			rm -f $$y ;              \
		done

test:
	for x in test2??.C; \
		do \
			y=`basename $$x .C` ;     \
			gnumake $$y ;             \
			$$y 1>$$y.out 2>&1;       \
			cmp $$y.expected $$y.out; \
			rm -f $$y ;		  \
		done

compare:
	for x in test2??.expected; \
	do \
		y=`basename $$x .expected`; \
		cmp $$x $y.out;             \
	done

# sample program target:
# test1 only needs test1.o and the library.  The defaults will
# build this without a rule
#
#all: test1 test2
#
#T2OBJS= test2.o frob.o
#test2: ${T2OBJS}
#	${CCC} -o $@ ${CCFLAGS} ${CPPFLAGS} ${LDFLAGS} ${T2OBJS} ${LDLIBS}

# the gnumake.templ has 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 the libwork.a.  libwork.a is
# your own personal copy of the libiac++.a that only contains the
# parts you are working on.
#
# 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.



# dependencies
VS_Specials.o : VS_Specials.c ValueSet.h ../../include/ia.h ../../include/FloatPoint.h \
  ../../include/IntPoint.h 
ValueSet.o : ValueSet.c ValueSet.h ../../include/ia.h 
closure.o : closure.c ../../include/FloatPoint.h ../../include/ia.h ../../include/IntPoint.h \
  ValueSet.h 
generic-tests.o : generic-tests.c ValueSet.h ../../include/ia.h generic-tests.h 
test001.o : test001.c ValueSet.h ../../include/ia.h valueset-utils.h 
test004.o : test004.c ValueSet.h ../../include/ia.h generic-tests.h valueset-utils.h 
valueset-utils.o : valueset-utils.c ValueSet.h ../../include/ia.h 
