#
# Makefile for "trimlog"
#
# Adjust CONFIG macro to represent the path to the configuration file
# before compiling.
#
# David A. Curry
# SRI International
# 333 Ravenswood Avenue
# Menlo Park, CA 94025
# davy@itstd.sri.com
#
# $Log$
#
CONFIG=	/usr/local/etc/trimlog.conf
BINDIR=
MANDIR=	/usr/man/manl
MANSUF= l
TRIMLOG=/usr/local/etc/trimlog

CFLAGS=	-O -DCONFIGFILE=\"$(CONFIG)\"
OBJS=	bybytes.o bylines.o config.o sendsig.o trimlog.o truncate.o util.o

trimlog: $(OBJS)
	$(CC) -o trimlog $(OBJS)

install: trimlog
	install -c -s trimlog $(BINDIR)$(TRIMLOG)

install.man:
	sed -e 's;%CONFIG%;$(CONFIG);' trimlog.man > $(MANDIR)/trimlog.$(MANSUF)

install.conf:
	install -c -m 444 trimlog.conf.Sun $(CONFIG)

clean:
	rm -f a.out core *.o trimlog

bybytes.o:	bybytes.c trimlog.h
bydates.o:	bydates.c trimlog.h
bylines.o:	bylines.c trimlog.h
config.o:	config.c trimlog.h
sendsig.o:	sendsig.c trimlog.h
trimlog.o:	trimlog.c trimlog.h
truncate.o:	truncate.c
util.o:		util.c
