ia64/xen-unstable

view tools/xenstore/Makefile @ 6946:e703abaf6e3d

Add behaviour to the remove methods to remove the transaction's path itself. This allows us to write Remove(path) to remove the specified path rather than having to slice the path ourselves.
author emellor@ewan
date Sun Sep 18 14:42:13 2005 +0100 (2005-09-18)
parents 3233e7ecfa9f
children 06d84bf87159
line source
1 XEN_ROOT=../..
2 include $(XEN_ROOT)/tools/Rules.mk
3 XEN_LIBXC = $(XEN_ROOT)/tools/libxc
5 INSTALL = install
6 INSTALL_DATA = $(INSTALL) -m0644
7 INSTALL_PROG = $(INSTALL) -m0755
8 INSTALL_DIR = $(INSTALL) -d -m0755
10 PROFILE=#-pg
11 BASECFLAGS=-Wall -W -g -Werror
12 # Make gcc generate dependencies.
13 BASECFLAGS += -Wp,-MD,.$(@F).d
14 PROG_DEP = .*.d
15 BASECFLAGS+= -O3 $(PROFILE)
16 #BASECFLAGS+= -I$(XEN_ROOT)/tools
17 BASECFLAGS+= -I$(XEN_ROOT)/tools/libxc
18 BASECFLAGS+= -I$(XEN_ROOT)/xen/include/public
19 BASECFLAGS+= -I.
21 CFLAGS += $(BASECFLAGS)
22 LDFLAGS += $(PROFILE) -L$(XEN_LIBXC)
23 TESTDIR = testsuite/tmp
24 TESTFLAGS= -DTESTING
25 TESTENV = XENSTORED_ROOTDIR=$(TESTDIR) XENSTORED_RUNDIR=$(TESTDIR)
27 CLIENTS := xenstore-exists xenstore-list xenstore-read xenstore-rm
28 CLIENTS += xenstore-write
29 CLIENTS_OBJS := $(patsubst xenstore-%,xenstore_%.o,$(CLIENTS))
31 all: libxenstore.so xenstored $(CLIENTS)
33 testcode: xs_test xenstored_test xs_random xs_dom0_test
35 xenstored: xenstored_core.o xenstored_watch.o xenstored_domain.o xenstored_transaction.o xs_lib.o talloc.o utils.o
36 $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -lxenctrl -o $@
38 $(CLIENTS): libxenstore.so
39 $(CLIENTS): xenstore-%: xenstore_%.o
40 $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -lxenctrl -L. -lxenstore -o $@
42 $(CLIENTS_OBJS): xenstore_%.o: xenstore_client.c
43 $(COMPILE.c) -DCLIENT_$(*F) -o $@ $<
45 xenstored_test: xenstored_core_test.o xenstored_watch_test.o xenstored_domain_test.o xenstored_transaction_test.o xs_lib.o talloc_test.o fake_libxc.o utils.o
46 $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@
48 xs_test: xs_test.o xs_lib.o utils.o
49 xs_random: xs_random.o xs_test_lib.o xs_lib.o talloc.o utils.o
50 xs_stress: xs_stress.o xs_test_lib.o xs_lib.o talloc.o utils.o
51 xs_crashme: xs_crashme.o xs_lib.o talloc.o utils.o
53 xs_test.o xs_stress.o xenstored_core_test.o xenstored_watch_test.o xenstored_transaction_test.o xenstored_domain_test.o xs_random.o xs_test_lib.o talloc_test.o fake_libxc.o xs_crashme.o: CFLAGS=$(BASECFLAGS) $(TESTFLAGS)
55 xenstored_%_test.o: xenstored_%.c
56 $(COMPILE.c) -o $@ $<
58 xs_test_lib.o: xs.c
59 $(COMPILE.c) -o $@ $<
61 talloc_test.o: talloc.c
62 $(COMPILE.c) -o $@ $<
64 libxenstore.so: xs.opic xs_lib.opic
65 $(CC) $(CFLAGS) $(LDFLAGS) -Wl,-soname -Wl,libxenstore.so -shared -o $@ $^
67 clean: testsuite-clean
68 rm -f *.o *.opic *.so
69 rm -f xenstored xs_random xs_stress xs_crashme
70 rm -f xs_test xenstored_test xs_dom0_test
71 $(RM) $(PROG_DEP)
73 print-dir:
74 @echo -n tools/xenstore:
76 print-end:
77 @echo
79 check: print-dir testsuite-fast randomcheck-fast print-end
81 fullcheck: testsuite-run randomcheck stresstest
83 $(TESTDIR):
84 mkdir $@
86 testsuite-run: xenstored_test xs_test $(TESTDIR)
87 $(TESTENV) testsuite/test.sh && echo
89 testsuite-fast: xenstored_test xs_test $(TESTDIR)
90 @$(TESTENV) testsuite/test.sh --fast
92 testsuite-clean:
93 rm -rf $(TESTDIR)
95 # Make this visible so they can see repeat tests without --fast if they
96 # fail.
97 RANDSEED=$(shell date +%s)
98 randomcheck: xs_random xenstored_test $(TESTDIR)
99 $(TESTENV) ./xs_random --simple --fast /tmp/xs_random 200000 $(RANDSEED) && echo
100 $(TESTENV) ./xs_random --fast /tmp/xs_random 100000 $(RANDSEED) && echo
101 $(TESTENV) ./xs_random --fail /tmp/xs_random 10000 $(RANDSEED)
103 crashme: xs_crashme xenstored_test $(TESTDIR)
104 rm -rf $(TESTDIR)/store $(TESTDIR)/transactions /tmp/xs_crashme.vglog* /tmp/trace
105 export $(TESTENV); ./xs_crashme 5000 $(RANDSEED) 2>/dev/null
106 if [ -n "`cat /tmp/xs_crashme.vglog*`" ]; then echo Valgrind complained; cat /tmp/xs_crashme.vglog*; exit 1; fi
107 rm -rf $(TESTDIR)/store $(TESTDIR)/transactions /tmp/xs_crashme.vglog* /tmp/trace
109 randomcheck-fast: xs_random xenstored_test $(TESTDIR)
110 @$(TESTENV) ./xs_random --fast /tmp/xs_random 2000 $(RANDSEED)
112 stresstest: xs_stress xenstored_test $(TESTDIR)
113 rm -rf $(TESTDIR)/store $(TESTDIR)/transactions
114 export $(TESTENV); PID=`./xenstored_test --output-pid --trace-file=/tmp/trace`; ./xs_stress 5000; ret=$$?; kill $$PID; exit $$ret
116 xs_dom0_test: xs_dom0_test.o utils.o
117 $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -lxenctrl -o $@
119 TAGS:
120 etags `find . -name '*.[ch]'`
122 tarball: clean
123 cd .. && tar -c -j -v -h -f xenstore.tar.bz2 xenstore/
125 install: libxenstore.so xenstored $(CLIENTS)
126 $(INSTALL_DIR) -p $(DESTDIR)/var/run/xenstored
127 $(INSTALL_DIR) -p $(DESTDIR)/var/lib/xenstored
128 $(INSTALL_DIR) -p $(DESTDIR)/usr/bin
129 $(INSTALL_DIR) -p $(DESTDIR)/usr/sbin
130 $(INSTALL_DIR) -p $(DESTDIR)/usr/include
131 $(INSTALL_PROG) xenstored $(DESTDIR)/usr/sbin
132 $(INSTALL_PROG) $(CLIENTS) $(DESTDIR)/usr/bin
133 $(INSTALL_DIR) -p $(DESTDIR)/usr/$(LIBDIR)
134 $(INSTALL_DATA) libxenstore.so $(DESTDIR)/usr/$(LIBDIR)
135 $(INSTALL_DATA) xs.h $(DESTDIR)/usr/include
136 $(INSTALL_DATA) xs_lib.h $(DESTDIR)/usr/include
138 -include $(PROG_DEP)
140 # never delete any intermediate files.
141 .SECONDARY: