1
# Copyright (C) 2002-2005 Novell/SUSE
3
# This program is free software; you can redistribute it and/or
4
# modify it under the terms of the GNU General Public License as
5
# published by the Free Software Foundation, version 2 of the
58
syscall_setpriority.c \
59
syscall_sethostname.c \
60
syscall_setdomainname.c \
61
syscall_setscheduler.c \
70
#only do the ioperm/iopl tests for x86 derived architectures
71
ifneq (,$(findstring $(shell uname -i),i386 i486 i586 i686 x86 x86_64))
72
SRC+=syscall_ioperm.c syscall_iopl.c
75
# Suck, Fedora Core 3 no longer includes /sbin/kernelversion
76
KERNELVERSION:=$(shell if [ -x /sbin/kernelversion ] ; then \
77
/sbin/kernelversion ; \
81
KERNELMAJOR:=$(shell echo ${KERNELVERSION} | cut -d. -f1)
82
KERNELMINOR:=$(shell echo ${KERNELVERSION} | cut -d. -f2)
83
CHANGEHAT_FLAGS=$(shell if [ ! -f /usr/include/sys/apparmor.h ] ; then \
84
if [ -f /usr/include/sys/immunix.h ] ; then \
85
echo -DUSE_COMPAT_IMMUNIX_H ; \
87
(echo -DCHANGEHAT_NOT_IN_LIBRARY; \
88
[ $(KERNELMAJOR) -eq 2 ] && \
89
if [ $(KERNELMINOR) -eq 4 ] ; then \
90
echo -DCHANGEHAT_2_4_KERNEL ; \
91
elif [ $(KERNELMINOR) -eq 2 ] ; then \
92
echo -DCHANGEHAT_2_2_KERNEL ;\
97
LIBIMMUNIX:=$(shell if [ -f /usr/lib/libapparmor.so -o -f /usr/lib64/libapparmor.so ] ; then \
99
elif [ -f /lib/libimmunix.so.1 -o -f /lib64/libimmunix.so ] ; then \
103
CFLAGS+=$(CHANGEHAT_FLAGS) -Wall -Wstrict-prototypes
104
LDLIBS+=$(LIBIMMUNIX)
152
# Tests that can crash the kernel should be placed here
155
all: $(EXEC) changehat.h
157
changehat_pthread: changehat_pthread.c changehat.h
158
${CC} ${CFLAGS} ${LDFLAGS} $< -o $@ ${LDLIBS} -pthread
161
@if [ `whoami` = "root" ] ;\
167
echo "running $$i" ;\
169
if [ $$? -ne 0 ] ; then \
175
echo "must be root to run tests" ;\
180
@if [ `whoami` = "root" ] ;\
183
for i in $(TESTS) $(RISKY_TESTS) ;\
186
echo "running $$i" ;\
188
if [ $$? -ne 0 ] ; then \
194
echo "must be root to run tests" ;\