1 # Copyright (c) 1995 Dr. G.W. Wettstein <greg@wind.rmcc.com>
2 # Copyright (c) 2007 Martin Schulze <joey@infodrom.org>
4 # This file is part of the sysklogd package, a kernel and system log daemon.
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 #SKFLAGS= -g -DSYSV -Wall
23 SKFLAGS= $(RPM_OPT_FLAGS) -O3 -DSYSV -fomit-frame-pointer -Wall -fno-strength-reduce
24 # -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
25 # -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
26 # $(shell getconf LFS_SKFLAGS)
29 # Look where your install program is.
30 INSTALL = /usr/bin/install
32 # Destination paths, set prefix=/opt if required
33 BINDIR = $(prefix)/usr/sbin
34 MANDIR = $(prefix)/usr/share/man
36 # There is one report that under an all ELF system there may be a need to
37 # explicilty link with libresolv.a. If linking syslogd fails you may wish
38 # to try uncommenting the following define.
39 # LIBS = /usr/lib/libresolv.a
41 # A patch was forwarded which provided support for sysklogd under
42 # the ALPHA. This patch included a reference to a library which may be
43 # specific to the ALPHA. If you are attempting to build this package under
44 # an ALPHA and linking fails with unresolved references please try
45 # uncommenting the following define.
46 # LIBS = ${LIBS} -linux
48 # Define the following to impart start-up delay in klogd. This is
49 # useful if klogd is started simultaneously or in close-proximity to syslogd.
50 # KLOGD_START_DELAY = -DKLOGD_DELAY=5
52 # The following define determines whether the package adheres to the
53 # file system standard.
56 # The following define establishes ownership for the man pages.
57 # Avery tells me that there is a difference between Debian and
58 # Slackware. Rather than choose sides I am leaving it up to the user.
63 # The following define establishes the name of the pid file for the
64 # syslogd daemon. The library include file (paths.h) defines the
65 # name for the syslogd pid to be syslog.pid. A number of people have
66 # suggested that this should be syslogd.pid. You may cast your
68 SYSLOGD_PIDNAME = -DSYSLOGD_PIDNAME=\"syslogd.pid\"
70 SYSLOGD_FLAGS= -DSYSLOG_INET -DSYSLOG_UNIXAF -DINET6 -DNO_SCCS ${FSSTND} \
72 SYSLOG_FLAGS= -DALLOW_KERNEL_LOGGING
73 KLOGD_FLAGS = ${FSSTND} ${KLOGD_START_DELAY}
78 test: syslog_tst ksym oops.ko tsyslogd
80 install: install_man install_exec
82 syslogd: syslogd.o pidfile.o
83 ${CC} ${LDFLAGS} -o syslogd syslogd.o pidfile.o ${LIBS}
85 klogd: klogd.o syslog.o pidfile.o ksym.o ksym_mod.o
86 ${CC} ${LDFLAGS} -o klogd klogd.o syslog.o pidfile.o ksym.o \
89 syslog_tst: syslog_tst.o
90 ${CC} ${LDFLAGS} -o syslog_tst syslog_tst.o
92 tsyslogd: syslogd.c version.h
93 $(CC) $(SKFLAGS) -g -DTESTING $(SYSLOGD_FLAGS) -o tsyslogd syslogd.c
95 tklogd: klogd.c syslog.c ksym.c ksym_mod.c version.h
96 $(CC) $(SKFLAGS) -g -DTESTING $(KLOGD_FLAGS) -o tklogd klogd.c syslog.c ksym.c ksym_mod.c
98 syslogd.o: syslogd.c version.h
99 ${CC} ${SKFLAGS} ${SYSLOGD_FLAGS} $(DEB) -c syslogd.c
102 ${CC} ${SKFLAGS} ${SYSLOG_FLAGS} -c syslog.c
104 klogd.o: klogd.c klogd.h version.h
105 ${CC} ${SKFLAGS} ${KLOGD_FLAGS} $(DEB) -c klogd.c
107 ksym.o: ksym.c klogd.h ksyms.h module.h
108 ${CC} ${SKFLAGS} ${KLOGD_FLAGS} -c ksym.c
110 ksym_mod.o: ksym_mod.c klogd.h ksyms.h module.h
111 ${CC} ${SKFLAGS} ${KLOGD_FLAGS} -c ksym_mod.c
113 syslog_tst.o: syslog_tst.c
114 ${CC} ${SKFLAGS} -c syslog_tst.c
116 ksym: ksym_test.o ksym_mod.o
117 ${CC} ${LDFLAGS} -o ksym ksym_test.o ksym_mod.o
120 ${CC} ${SKFLAGS} -DTEST -o ksym_test.o -c ksym.c
123 rm -f *.o *.log *~ *.orig
124 rm -f *.ko oops.mod.* Module.symvers
127 rm -f syslogd klogd ksym syslog_tst oops_test TAGS tsyslogd tklogd
129 install_exec: syslogd klogd
130 ${INSTALL} -m 500 -s syslogd ${BINDIR}/syslogd
131 ${INSTALL} -m 500 -s klogd ${BINDIR}/klogd
134 ${INSTALL} -o ${MAN_USER} -g ${MAN_GROUP} -m ${MAN_PERMS} sysklogd.8 ${MANDIR}/man8/sysklogd.8
135 ${INSTALL} -o ${MAN_USER} -g ${MAN_GROUP} -m ${MAN_PERMS} syslogd.8 ${MANDIR}/man8/syslogd.8
136 ${INSTALL} -o ${MAN_USER} -g ${MAN_GROUP} -m ${MAN_PERMS} syslog.conf.5 ${MANDIR}/man5/syslog.conf.5
137 ${INSTALL} -o ${MAN_USER} -g ${MAN_GROUP} -m ${MAN_PERMS} klogd.8 ${MANDIR}/man8/klogd.8
142 make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules