### make TARGETS:

### LONG - make performance demo
### DBSH - make rtsh version including Tcl constraints
### DB_TAR - create tar archive

############################################################################

include ${GOOD_ROOT_DIR}/YART/src/Makefile

TAR = $(HOME)/tar/delta.tar

DB_SRCS = deltabl.C constr.C list.C 
DB_HDRS = deltabl.h constr.h list.h 
DB_OBJS = $(DB_SRCS:.C=.o)
DEP_DB_OBJS = $(DB_SRCS:.C=.Cdp)

DB_LIBS = libdeltabl.a ${LIBS}-L$(TCLTK)/lib -ltcl $(SP_LIBS) -lm

############################################################################

DB_LIB: libdeltabl.a
libdeltabl.a: $(DB_OBJS) $(DB_SRCS)
	rm -f libdeltabl.a
	ar q libdeltabl.a $(DB_OBJS)
	$(RANLIB) libdeltabl.a

ALL_FILES = ${DB_SRCS} ${DB_HDRS}\
	longtest.C longtest.tcl sample.tcl dbsh.C README.DBL INSTALL.DBL Makefile 

############################################################################

LONG: DB_LIB longtest.o
# the tests and benchmarks of a variable-type containing LONGs
	rm -f dbtest
	$(CC) -o dbtest longtest.o ${DB_LIBS}
	dbtest

############################################################################

DBSH: DB_LIB dbsh.o
# an interpretative constraint implementation
	rm -f dbsh
	$(CC) -o dbsh dbsh.o ${DB_LIBS}

############################################################################

DB_TAR: $(ALL_FILES) 
	rm -f $(TAR).gz
	tar cf $(TAR) $(ALL_FILES)	
	gzip $(TAR)
	mv $(TAR).gz $(HOME)/tar/deltabl.tz
	

