ia64/xen-unstable

view tools/security/Makefile @ 8740:3d7ea7972b39

Update patches for linux 2.6.15.

Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
author cl349@firebug.cl.cam.ac.uk
date Thu Feb 02 17:16:00 2006 +0000 (2006-02-02)
parents 269abc1e4fa5
children 7e68bc2745af
line source
1 XEN_ROOT = ../..
2 include $(XEN_ROOT)/tools/Rules.mk
4 CFLAGS += -Wall
5 CFLAGS += -Werror
6 CFLAGS += -O3
7 CFLAGS += -fno-strict-aliasing
8 CFLAGS += -I.
10 CPPFLAGS += -MMD -MF .$*.d
11 PROG_DEPS = .*.d
13 XML2VERSION = $(shell xml2-config --version )
14 CFLAGS += $(shell xml2-config --cflags )
15 CFLAGS += $(shell if [[ $(XML2VERSION) < 2.6.20 ]]; then echo ""; else echo "-DVALIDATE_SCHEMA"; fi )
16 LDFLAGS += $(shell xml2-config --libs ) # if this does not work, try -L/usr/lib -lxml2 -lz -lpthread -lm
18 ifeq ($(ACM_DEFAULT_SECURITY_POLICY),ACM_NULL_POLICY)
19 POLICY=null
20 endif
21 ifeq ($(ACM_DEFAULT_SECURITY_POLICY),ACM_CHINESE_WALL_POLICY)
22 POLICY=chwall
23 endif
24 ifeq ($(ACM_DEFAULT_SECURITY_POLICY),ACM_SIMPLE_TYPE_ENFORCEMENT_POLICY)
25 POLICY=ste
26 endif
27 ifeq ($(ACM_DEFAULT_SECURITY_POLICY),ACM_CHINESE_WALL_AND_SIMPLE_TYPE_ENFORCEMENT_POLICY)
28 POLICY=chwall_ste
29 endif
31 SRCS_TOOL = secpol_tool.c
32 OBJS_TOOL := $(patsubst %.c,%.o,$(filter %.c,$(SRCS_TOOL)))
33 SRCS_XML2BIN = secpol_xml2bin.c secpol_xml2bin.h
34 OBJS_XML2BIN := $(patsubst %.c,%.o,$(filter %.c,$(SRCS_XML2BIN)))
35 SRCS_GETD = get_decision.c
36 OBJS_GETD := $(patsubst %.c,%.o,$(filter %.c,$(SRCS_GETD)))
38 ACM_INST_TOOLS = xensec_tool xensec_xml2bin xensec_gen
39 ACM_NOINST_TOOLS = get_decision
40 ACM_OBJS = $(OBJS_TOOL) $(OBJS_XML2BIN) $(OBJS_GETD)
41 ACM_SCRIPTS = getlabel.sh setlabel.sh updategrub.sh labelfuncs.sh
43 ACM_CONFIG_DIR = /etc/xen/acm-security
44 ACM_POLICY_DIR = $(ACM_CONFIG_DIR)/policies
45 ACM_SCRIPT_DIR = $(ACM_CONFIG_DIR)/scripts
47 ACM_INST_HTML = python/xensec_gen/index.html
48 ACM_INST_CGI = python/xensec_gen/cgi-bin/policy.cgi \
49 python/xensec_gen/cgi-bin/policylabel.cgi
50 ACM_SECGEN_HTMLDIR= /var/lib/xensec_gen
51 ACM_SECGEN_CGIDIR = $(ACM_SECGEN_HTMLDIR)/cgi-bin
53 ACM_SCHEMA = security_policy.xsd
54 ACM_EXAMPLES = null chwall ste chwall_ste
55 ACM_POLICY_SUFFIX = security_policy.xml
56 ACM_LABEL_SUFFIX = security_label_template.xml
58 ifeq ($(ACM_SECURITY),y)
59 all: build
61 install: all $(ACM_CONFIG_FILE)
62 $(INSTALL_DIR) -p $(DESTDIR)/usr/sbin
63 $(INSTALL_PROG) -p $(ACM_INST_TOOLS) $(DESTDIR)/usr/sbin
64 $(INSTALL_DIR) -p $(DESTDIR)$(ACM_CONFIG_DIR)
65 $(INSTALL_DIR) -p $(DESTDIR)$(ACM_POLICY_DIR)
66 $(INSTALL_DATA) -p policies/$(ACM_SCHEMA) $(DESTDIR)$(ACM_POLICY_DIR)
67 for i in $(ACM_EXAMPLES); do \
68 $(INSTALL_DIR) -p $(DESTDIR)$(ACM_POLICY_DIR)/$$i; \
69 $(INSTALL_DATA) -p policies/$$i/$$i-$(ACM_POLICY_SUFFIX) $(DESTDIR)$(ACM_POLICY_DIR)/$$i; \
70 $(INSTALL_DATA) -p policies/$$i/$$i-$(ACM_LABEL_SUFFIX) $(DESTDIR)$(ACM_POLICY_DIR)/$$i; \
71 done
72 $(INSTALL_DIR) -p $(DESTDIR)$(ACM_SCRIPT_DIR)
73 $(INSTALL_PROG) -p $(ACM_SCRIPTS) $(DESTDIR)$(ACM_SCRIPT_DIR)
74 $(INSTALL_DIR) -p $(DESTDIR)$(ACM_SECGEN_HTMLDIR)
75 $(INSTALL_DATA) -p $(ACM_INST_HTML) $(DESTDIR)$(ACM_SECGEN_HTMLDIR)
76 $(INSTALL_DIR) -p $(DESTDIR)$(ACM_SECGEN_CGIDIR)
77 $(INSTALL_PROG) -p $(ACM_INST_CGI) $(DESTDIR)$(ACM_SECGEN_CGIDIR)
78 ifndef XEN_PYTHON_NATIVE_INSTALL
79 python python/setup.py install --home="$(DESTDIR)/usr"
80 else
81 python python/setup.py install --root="$(DESTDIR)"
82 endif
83 else
84 all:
86 install:
87 endif
89 build: mk-symlinks $(ACM_INST_TOOLS) $(ACM_NOINST_TOOLS)
90 python python/setup.py build
91 chmod 700 $(ACM_SCRIPTS)
93 xensec_tool: $(OBJS_TOOL)
94 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^
96 xensec_xml2bin: $(OBJS_XML2BIN)
97 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^
99 get_decision: $(OBJS_GETD)
100 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^
102 xensec_gen: xensec_gen.py
103 cp -f $^ $@
105 clean:
106 $(RM) $(ACM_INST_TOOLS) $(ACM_NOINST_TOOLS)
107 $(RM) $(ACM_OBJS)
108 $(RM) $(PROG_DEPS)
109 $(RM) -r xen
110 $(RM) -r build
112 mrproper: clean
114 boot_install: install
115 $(ACM_SCRIPT_DIR)/updategrub.sh $(POLICY) $(KERNEL_VERSION)
117 -include $(PROG_DEPS)