#
# Enable debugging by adding the option  debug  to kerneld: "kerneld debug"
# (Debugging can also be enabled via the kdstat utility: "kdstat debug")
#
# You'll want to have this one enabled!
DEBUG=-DDEBUG
#
# Remove the comment ('#') marker before the XTRA line if you are using
# a modprobe utility earlier than the one from "modules-1.2.8.tar.gz".
#XTRA=-DNO_EXTRA_OPTS


MANDIR=/usr/man/man8
CFLAGS = -m486 -O6 -pipe -fomit-frame-pointer -Wall $(DEBUG) $(XTRA)
LDFLAGS = -N -s
PROGS= kerneld
UTILS= kdstat modstat
TESTPROGS= kdsend
SRCS= kerneld.c kdstat.c kdsend.c modstat.c

all: $(PROGS)

install: all
	@set -x; for i in $(PROGS); do install -m 0700 -o root -s -c $$i /sbin; done
	install -m 0700 -o root request-route.sh /sbin/request-route
	install -c kerneld.8 $(MANDIR)

#
# Build the fake kerneld message generator: kdsend and the kdstat "utility"
# Used for debugging purposes only
#
test: all $(TESTPROGS)

utils: all $(UTILS)

install_utils:
	@set -x; for i in $(UTILS); do install -m 0700 -o root -s -c $$i /sbin; done

clean:
	rm -f $(PROGS) $(TESTPROGS) *.o .depend

depend dep:
	$(CPP) -M $(SRCS) > .depend


# include a dependency file if one exists

ifeq (.depend,$(wildcard .depend))
include .depend
endif
