#
# Makefile for building the SELinux module as part of the kernel tree.
#

O_TARGET := selinux-obj.o

subdir-$(CONFIG_SECURITY_SELINUX) := flask ss

selinux-objs := avc.o psid.o hooks.o syscalls.o ss.o

ifeq ($(CONFIG_SECURITY_SELINUX_NSID),y)
	selinux-objs += nsid.o
	export-objs += nsid.o
endif

ifeq ($(CONFIG_SECURITY_SELINUX_SELOPT),y)
	subdir-$(CONFIG_SECURITY_SELINUX) += selopt
        selinux-objs += selopt/selopt.o
endif

obj-y := $(selinux-objs)
obj-m := $(O_TARGET)

EXTRA_CFLAGS += -Iinclude 

ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/)

include $(TOPDIR)/Rules.make

ss.o:
	make -C ss ss.o
	cp ss/ss.o ss.o

symlinks:
	rm -f include/asm arch/machine
	(cd include; ln -sf asm-$(ARCH) asm)

fastdep: symlinks

