#
# Makefile for acctsum 1.0
#
# $Id: Makefile,v 1.3 1998/02/14 17:40:55 hans Rel $
#

BINDIR	= /usr/local/sbin
CFLAGS	= -O3

all: MakeURL

MakeURL: MakeURL.c

install: account.daily account.conf all
	install -m 0744 -o root -g root MakeURL $(BINDIR)
	install -m 0744 -o root -g root account.daily $(BINDIR)
	if [ -f /etc/account.conf ] ; \
	then \
		echo "/etc/account.conf exists, not modified" ; \
	else \
		install -m 0644 -o root -g root account.conf /etc ; \
	fi
	@echo
	@echo "To use account.daily, add an entry similar to the following"
	@echo "to your crontab:"
	@echo
	@echo "# At 23:55: Accounting summary"
	@echo "55 23 * * * $(BINDIR)/account.daily"

install.isdn: account.isdn
	install -m 0744 -o root -g root account.isdn $(BINDIR)
	@echo
	@echo "To use account.isdn, add an entry similar to the following"
	@echo "to your crontab:"
	@echo
	@echo "# At 01:00 every month: ISDN summary"
	@echo "00 01 1 * * /usr/local/sbin/account.isdn"

uninstall:
	rm -f $(BINDIR)/account.daily
	rm -f $(BINDIR)/account.isdn
	@echo "To make the un-installation complete, remove the call of"
	@echo "account.daily and account.isdn from your crontab."

clean:
	rm -f core MakeURL index.html

distclean: clean

dist: distclean
	(cd ..; tar -cvzf acctsum-1.0.tar.gz --exclude=acctsum/CVS --exclude=acctsum/graph acctsum)

