1XEN_ROOT=$(CURDIR)/../../..
2include $(XEN_ROOT)/tools/Rules.mk
3
4CFLAGS += -Werror
5CFLAGS += $(CFLAGS_libxenctrl)
6
7TESTDIR  = testsuite/tmp
8TESTFLAGS= -DTESTING
9TESTENV  = XENSTORED_ROOTDIR=$(TESTDIR) XENSTORED_RUNDIR=$(TESTDIR)
10
11CLIENTS := flask-loadpolicy flask-setenforce flask-getenforce flask-label-pci flask-get-bool flask-set-bool
12CLIENTS_SRCS := $(patsubst flask-%,%.c,$(CLIENTS))
13CLIENTS_OBJS := $(patsubst flask-%,%.o,$(CLIENTS))
14
15.PHONY: all
16all: $(CLIENTS)
17
18flask-loadpolicy: loadpolicy.o
19	$(CC) $(LDFLAGS) $< $(LDLIBS) $(LDLIBS_libxenctrl) -o $@
20
21flask-setenforce: setenforce.o
22	$(CC) $(LDFLAGS) $< $(LDLIBS) $(LDLIBS_libxenctrl) -o $@
23
24flask-getenforce: getenforce.o
25	$(CC) $(LDFLAGS) $< $(LDLIBS) $(LDLIBS_libxenctrl) -o $@
26
27flask-label-pci: label-pci.o
28	$(CC) $(LDFLAGS) $< $(LDLIBS) $(LDLIBS_libxenctrl) -o $@
29
30flask-get-bool: get-bool.o
31	$(CC) $(LDFLAGS) $< $(LDLIBS) $(LDLIBS_libxenctrl) -o $@
32
33flask-set-bool: set-bool.o
34	$(CC) $(LDFLAGS) $< $(LDLIBS) $(LDLIBS_libxenctrl) -o $@
35
36.PHONY: clean
37clean:
38	rm -f *.o *.opic *.so
39	rm -f $(CLIENTS)
40	$(RM) $(DEPS_RM)
41
42.PHONY: distclean
43distclean: clean
44
45.PHONY: print-dir
46print-dir:
47	@echo -n tools/flask/utils:
48
49.PHONY: print-end
50print-end:
51	@echo
52
53.PHONY: install
54install: all
55	$(INSTALL_DIR) $(DESTDIR)$(sbindir)
56	$(INSTALL_PROG) $(CLIENTS) $(DESTDIR)$(sbindir)
57
58.PHONY: uninstall
59uninstall:
60	rm -f $(addprefix $(DESTDIR)$(sbindir)/, $(CLIENTS))
61
62-include $(DEPS_INCLUDE)
63