LIBTRANS	= libtrans.a
LIBDIGIT	= libdigit.a
#  LIBATTS		= $(LIBDIR)/libdig_atts.a
LIBGEO		= ../../georef/libgeo.a

DIG_DRIVER		= $(ETC)/dig_drivers
#  specific driver we are compiling
DRIVER_DIR	= $(DIG_DRIVER)/numonics


COMPILE_DIGIT 	= $(LDFLAGS) -o  digit  $(OBJ) $(LIBDIGIT) $(VECTLIB) $(LIBTRANS) $(DIG_ATTLIB) $(DISPLAYLIB) $(RASTERLIB) $(VASKLIB) $(CURSES) $(MATHLIB) $(GISLIB)

EXTRA_CFLAGS	= $(DIGITFLAGS)


OBJ = \
	coll_pts.o \
	dig_curses.o \
	dig_dev.o \
	interface.o \
	setup_driver.o

GEO_REG = \
	dig_dev.o \
	geo_reg.o \
	interface.o \
	setup_driver.o

GEO_POINT = \
	dig_dev.o \
	geo_point.o \
	interface.o \
	setup_driver.o

all:  driver  geo.reg  geo.point

#
#  These directories will be made by this Gmake:
#  $(ETC)/dig_drivers  $(ETC)/dig_drivers/kurta
#
#  The 'none' driver is a NULL driver .
#
#  If a new digitizer driver is created a directory
#  $(ETC)/dig_drivers/driver_name will have to be created to store the driver
#  programs.  The directory MUST match the 'name' in the digitcap file.
#


driver: mk_driver_dev  mk_driver_dig

#  make directory that contains all the drivers and altek  in ../etc
$(DRIVER_DIR):
	mkdir $(DRIVER_DIR)



mk_driver_dev:
	@echo "";   echo	'  Compiling  NUMONICS  driver.';  echo ""
#  make sure libdigit.a is there
	$(GMAKE)  $(SRC)/mapdev/v.digit

mk_driver_dig: $(OBJ) $(DRIVER_DIR)
#  compile driver into the program
	$(CC) -o $(DRIVER_DIR)/digit $(COMPILE_DIGIT)

#  'digit'  must be owned by root and have mode 06775
#  chown  root digit
#  chmod   06775 digit


#    geo.reg goes to etc/dig_drivers/? and is called by geo.reg in etc

geo.reg: $(GEO_REG) $(DRIVER_DIR)
	echo "Creating Geo.Reg"
	$(CC) $(LDFLAGS) -o  $(DRIVER_DIR)/geo.reg  $(GEO_REG)  $(LIBGEO) $(LIBTRANS)  $(VECTLIB) $(VASKLIB) $(CURSES) $(MATHLIB) $(GISLIB)

#    geo.point goes to etc/dig_drivers/? and is called by geo.point in etc

geo.point: $(GEO_POINT) $(DRIVER_DIR)
#  compile driver into the program
	echo "Creating Geo.Point"
	$(CC) $(LDFLAGS) -o  $(DRIVER_DIR)/geo.point  $(GEO_POINT)  $(LIBGEO) $(LIBTRANS) $(CURSES) $(MATHLIB) $(GISLIB)  $(LOCKLIB)


coll_pts.o:  $(VECT_INCLUDE)/globals.h 
dig_curses.o:  dig_menu.h
dig_curses.o:  ../../v.digit/menu.h
dig_curses.o:  ../../v.digit/curses.C

