#
# Makefile for "trimlog"
#
# Adjust CONFIG macro to represent the path to the configuration file
# before compiling.
#
# David A. Curry
# Research Institute for Advanced Computer Science
# Mail Stop 230-5
# NASA Ames Research Center
# Moffett Field, CA 94035
# davy@riacs.edu
#
# $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 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)

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
trimlog.o:	trimlog.c trimlog.h
truncate.o:	truncate.c
util.o:		util.c
