2007-05-30 20:58:48 +05:30
|
|
|
# Copyright (c) 1995 Dr. G.W. Wettstein <greg@wind.rmcc.com>
|
|
|
|
# Copyright (c) 2007 Martin Schulze <joey@infodrom.org>
|
|
|
|
#
|
|
|
|
# This file is part of the sysklogd package, a kernel and system log daemon.
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation; either version 2 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software
|
|
|
|
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
1997-06-02 22:51:41 +05:30
|
|
|
|
|
|
|
CC= gcc
|
2007-05-30 20:54:27 +05:30
|
|
|
#SKFLAGS= -g -DSYSV -Wall
|
1997-06-02 22:51:41 +05:30
|
|
|
#LDFLAGS= -g
|
2007-05-30 20:54:27 +05:30
|
|
|
SKFLAGS= $(RPM_OPT_FLAGS) -O3 -DSYSV -fomit-frame-pointer -Wall -fno-strength-reduce
|
2003-09-04 18:52:23 +05:30
|
|
|
# -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
|
2006-05-25 12:42:44 +05:30
|
|
|
# -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
|
2007-05-30 20:54:27 +05:30
|
|
|
# $(shell getconf LFS_SKFLAGS)
|
1997-06-02 23:12:34 +05:30
|
|
|
LDFLAGS= -s
|
1997-06-02 22:51:41 +05:30
|
|
|
|
1997-06-13 13:12:20 +05:30
|
|
|
# Look where your install program is.
|
1997-06-02 22:51:41 +05:30
|
|
|
INSTALL = /usr/bin/install
|
2004-04-29 16:34:03 +05:30
|
|
|
|
|
|
|
# Destination paths, set prefix=/opt if required
|
|
|
|
BINDIR = $(prefix)/usr/sbin
|
|
|
|
MANDIR = $(prefix)/usr/share/man
|
1997-06-02 22:51:41 +05:30
|
|
|
|
|
|
|
# There is one report that under an all ELF system there may be a need to
|
|
|
|
# explicilty link with libresolv.a. If linking syslogd fails you may wish
|
|
|
|
# to try uncommenting the following define.
|
|
|
|
# LIBS = /usr/lib/libresolv.a
|
|
|
|
|
1997-06-13 13:12:20 +05:30
|
|
|
# A patch was forwarded which provided support for sysklogd under
|
|
|
|
# the ALPHA. This patch included a reference to a library which may be
|
|
|
|
# specific to the ALPHA. If you are attempting to build this package under
|
|
|
|
# an ALPHA and linking fails with unresolved references please try
|
|
|
|
# uncommenting the following define.
|
|
|
|
# LIBS = ${LIBS} -linux
|
|
|
|
|
1997-06-02 22:51:41 +05:30
|
|
|
# Define the following to impart start-up delay in klogd. This is
|
|
|
|
# useful if klogd is started simultaneously or in close-proximity to syslogd.
|
|
|
|
# KLOGD_START_DELAY = -DKLOGD_DELAY=5
|
|
|
|
|
|
|
|
# The following define determines whether the package adheres to the
|
|
|
|
# file system standard.
|
|
|
|
FSSTND = -DFSSTND
|
|
|
|
|
|
|
|
# The following define establishes ownership for the man pages.
|
|
|
|
# Avery tells me that there is a difference between Debian and
|
|
|
|
# Slackware. Rather than choose sides I am leaving it up to the user.
|
2004-04-29 16:34:03 +05:30
|
|
|
MAN_USER = root
|
|
|
|
MAN_GROUP = root
|
|
|
|
MAN_PERMS = 644
|
1997-06-02 22:51:41 +05:30
|
|
|
|
|
|
|
# The following define establishes the name of the pid file for the
|
|
|
|
# syslogd daemon. The library include file (paths.h) defines the
|
|
|
|
# name for the syslogd pid to be syslog.pid. A number of people have
|
|
|
|
# suggested that this should be syslogd.pid. You may cast your
|
|
|
|
# ballot below.
|
1997-06-02 23:12:34 +05:30
|
|
|
SYSLOGD_PIDNAME = -DSYSLOGD_PIDNAME=\"syslogd.pid\"
|
1997-06-02 22:51:41 +05:30
|
|
|
|
2009-11-09 21:45:55 +05:30
|
|
|
SYSLOGD_FLAGS= -DSYSLOG_INET -DSYSLOG_UNIXAF -DINET6 -DNO_SCCS ${FSSTND} \
|
1997-06-13 15:05:55 +05:30
|
|
|
${SYSLOGD_PIDNAME}
|
1997-06-02 22:51:41 +05:30
|
|
|
SYSLOG_FLAGS= -DALLOW_KERNEL_LOGGING
|
1997-06-13 15:05:55 +05:30
|
|
|
KLOGD_FLAGS = ${FSSTND} ${KLOGD_START_DELAY}
|
|
|
|
DEB =
|
1997-06-02 22:51:41 +05:30
|
|
|
|
1997-06-13 13:12:20 +05:30
|
|
|
all: syslogd klogd
|
|
|
|
|
2007-05-30 20:58:48 +05:30
|
|
|
test: syslog_tst ksym oops.ko tsyslogd
|
1997-06-02 22:51:41 +05:30
|
|
|
|
|
|
|
install: install_man install_exec
|
|
|
|
|
|
|
|
syslogd: syslogd.o pidfile.o
|
|
|
|
${CC} ${LDFLAGS} -o syslogd syslogd.o pidfile.o ${LIBS}
|
|
|
|
|
1997-06-13 13:12:20 +05:30
|
|
|
klogd: klogd.o syslog.o pidfile.o ksym.o ksym_mod.o
|
|
|
|
${CC} ${LDFLAGS} -o klogd klogd.o syslog.o pidfile.o ksym.o \
|
|
|
|
ksym_mod.o ${LIBS}
|
1997-06-02 22:51:41 +05:30
|
|
|
|
|
|
|
syslog_tst: syslog_tst.o
|
|
|
|
${CC} ${LDFLAGS} -o syslog_tst syslog_tst.o
|
|
|
|
|
1998-10-12 22:27:53 +05:30
|
|
|
tsyslogd: syslogd.c version.h
|
2007-05-30 20:54:27 +05:30
|
|
|
$(CC) $(SKFLAGS) -g -DTESTING $(SYSLOGD_FLAGS) -o tsyslogd syslogd.c
|
1998-10-12 22:27:53 +05:30
|
|
|
|
|
|
|
tklogd: klogd.c syslog.c ksym.c ksym_mod.c version.h
|
2007-05-30 20:54:27 +05:30
|
|
|
$(CC) $(SKFLAGS) -g -DTESTING $(KLOGD_FLAGS) -o tklogd klogd.c syslog.c ksym.c ksym_mod.c
|
1998-10-12 22:27:53 +05:30
|
|
|
|
1997-06-02 22:51:41 +05:30
|
|
|
syslogd.o: syslogd.c version.h
|
2007-05-30 20:54:27 +05:30
|
|
|
${CC} ${SKFLAGS} ${SYSLOGD_FLAGS} $(DEB) -c syslogd.c
|
1997-06-02 22:51:41 +05:30
|
|
|
|
|
|
|
syslog.o: syslog.c
|
2007-05-30 20:54:27 +05:30
|
|
|
${CC} ${SKFLAGS} ${SYSLOG_FLAGS} -c syslog.c
|
1997-06-02 22:51:41 +05:30
|
|
|
|
|
|
|
klogd.o: klogd.c klogd.h version.h
|
2007-05-30 20:54:27 +05:30
|
|
|
${CC} ${SKFLAGS} ${KLOGD_FLAGS} $(DEB) -c klogd.c
|
1997-06-02 22:51:41 +05:30
|
|
|
|
2007-05-28 20:56:23 +05:30
|
|
|
ksym.o: ksym.c klogd.h ksyms.h module.h
|
2007-05-30 20:54:27 +05:30
|
|
|
${CC} ${SKFLAGS} ${KLOGD_FLAGS} -c ksym.c
|
1997-06-02 22:51:41 +05:30
|
|
|
|
2007-05-24 23:18:44 +05:30
|
|
|
ksym_mod.o: ksym_mod.c klogd.h ksyms.h module.h
|
2007-05-30 20:54:27 +05:30
|
|
|
${CC} ${SKFLAGS} ${KLOGD_FLAGS} -c ksym_mod.c
|
1997-06-13 13:12:20 +05:30
|
|
|
|
1997-06-02 22:51:41 +05:30
|
|
|
syslog_tst.o: syslog_tst.c
|
2007-05-30 20:54:27 +05:30
|
|
|
${CC} ${SKFLAGS} -c syslog_tst.c
|
1997-06-02 22:51:41 +05:30
|
|
|
|
1997-06-13 13:12:20 +05:30
|
|
|
ksym: ksym_test.o ksym_mod.o
|
|
|
|
${CC} ${LDFLAGS} -o ksym ksym_test.o ksym_mod.o
|
|
|
|
|
|
|
|
ksym_test.o: ksym.c
|
2007-05-30 20:54:27 +05:30
|
|
|
${CC} ${SKFLAGS} -DTEST -o ksym_test.o -c ksym.c
|
1997-06-13 13:12:20 +05:30
|
|
|
|
1997-06-02 22:51:41 +05:30
|
|
|
clean:
|
1997-06-13 13:12:20 +05:30
|
|
|
rm -f *.o *.log *~ *.orig
|
2007-05-30 20:58:48 +05:30
|
|
|
rm -f *.ko oops.mod.* Module.symvers
|
1997-06-02 22:51:41 +05:30
|
|
|
|
|
|
|
clobber: clean
|
1998-10-13 01:55:15 +05:30
|
|
|
rm -f syslogd klogd ksym syslog_tst oops_test TAGS tsyslogd tklogd
|
1997-06-02 22:51:41 +05:30
|
|
|
|
|
|
|
install_exec: syslogd klogd
|
1997-06-13 13:12:20 +05:30
|
|
|
${INSTALL} -m 500 -s syslogd ${BINDIR}/syslogd
|
|
|
|
${INSTALL} -m 500 -s klogd ${BINDIR}/klogd
|
1997-06-02 22:51:41 +05:30
|
|
|
|
|
|
|
install_man:
|
2004-04-29 16:34:03 +05:30
|
|
|
${INSTALL} -o ${MAN_USER} -g ${MAN_GROUP} -m ${MAN_PERMS} sysklogd.8 ${MANDIR}/man8/sysklogd.8
|
|
|
|
${INSTALL} -o ${MAN_USER} -g ${MAN_GROUP} -m ${MAN_PERMS} syslogd.8 ${MANDIR}/man8/syslogd.8
|
|
|
|
${INSTALL} -o ${MAN_USER} -g ${MAN_GROUP} -m ${MAN_PERMS} syslog.conf.5 ${MANDIR}/man5/syslog.conf.5
|
|
|
|
${INSTALL} -o ${MAN_USER} -g ${MAN_GROUP} -m ${MAN_PERMS} klogd.8 ${MANDIR}/man8/klogd.8
|
2007-05-30 20:58:48 +05:30
|
|
|
|
|
|
|
obj-m += oops.o
|
|
|
|
|
|
|
|
oops.ko: oops.c
|
|
|
|
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
|