#
# Makefile for rsbac decision module example. 
#
# Author and (c) 1999 Amon Ott <ao@compuniverse.com>
#

# Set this to your kernel directory
KERNELDIR = /usr/src/linux

# comment out, if kernel is not SMP or has no MODVERSIONS
#SMP=1
#MODVERSIONS=1

# comment out, if RSBAC kernel has no PROC support
PROC=1

# set this to your module dir
MODDIR=/lib/modules/`uname -r`/misc

# ----- nothing should be changed below -----
VERSION = \"v1.0.9b\"

#HELPPATH = $(KERNELDIR)/rsbac/help

CC = gcc 
CFLAGS = -O2 -m486 -Wall -I $(KERNELDIR)/include
CFLAGS += -DVERSION=$(VERSION) -D__KERNEL__ -DMODULE -DCONFIG_RSBAC_REG

ifdef SMP
CFLAGS+=-D__SMP__
endif
ifdef MODVERSIONS
CFLAGS+=-DMODVERSIONS -include $(KERNELDIR)/include/linux/modversions.h
endif

ifdef PROC
CFLAGS+=-DPROC
endif

TARGETS=reg_sample1.o reg_sample2.o

LIBS = 

all :
	set -e
	for i in $(TARGETS) ; do $(MAKE) $$i ; done

install : $(TARGET)
	-bash -c "if test ! -d $(MODDIR) ; then mkdir $(MODDIR) ; fi"
	install -m 644 $(TARGETS) $(MODDIR)
	-depmod -a

uninstall :
	-bash -c "cd $(MODDIR) && rm $(TARGETS)"

clean :
	rm -f *.o
