Files
xen/tools/security/Makefile
T
Keir Fraser 3fd29b158f acm: Modify the default ACM boot policy so that unlabeled domains can always start
I am modifying the xen- and xend-internal default policy so that
unlabeled domains can always start. A more restrictive security policy
can then be set on top of that policy.

Signed-off-by: Stefan Beger <stefanb@us.ibm.com>
2008-04-04 12:59:28 +01:00

101 lines
3.0 KiB
Makefile

XEN_ROOT = ../..
include $(XEN_ROOT)/tools/Rules.mk
CFLAGS += -Werror
CFLAGS += -fno-strict-aliasing
CFLAGS += -I. $(CFLAGS_libxenctrl)
CPPFLAGS += -MMD -MF .$*.d
PROG_DEPS = .*.d
XML2VERSION = $(shell xml2-config --version )
CFLAGS += $(shell xml2-config --cflags )
CFLAGS += $(shell if [[ $(XML2VERSION) < 2.6.20 ]]; then echo ""; else echo "-DVALIDATE_SCHEMA"; fi )
LDFLAGS += $(shell xml2-config --libs ) # if this does not work, try -L/usr/lib -lxml2 -lz -lpthread -lm
SRCS_TOOL = secpol_tool.c
OBJS_TOOL := $(patsubst %.c,%.o,$(filter %.c,$(SRCS_TOOL)))
ACM_INST_TOOLS = xensec_tool xensec_gen
ACM_EZPOLICY = xensec_ezpolicy
ACM_OBJS = $(OBJS_TOOL) $(OBJS_GETD)
ACM_SCRIPTS = python/xensec_tools/acm_getlabel
ACM_CONFIG_DIR = /etc/xen/acm-security
ACM_POLICY_DIR = $(ACM_CONFIG_DIR)/policies
ACM_SCRIPT_DIR = $(ACM_CONFIG_DIR)/scripts
ACM_INST_HTML = python/xensec_gen/index.html
ACM_INST_CGI = python/xensec_gen/cgi-bin/policy.cgi
ACM_SECGEN_HTMLDIR= /var/lib/xensec_gen
ACM_SECGEN_CGIDIR = $(ACM_SECGEN_HTMLDIR)/cgi-bin
ACM_SCHEMA = security_policy.xsd
ACM_EXAMPLES = client_v1 test
ACM_DEF_POLICIES =
ACM_POLICY_SUFFIX = security_policy.xml
ifeq ($(ACM_SECURITY),y)
.PHONY: all
all: build
.PHONY: install
ifndef XEN_PYTHON_NATIVE_INSTALL
install: LIBPATH=$(shell PYTHONPATH=../python/xen/util python -c "import auxbin; print auxbin.libpath()")
endif
install: all $(ACM_CONFIG_FILE)
$(INSTALL_DIR) $(DESTDIR)$(SBINDIR)
$(INSTALL_PROG) $(ACM_INST_TOOLS) $(DESTDIR)$(SBINDIR)
$(INSTALL_PROG) $(ACM_EZPOLICY) $(DESTDIR)$(SBINDIR)
$(INSTALL_DIR) $(DESTDIR)$(ACM_CONFIG_DIR)
$(INSTALL_DIR) $(DESTDIR)$(ACM_POLICY_DIR)
$(INSTALL_DATA) policies/$(ACM_SCHEMA) $(DESTDIR)$(ACM_POLICY_DIR)
$(INSTALL_DIR) $(DESTDIR)$(ACM_POLICY_DIR)/example
set -e; for i in $(ACM_EXAMPLES); do \
$(INSTALL_DATA) policies/example/$$i-$(ACM_POLICY_SUFFIX) $(DESTDIR)$(ACM_POLICY_DIR)/example/; \
done
set -e; for i in $(ACM_DEF_POLICIES); do \
$(INSTALL_DATA) policies/$$i-$(ACM_POLICY_SUFFIX) $(DESTDIR)$(ACM_POLICY_DIR); \
done
$(INSTALL_DIR) $(DESTDIR)$(ACM_SCRIPT_DIR)
$(INSTALL_PROG) $(ACM_SCRIPTS) $(DESTDIR)$(ACM_SCRIPT_DIR)
$(INSTALL_DIR) $(DESTDIR)$(ACM_SECGEN_HTMLDIR)
$(INSTALL_DATA) $(ACM_INST_HTML) $(DESTDIR)$(ACM_SECGEN_HTMLDIR)
$(INSTALL_DIR) $(DESTDIR)$(ACM_SECGEN_CGIDIR)
$(INSTALL_PROG) $(ACM_INST_CGI) $(DESTDIR)$(ACM_SECGEN_CGIDIR)
ifndef XEN_PYTHON_NATIVE_INSTALL
python python/setup.py install --install-lib="$(DESTDIR)$(LIBPATH)/python"
else
python python/setup.py install --root="$(DESTDIR)"
endif
else
.PHONY: all
all:
.PHONY: install
install:
endif
.PHONY: build
build: $(ACM_INST_TOOLS) $(ACM_NOINST_TOOLS)
python python/setup.py build
chmod 700 $(ACM_SCRIPTS)
xensec_tool: $(OBJS_TOOL)
$(CC) -g $(CFLAGS) $(LDFLAGS) -O0 -o $@ $^ $(LDFLAGS_libxenctrl)
xensec_gen: xensec_gen.py
cp -f $^ $@
.PHONY: clean
clean:
$(RM) $(ACM_INST_TOOLS) $(ACM_NOINST_TOOLS)
$(RM) $(ACM_OBJS)
$(RM) $(PROG_DEPS)
$(RM) -r build
.PHONY: mrproper
mrproper: clean
-include $(PROG_DEPS)