#
# rcuser
#
# Installation:
#
# Edit this Makefile and rcuser.c to suit your site.
# Run "make install" as root.
# Then edit your /etc/rc.local (or other startup script) so that
#  /etc/rc.users is run at boot time.  Usually you will want it to
#  be run fairly late in the boot process, in case users want to
#  talk to other system daemons, etc.  (This could be done by make
#  install, but it's probably best not to go tweaking peoples'
#  rc files...)
#

CFLAGS = -O -s
BINDIR = /usr/local

# Change this if you want the rc files to be somewhere other than
# /usr/lib/rc.
RCDIR = /usr/lib/rc

rcuser: rcuser.c
	$(CC) -DRCDIR=\"$(RCDIR)/\" $(CFLAGS) rcuser.c -o $@

install: rcuser
	install -m 4711 rcuser $(BINDIR)
	install -c -m 644 rc.users /etc
	-mkdir $(RCDIR)
	chmod 755 $(RCDIR)
	@echo "Remember to edit /etc/rc.local to run /etc/rc.users"

clean:
	-/bin/rm -f core rcuser *.o
