Chris PeBenito ab58ad
# flask needs to know where to export the libselinux headers.
Chris PeBenito ab58ad
LIBSEL ?= ../../libselinux
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# flask needs to know where to export the kernel headers.
Chris PeBenito ab58ad
LINUXDIR ?= ../../../linux-2.6
Chris PeBenito ab58ad
Chris PeBenito ab58ad
AWK = awk
Chris PeBenito ab58ad
Chris PeBenito ab58ad
CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
Chris PeBenito ab58ad
          else if [ -x /bin/bash ]; then echo /bin/bash; \
Chris PeBenito ab58ad
          else echo sh; fi ; fi)
Chris PeBenito ab58ad
Chris PeBenito ab58ad
FLASK_H_DEPEND = security_classes initial_sids
Chris PeBenito ab58ad
AV_H_DEPEND = access_vectors
Chris PeBenito ab58ad
Chris PeBenito ab58ad
FLASK_H_FILES = class_to_string.h flask.h initial_sid_to_string.h
Chris PeBenito ab58ad
AV_H_FILES = av_inherit.h common_perm_to_string.h av_perm_to_string.h av_permissions.h
Chris PeBenito ab58ad
ALL_H_FILES = $(FLASK_H_FILES) $(AV_H_FILES)
Chris PeBenito ab58ad
Chris PeBenito ab58ad
all:  $(ALL_H_FILES)
Chris PeBenito ab58ad
Chris PeBenito ab58ad
$(FLASK_H_FILES): $(FLASK_H_DEPEND)
Chris PeBenito ab58ad
	$(CONFIG_SHELL) mkflask.sh $(AWK) $(FLASK_H_DEPEND)
Chris PeBenito ab58ad
Chris PeBenito ab58ad
$(AV_H_FILES): $(AV_H_DEPEND)
Chris PeBenito ab58ad
	$(CONFIG_SHELL) mkaccess_vector.sh $(AWK) $(AV_H_DEPEND)
Chris PeBenito ab58ad
Chris PeBenito ab58ad
tolib: all
Chris PeBenito ab58ad
	install -m 644 flask.h av_permissions.h $(LIBSEL)/include/selinux
Chris PeBenito ab58ad
	install -m 644 class_to_string.h av_inherit.h common_perm_to_string.h av_perm_to_string.h $(LIBSEL)/src
Chris PeBenito ab58ad
Chris PeBenito ab58ad
tokern: all
Chris PeBenito ab58ad
	install -m 644 $(ALL_H_FILES) $(LINUXDIR)/security/selinux/include
Chris PeBenito ab58ad
Chris PeBenito ab58ad
install: all
Chris PeBenito ab58ad
Chris PeBenito ab58ad
relabel:
Chris PeBenito ab58ad
Chris PeBenito ab58ad
clean:  
Chris PeBenito ab58ad
	rm -f $(FLASK_H_FILES)
Chris PeBenito ab58ad
	rm -f $(AV_H_FILES)