VERSION = 1.1.4

CPP=gcc
CPPFLAGS += -DVERSION="\"$(VERSION)\""
CXXFLAGS += -O2 -fomit-frame-pointer -pipe \
    -Wall -W -pedantic -Wundef \
    -Wcast-qual -Wcast-align -Wwrite-strings \
    -Wredundant-decls -Winline
LDFLAGS +=
BINDIR=/usr/local/sbin
MANDIR=/usr/local/man/man8
INSTALL=install

PROG=bidentd
OBJS=main.o

ARCHDIR=archives/
ARCHNAME=${PROG}-$(VERSION)
ARCHFILES=main.cc ChangeLog COPYING sizes.h \
          bidentd.8 progdesc.php
INSTALLPROGS=$(PROG)
DEPFUN_INSTALL=bin

$(PROG): $(OBJS)
	$(CXX) $(LDFLAGS) -o $@ $^

install: install${DEPFUN_INSTALL}
	install -c -s -m 644 ${PROG}.8 ${MANDIR}/${PROG}.8
	@echo Done.
	@echo Now ensure that ${PROG} starts automatically from inetd.
deinstall: uninstall
uninstall: uninstall${DEPFUN_INSTALL}
	
startup: install
	@echo You must manually make inetd spawn ${PROG}.
	@echo Try adding this line to /etc/inetd.conf:
	@echo auth stream tcp nowait nobody ${BINDIR}/$PROG $PROG

update: uninstall${DEPFUN_INSTALL} start
	- killall -1 inetd
	@echo Updated.

clean:
	rm -f $(PROG) $(OBJS)
distclean: clean
	rm -f core *~ .depend
realclean: distclean

include depfun.mak
