#
# Makefile version = "$Id: Makefile,v 1.10 2001/10/30 16:51:16 jamesp Exp $"
#

include Makefile.inc

#
# linux commands
#

# SHELL=	/bin/bash
CC=		gcc
OPT=		-O

#
# variables
#

VERSION=  -DDIGI_VERSION=\"$(TRUE_VERSION)\"
APP_OPTS= $(VERSION)

all:  build

build:
	(cd ditty; make all)
	(cd driver; make all)
	(cd daemon; make all)
	(cd config; make all)
	(cd dgipserv; make -f Makefile.linux all)
	(cd dgelreset; make -f Makefile.linux all)

clean: 
	(cd ditty; make clean)
	(cd driver; make clean)
	(cd daemon; make clean)
	(cd config; make clean)
	(cd dgipserv; make -f Makefile.linux clean)
	(cd dgelreset; make -f Makefile.linux clean)

install:
	(cd ditty;  make install)
	(cd driver; make install)
	(cd daemon; make install)
	(cd config; make install)
	(cd init;   make install)
	(cd dgipserv; make -f Makefile.linux install)
	(cd dgelreset; make -f Makefile.linux install)

postinstall:
	(cd driver; make postinstall)
	-chkconfig --add dgrp_daemon
	-chkconfig --add dgrp_ditty

preuninstall:
	-chkconfig --del dgrp_daemon
	-chkconfig --del dgrp_ditty
	(cd driver; make preuninstall)

uninstall:
	(cd ditty;  make uninstall)
	(cd driver; make uninstall)
	(cd daemon; make uninstall)
	(cd config; make uninstall)
	(cd init;   make uninstall)
	(cd dgipserv; make -f Makefile.linux uninstall)
	(cd dgelreset; make -f Makefile.linux uninstall)
	-rm -r $(DGRPBIN)
