all: rwhod

include ../MCONFIG
include ../MRULES

CFLAGS += -I../include
OBJS = rwhod.o daemon.o

rwhod: $(OBJS)
	$(CC) $(LDFLAGS) $^ $(LIBS) -o $@

$(OBJS): daemon.h

install: rwhod
	install -d $(INSTALLROOT)$(SBINDIR)
	install -s -m$(DAEMONMODE) rwhod $(INSTALLROOT)$(SBINDIR)
	install -d $(INSTALLROOT)$(MANDIR)/man8
	install -m$(MANMODE) rwhod.8 $(INSTALLROOT)$(MANDIR)/man8

clean:
	rm -f *.o rwhod

