#
# Copyright (c) 1988 Regents of the University of California.
# All rights reserved.
#
# Redistribution and use in source and binary forms are permitted
# provided that the above copyright notice and this paragraph are
# duplicated in all such forms and that any documentation, advertising
# materials, and other materials related to such redistribution and
# use acknowledge that the software was developed by the University
# of California, Berkeley.  The name of the University may not be
# used to endorse or promote products derived from this software
# without specific prior written permission.  THIS SOFTWARE IS PROVIDED
# ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
# WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND
# FITNESS FOR A PARTICULAR PURPOSE.
#
# @(#)Makefile	5.1 (Berkeley) 9/27/88
#

#
# compile flags for daemon and library, syslogd needs one or more of
# -DSYSLOG_UNIXAF and -DSYSLOG_INET
#
# The setting here should match the setting used in the syslog() in
# the current shared library I think...

SYSLOGD_FLAGS = -DSYSLOG_UNIXAF

CFLAGS= -O6 -fomit-frame-pointer

LIBS	=
SRCS	=	syslogd.c
SYSLOGD_OBJS=	syslogd.o #sys_syslog.o
OBJS	=	${SYSLOGD_OBJS} syslog_test.o sendlog.o logger.o \
		readlog.o 
MAN	=	syslogd.0
LDFLAGS =-s -N
TARGETS =	syslogd syslog_test sendlog logger readlog

all:	${TARGETS}	

syslogd.o: syslogd.c
	${CC} -traditional -c  ${CFLAGS} ${SYSLOGD_FLAGS} syslogd.c

readlog: readlog.o
	${CC}  -o $@ ${CFLAGS} readlog.o ${LDFLAGS}

syslogd: $(SYSLOGD_OBJS)
	${CC} -o $@ ${CFLAGS} $(SYSLOGD_OBJS) ${LDFLAGS}

syslog_test: syslog_test.o ${LIBS}
	${CC} ${CFLAGS} -o syslog_test syslog_test.o ${LDFLAGS}

sendlog: sendlog.o ${LIBS}
	${CC}  ${CFLAGS} -o sendlog sendlog.o ${LDFLAGS}

logger: logger.o ${LIBS}
	${CC}  ${CFLAGS} -o logger logger.o ${LDFLAGS}

clean:
	rm -f ${OBJS} core ${TARGETS}

cleandir: clean
	rm -f ${MAN} tags .depend

depend: ${SRCS}
	mkdep -p ${CFLAGS} ${SRCS}

install: # ${MAN}
	install -s -o bin -g bin -m 755 syslogd ${DESTDIR}/etc/syslogd
# 	install -c -o bin -g bin -m 444 syslogd.0 ${DESTDIR}/usr/man/cat8

lint: ${SRCS}
	lint ${CFLAGS} ${SRCS}

tags: ${SRCS}
	ctags ${SRCS}
