ia64/xen-unstable

view tools/security/Makefile @ 6552:a9873d384da4

Merge.
author adsharma@los-vmm.sc.intel.com
date Thu Aug 25 12:24:48 2005 -0700 (2005-08-25)
parents 112d44270733 fa0754a9f64f
children dfaf788ab18c
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
49 secpol_tool : secpol_tool.c secpol_compat.h
50 $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ $<
52 secpol_xml2bin : secpol_xml2bin.c secpol_xml2bin.h secpol_compat.h
53 $(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_XML2BIN) $(VALIDATE_SCHEMA) -o $@ $<
55 clean:
56 rm -rf secpol_tool secpol_xml2bin xen
58 policy_clean:
59 rm -rf policies/*/*.bin policies/*/*.map
61 mrproper: clean policy_clean
64 $(POLICYFILE) : build
65 @./secpol_xml2bin $(POLICY) > /dev/null
67 boot_install: $(POLICYFILE)
68 @cp $(POLICYFILE) /boot
69 @./updategrub.sh $(POLICY) $(PWD)/$(XEN_ROOT)
71 LINUX_ROOT := $(XEN_ROOT)/linux-2.6-xen-sparse
72 mk-symlinks:
73 [ -e xen/linux ] || mkdir -p xen/linux
74 [ -e xen/io ] || mkdir -p xen/io
75 ( cd xen >/dev/null ; \
76 ln -sf ../$(XEN_ROOT)/xen/include/public/*.h . )
77 ( cd xen/io >/dev/null ; \
78 ln -sf ../../$(XEN_ROOT)/xen/include/public/io/*.h . )
79 ( cd xen/linux >/dev/null ; \
80 ln -sf ../../$(LINUX_ROOT)/include/asm-xen/linux-public/*.h . )