ia64/xen-unstable

view tools/security/Makefile @ 7238:971e7c7411b3

Raise an exception if an error appears on the pipes to our children, and make
sure that the child's pipes are closed even under that exception. Move the
handling of POLLHUP to the end of the loop, so that we guarantee to read any
remaining data from the child if POLLHUP and POLLIN appear at the same time.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author emellor@ewan
date Thu Oct 06 10:13:11 2005 +0100 (2005-10-06)
parents 06d84bf87159
children b3a255e88810
line source
1 XEN_ROOT = ../..
2 include $(XEN_ROOT)/tools/Rules.mk
4 SRCS = secpol_tool.c
5 CFLAGS += -Wall
6 CFLAGS += -Werror
7 CFLAGS += -O3
8 CFLAGS += -fno-strict-aliasing
9 CFLAGS += -I. -I/usr/include/libxml2
10 CFLAGS_XML2BIN += $(shell xml2-config --cflags --libs )
11 #if above does not work, try -L/usr/lib -lxml2 -lz -lpthread -lm
12 XML2VERSION = $(shell xml2-config --version )
13 VALIDATE_SCHEMA=$(shell if [[ $(XML2VERSION) < 2.6.20 ]]; then echo ""; else echo "-DVALIDATE_SCHEMA"; fi; )
15 ifeq ($(ACM_USE_SECURITY_POLICY),ACM_NULL_POLICY)
16 POLICY=null
17 endif
18 ifeq ($(ACM_USE_SECURITY_POLICY),ACM_CHINESE_WALL_POLICY)
19 POLICY=chwall
20 endif
21 ifeq ($(ACM_USE_SECURITY_POLICY),ACM_SIMPLE_TYPE_ENFORCEMENT_POLICY)
22 POLICY=ste
23 endif
24 ifeq ($(ACM_USE_SECURITY_POLICY),ACM_CHINESE_WALL_AND_SIMPLE_TYPE_ENFORCEMENT_POLICY)
25 POLICY=chwall_ste
26 endif
27 POLICYFILE=./policies/$(POLICY)/$(POLICY).bin
29 ifneq ($(ACM_USE_SECURITY_POLICY), ACM_NULL_POLICY)
30 all: build
32 install:all
34 default:all
35 else
36 all:
38 install:
40 default:
41 endif
43 build: mk-symlinks
44 $(MAKE) secpol_tool
45 $(MAKE) secpol_xml2bin
46 chmod 700 ./setlabel.sh
47 chmod 700 ./updategrub.sh
48 chmod 700 ./getlabel.sh
50 secpol_tool : secpol_tool.c secpol_compat.h
51 $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ $<
53 secpol_xml2bin : secpol_xml2bin.c secpol_xml2bin.h secpol_compat.h
54 $(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_XML2BIN) $(VALIDATE_SCHEMA) -o $@ $<
56 clean:
57 rm -rf secpol_tool secpol_xml2bin xen
59 policy_clean:
60 rm -rf policies/*/*.bin policies/*/*.map
62 mrproper: clean policy_clean
65 $(POLICYFILE) : build
66 @./secpol_xml2bin $(POLICY) > /dev/null
68 boot_install: $(POLICYFILE)
69 @cp $(POLICYFILE) /boot
70 @./updategrub.sh $(POLICY) $(PWD)/$(XEN_ROOT)
72 LINUX_ROOT := $(XEN_ROOT)/linux-2.6-xen-sparse
73 mk-symlinks:
74 [ -e xen/linux ] || mkdir -p xen/linux
75 [ -e xen/io ] || mkdir -p xen/io
76 ( cd xen >/dev/null ; \
77 ln -sf ../$(XEN_ROOT)/xen/include/public/*.h . )
78 ( cd xen/io >/dev/null ; \
79 ln -sf ../../$(XEN_ROOT)/xen/include/public/io/*.h . )
80 ( cd xen/linux >/dev/null ; \
81 ln -sf ../../$(LINUX_ROOT)/include/asm-xen/linux-public/*.h . )