Chris PeBenito e9b004
PYTHON ?= python
Chris PeBenito e9b004
Chris PeBenito 134191
# flask needs to know where to export the libselinux headers.
Chris PeBenito e9b004
LIBSELINUX_D ?= ../../libselinux
Chris PeBenito 134191
Chris PeBenito 134191
# flask needs to know where to export the kernel headers.
Chris PeBenito e9b004
LINUX_D ?= ../../../linux-2.6
Chris PeBenito e9b004
Chris PeBenito e9b004
ACCESS_VECTORS_F = access_vectors
Chris PeBenito e9b004
INITIAL_SIDS_F = initial_sids
Chris PeBenito e9b004
SECURITY_CLASSES_F = security_classes
Chris PeBenito e9b004
Chris PeBenito e9b004
USER_D = userspace
Chris PeBenito e9b004
KERN_D = kernel
Chris PeBenito 134191
Chris PeBenito e9b004
LIBSELINUX_INCLUDE_H = flask.h av_permissions.h
Chris PeBenito e9b004
LIBSELINUX_SOURCE_H = class_to_string.h av_inherit.h common_perm_to_string.h av_perm_to_string.h
Chris PeBenito 134191
Chris PeBenito e9b004
FLASK_H = class_to_string.h flask.h initial_sid_to_string.h
Chris PeBenito e9b004
ACCESS_VECTORS_H = av_inherit.h common_perm_to_string.h av_perm_to_string.h av_permissions.h
Chris PeBenito e9b004
ALL_H = $(FLASK_H) $(ACCESS_VECTORS_H)
Chris PeBenito 134191
Chris PeBenito e9b004
USER_H = $(addprefix $(USER_D)/, $(ALL_H))
Chris PeBenito e9b004
KERN_H = $(addprefix $(KERN_D)/, $(ALL_H))
Chris PeBenito 134191
Chris PeBenito e9b004
FLASK_NOWARNINGS = --nowarnings
Chris PeBenito 134191
Chris PeBenito e9b004
all:  $(USER_H) $(KERN_H)
Chris PeBenito 134191
Chris PeBenito e9b004
$(USER_H):
Chris PeBenito e9b004
	mkdir -p $(USER_D)
Chris PeBenito e9b004
	$(PYTHON) flask.py -a $(ACCESS_VECTORS_F) -i $(INITIAL_SIDS_F) -s $(SECURITY_CLASSES_F) -o $(USER_D) -u $(FLASK_NOWARNINGS)
Chris PeBenito 134191
Chris PeBenito e9b004
$(KERN_H):
Chris PeBenito e9b004
	mkdir -p $(KERN_D) 
Chris PeBenito e9b004
	$(PYTHON) flask.py -a $(ACCESS_VECTORS_F) -i $(INITIAL_SIDS_F) -s $(SECURITY_CLASSES_F) -o $(KERN_D) -k $(FLASK_NOWARNINGS)
Chris PeBenito 134191
Chris PeBenito 134191
tolib: all
Chris PeBenito e9b004
	install -m 644 $(addprefix $(USER_D)/, $(LIBSELINUX_INCLUDE_H)) $(LIBSELINUX_D)/include/selinux
Chris PeBenito e9b004
	install -m 644 $(addprefix $(USER_D)/, $(LIBSELINUX_SOURCE_H)) $(LIBSELINUX_D)/src
Chris PeBenito 134191
Chris PeBenito 134191
tokern: all
Chris PeBenito e9b004
	install -m 644 $(KERN_H) $(LINUX_D)/security/selinux/include
Chris PeBenito 134191
Chris PeBenito 134191
install: all
Chris PeBenito 134191
Chris PeBenito 134191
relabel:
Chris PeBenito 134191
Chris PeBenito 134191
clean:  
Chris PeBenito e9b004
	rm -fr userspace
Chris PeBenito e9b004
	rm -fr kernel