TOPDIR = ../..
include $(TOPDIR)/Makefile.vars.config

LIBNAME = dtype++
include $(CONFIG)/Makefile.lib.vars

SHLIBEXTRA = newskit/syslog newskit/utils newskit/dsys++ gmp m

GENCLASS = dt_im.Vec dt_im.Set dt_im.AVLSet dt_im.dt_im.AVLMap dt_im.dt_im.Map

CLASSES=\
dt_alloc \
dt_im dt_heap dt_null dt_bool dt_int dt_float dt_pair dt_packet dt_string dt_symbol dt_error \
dt_compound dt_vector \
dt_set dt_map \
dt_voidptr \
dt_env dt_func dt_cfunc dt_sfunc \
dt_eval dtype \
dt_mp_int dt_mp_rat dt_number

EXTRAHDRS=\
dt_types.hh dtype++.hh dtypeparse.hh parser_defs.hh defs.hh \
dt_utils.hh dt_im.defs.h dt_globals.hh

CXXFILES=\
dt_globals dt_utils dt_globals dtypeparse dtypelex

include $(CONFIG)/Makefile.targets.lib

dt_im.Vec.cc dt_im.Vec.h:
	genclass dt_im val Vec 

dt_im.Set.cc dt_im.Set.h:
	genclass dt_im val Set 

dt_im.AVLSet.cc dt_im.AVLSet.h:
	genclass dt_im val AVLSet

dt_im.dt_im.Map.cc dt_im.dt_im.Map.h:
	genclass -2 dt_im val dt_im val Map

dt_im.dt_im.AVLMap.cc dt_im.dt_im.AVLMap.h:
	genclass -2 dt_im val dt_im val AVLMap

dtypelex.cc: dtype.lex
	flex -t -8 -I -Pdtype_parse_ $^ > $@

dtypeparse.cc dtypeparse.hh: dtype.parse
	bison -t -d -p 'dtype_parse_' -b dtypeparse $^
	mv dtypeparse.tab.c dtypeparse.cc
	mv dtypeparse.tab.h dtypeparse.hh
