#
# @(#)Makefile	1.7 92/01/17
#

#
# Choose path names suitable for your system.
# Set RPC=0 in DEFINES below if you don't have the routines 
# `pmap_set' and `pmap_unset' in your libraries.
#

BINDIR	=	/usr/local/etc
MANDIR	=	/usr/local/man
DEFINES	=	-DRPC=1 -D_PATH_INETDCONF=\"/etc/inetd.conf\" \
			-D_PATH_INETDPID=\"/etc/munetd.pid\"
CC	=	cc
CFLAGS	=	-O $(DEFINES)
OBJS	=	munetd.o
LIBOBJS	=	daemon.o getenv.o setenv.o
LIBS	=	-lbsd44

withlib	:= LIBSEARCH = -L.
withlib	:= LIBDEP = libbsd44.a

all: munetd
withlib: $$(LIBDEP) all

munetd: $(OBJS) $$(LIBDEP)
	$(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBSEARCH) $(LIBS)

libbsd44.a: $(LIBOBJS)
	ar crlu $@ $(LIBOBJS)
	ranlib $@

install: munetd
	install -o root -m 555 munetd $(BINDIR)

install.man: munetd.8
	install -o root -m 444 munetd.8 $(MANDIR)/man8

clean:
	rm -f core a.out munetd libbsd44.a *.o

kit:
	makekit -m README Makefile munetd.8 munetd.c getenv.c setenv.c daemon.c

tar:
	tar cf - README Makefile munetd.8 munetd.c getenv.c setenv.c daemon.c | \
	compress > munetd.tar.Z
