#!/usr/bin/make
#
# taillog - tail the end of a log file while dealing with file moves & removes
#
# @(#) $Revision: 1.10 $
# @(#) $Id: Makefile,v 1.10 2000/06/13 20:55:43 chongo Exp $
# @(#) $Source: /usr/local/src/cmd/taillog/RCS/Makefile,v $
#
# Copyright (c) 1999 by Landon Curt Noll.  All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and
# its documentation for any purpose and without fee is hereby granted,
# provided that the above copyright, this permission notice and text
# this comment, and the disclaimer below appear in all of the following:
#
#       supporting documentation
#       source copies
#       source works derived from this source
#       binaries derived from this source or from derived source
#
# LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
# EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR
# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
# USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
# OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
#
# chongo <was here> /\oo/\
#
# Share and enjoy!


SHELL=/bin/sh
DESTBIN=/usr/local/bin
DESTETC=/usr/local/etc
WWWDIR=/home/httpd/html/chongo/src/taillog
INSTALL= install
CC= cc
LN= /bin/ln
#CFLAGS= -fullwarn -O2
#CFLAGS= -fullwarn -g
CFLAGS= -O2
TARGETS= taillog tailmessages tailmaillog

all: ${TARGETS}

taillog: taillog.c
	${CC} ${CFLAGS} taillog.c -o taillog

tailmessages: taillog
	${LN} -f taillog $@

tailmaillog: taillog
	${LN} -f taillog $@

install: all taillog.c
	${INSTALL} -c -m 0555 taillog ${DESTBIN}
	-@if [ -d "${WWWDIR}" ]; then \
	    echo "${INSTALL} -c -m 0444 Makefile taillog.c ${WWWDIR}"; \
	    ${INSTALL} -c -m 0444 Makefile taillog.c ${WWWDIR}; \
	    (echo "cd ${WWWDIR}/.."; \
	     cd ${WWWDIR}/..; \
	     tgz="taillog/taillog.tgz"; \
	     echo "tar -zcvf $$tgz taillog/Makefile taillog/taillog.c"; \
	     tar -zcvf $$tgz taillog/Makefile taillog/taillog.c; \
	     echo "chmod 0444 $$tgz"; \
	     chmod 0444 $$tgz; \
	    ); \
	fi
	${INSTALL} -c -o root -m 4555 tailmessages ${DESTETC}
	${INSTALL} -c -o root -m 4555 tailmaillog ${DESTETC}

clean:

clobber: clean
	-rm -f ${TARGETS}
