#
# Copyright (C) 1995 Lars Fenneberg, Joao Ventura
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

include ../MCONFIG

all:	ipquota ipadd sayip man

ipquota: ipquota.o database.o hash.o log.o version.o
ipquota.c: pathnames.h

sayip: sayip.o log.o version.o
sayip.c: pathnames.h

ipadd:	ipadd.o database.o hash.o log.o version.o
ipadd.c: pathnames.h

man:	ipquota.8 sayip.1 ipadd.8

install: ipquota ipadd sayip
	install -m 0750 -o bin -g bin ipquota $(USR_SBINDIR)
	install -m 0751 -o bin -g bin sayip $(USR_BINDIR)
	install -m 0750 -o bin -g bin ipadd $(USR_SBINDIR)
	touch $(QUOTA_STATS)
	chown root.root $(QUOTA_STATS)
	chmod 644 $(QUOTA_STATS)

install.man: ipquota.8 ipadd.8 sayip.1
	install -m $(MAN_MODE) -o $(MAN_USER) -g $(MAN_GROUP) ipquota.8 $(MAN_DIR_SYSTEM)
	install -m $(MAN_MODE) -o $(MAN_USER) -g $(MAN_GROUP) ipadd.8 $(MAN_DIR_SYSTEM)
	install -m $(MAN_MODE) -o $(MAN_USER) -g $(MAN_GROUP) sayip.1 $(MAN_DIR_USER)

clean:
	rm -f *.o *~ core

clobber: clean
	rm -f sayip ipquota ipadd *.8 *.1 pathnames.h
