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