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
59
syscall_setpriority.c \
60
syscall_sethostname.c \
61
syscall_setdomainname.c \
62
syscall_setscheduler.c \
71
#only do the ioperm/iopl tests for x86 derived architectures
72
ifneq (,$(findstring $(shell uname -i),i386 i486 i586 i686 x86 x86_64))
73
SRC+=syscall_ioperm.c syscall_iopl.c
76
# Suck, Fedora Core 3 no longer includes /sbin/kernelversion
77
KERNELVERSION:=$(shell if [ -x /sbin/kernelversion ] ; then \
78
/sbin/kernelversion ; \
82
KERNELMAJOR:=$(shell echo ${KERNELVERSION} | cut -d. -f1)
83
KERNELMINOR:=$(shell echo ${KERNELVERSION} | cut -d. -f2)
84
CHANGEHAT_FLAGS=$(shell if [ ! -f /usr/include/sys/apparmor.h ] ; then \
85
if [ -f /usr/include/sys/immunix.h ] ; then \
86
echo -DUSE_COMPAT_IMMUNIX_H ; \
88
(echo -DCHANGEHAT_NOT_IN_LIBRARY; \
89
[ $(KERNELMAJOR) -eq 2 ] && \
90
if [ $(KERNELMINOR) -eq 4 ] ; then \
91
echo -DCHANGEHAT_2_4_KERNEL ; \
92
elif [ $(KERNELMINOR) -eq 2 ] ; then \
93
echo -DCHANGEHAT_2_2_KERNEL ;\
98
LIBIMMUNIX:=$(shell if [ -f /usr/lib/libapparmor.so -o -f /usr/lib64/libapparmor.so ] ; then \
100
elif [ -f /lib/libimmunix.so.1 -o -f /lib64/libimmunix.so ] ; then \
104
CFLAGS+=$(CHANGEHAT_FLAGS) -Wall -Wstrict-prototypes
105
LDLIBS+=$(LIBIMMUNIX)
154
# Tests that can crash the kernel should be placed here
157
all: $(EXEC) changehat.h
159
changehat_pthread: changehat_pthread.c changehat.h
160
${CC} ${CFLAGS} ${LDFLAGS} $< -o $@ ${LDLIBS} -pthread
163
@if [ `whoami` = "root" ] ;\
169
echo "running $$i" ;\
171
if [ $$? -ne 0 ] ; then \
177
echo "must be root to run tests" ;\
182
@if [ `whoami` = "root" ] ;\
185
for i in $(TESTS) $(RISKY_TESTS) ;\
188
echo "running $$i" ;\
190
if [ $$? -ne 0 ] ; then \
196
echo "must be root to run tests" ;\