# Makefile for kidled.
# Copyright (C) 1998  Stanislav Shalunov
# See the file README before you compile.

# This Makefile assumes that your system uses non-formatted man pages
# (though the catted page is generated anyway so that you can look at
# it or whatever).  The executable and the manual page get installed
# under /usr/local.

# Edit config.h before you compile!  It contains stuff you _must_
# customize (such as your utmp file location).

# If your C compiler is not gcc you should change CFLAGS to just -O.

# $Id: Makefile,v 1.7 1998/07/14 11:28:49 shalunov Exp $

# Uncomment if you want to use gcc (if it is not your default compiler).
#CC = gcc
# If your C compiler is not gcc change CFLAGS to just -O.
CFLAGS = -O6 -g -Wall -pedantic
NROFF = nroff
NROFFOPTS = -man
# BSD compatible install
INSTALL = install -c

# Where the executable and the manual go.
BINDIR = /usr/local/sbin
MANDIR = /usr/local/man/man8

# Remove kidled.cat from the next line if you do not want to preformat the
# manual page.
default:	kidled kidled.cat

install:	installbin installman

utmp.o:		utmp.c config.h rcs.h

idle.o:		idle.c config.h rcs.h

kick.o:		kick.c config.h rcs.h

kidled.o:	kidled.c config.h kidled.h rcs.h

kidled:		kidled.o utmp.o kick.o idle.o
	$(CC) -o kidled kidled.o utmp.o kick.o idle.o

kidled.cat:	kidled.8
	$(NROFF) $(NROFFOPTS) kidled.8 > kidled.cat

installbin:	kidled
	-mkdir -p $(BINDIR)
	$(INSTALL) -m 755 -o root -g wheel kidled $(BINDIR)

installman:	kidled.8
	-mkdir -p $(MANDIR)
	$(INSTALL) -m 644 -o root -g wheel kidled.8 $(MANDIR)

clean:
	-rm -f kidled kidled.cat a.out core *.core *.orig *.rej *.o *~
