debuggers.hg

view tools/xenstore/Makefile @ 6644:29808fef9148

merge?
author cl349@firebug.cl.cam.ac.uk
date Sat Sep 03 18:24:46 2005 +0000 (2005-09-03)
parents dd668f7527cb f27205ea60ef
children b6c98fe62e1a
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
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 = `pwd`/testsuite/tmp
24 TESTFLAGS= -DTESTING
25 TESTENV = XENSTORED_ROOTDIR=$(TESTDIR) XENSTORED_RUNDIR=$(TESTDIR)
27 CLIENTS := xenstore-read xenstore-rm xenstore-write
28 CLIENTS_OBJS := $(patsubst xenstore-%,xenstore_%.o,$(CLIENTS))
30 all: xen xenbus_dev.h libxenstore.so xenstored $(CLIENTS)
32 testcode: xen xs_test xenstored_test xs_random xs_dom0_test
34 xen:
35 ln -sf $(XEN_ROOT)/xen/include/public $@
37 xenbus_dev.h:
38 ln -sf $(XEN_ROOT)/linux-2.6-xen-sparse/include/asm-xen/linux-public/xenbus_dev.h $@
40 xenstored: xenstored_core.o xenstored_watch.o xenstored_domain.o xenstored_transaction.o xs_lib.o talloc.o utils.o
41 $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -lxenctrl -o $@
43 $(CLIENTS): xenstore-%: xenstore_%.o
44 $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -lxenctrl -L. -lxenstore -o $@
46 $(CLIENTS_OBJS): xenstore_%.o: xenstore_client.c
47 $(COMPILE.c) -DCLIENT_$(*F) -o $@ $<
49 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
50 $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@
52 xs_test: xs_test.o xs_lib.o utils.o
53 xs_random: xs_random.o xs_test_lib.o xs_lib.o talloc.o utils.o
54 xs_stress: xs_stress.o xs_test_lib.o xs_lib.o talloc.o utils.o
55 xs_crashme: xs_crashme.o xs_lib.o talloc.o utils.o
57 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)
59 xenstored_%_test.o: xenstored_%.c
60 $(COMPILE.c) -o $@ $<
62 xs_test_lib.o: xs.c
63 $(COMPILE.c) -o $@ $<
65 talloc_test.o: talloc.c
66 $(COMPILE.c) -o $@ $<
68 libxenstore.so: xs.opic xs_lib.opic
69 $(CC) $(CFLAGS) $(LDFLAGS) -Wl,-soname -Wl,libxenstore.so -shared -o $@ $^
71 clean: testsuite-clean
72 rm -f *.o *.opic *.so
73 rm -f xen xenstored xs_random xs_stress xs_crashme
74 rm -f xs_test xenstored_test xs_dom0_test
75 $(RM) $(PROG_DEP)
77 print-dir:
78 @echo -n tools/xenstore:
80 print-end:
81 @echo
83 check: print-dir testsuite-fast randomcheck-fast print-end
85 fullcheck: testsuite-run randomcheck stresstest
87 testsuite-run: xen xenstored_test xs_test
88 $(TESTENV) testsuite/test.sh && echo
90 testsuite-fast: xen xenstored_test xs_test
91 @$(TESTENV) testsuite/test.sh --fast
93 testsuite-clean:
94 rm -rf $(TESTDIR)
96 # Make this visible so they can see repeat tests without --fast if they
97 # fail.
98 RANDSEED=$(shell date +%s)
99 randomcheck: xs_random xenstored_test
100 $(TESTENV) ./xs_random --simple --fast /tmp/xs_random 200000 $(RANDSEED) && echo
101 $(TESTENV) ./xs_random --fast /tmp/xs_random 100000 $(RANDSEED) && echo
102 $(TESTENV) ./xs_random --fail /tmp/xs_random 10000 $(RANDSEED)
104 crashme: xs_crashme xenstored_test
105 rm -rf $(TESTDIR)/store $(TESTDIR)/transactions /tmp/xs_crashme.vglog* /tmp/trace
106 export $(TESTENV); ./xs_crashme 5000 $(RANDSEED) 2>/dev/null
107 if [ -n "`cat /tmp/xs_crashme.vglog*`" ]; then echo Valgrind complained; cat /tmp/xs_crashme.vglog*; exit 1; fi
108 rm -rf $(TESTDIR)/store $(TESTDIR)/transactions /tmp/xs_crashme.vglog* /tmp/trace
110 randomcheck-fast: xs_random xenstored_test
111 @$(TESTENV) ./xs_random --fast /tmp/xs_random 2000 $(RANDSEED)
113 stresstest: xs_stress xenstored_test
114 rm -rf $(TESTDIR)/store $(TESTDIR)/transactions
115 export $(TESTENV); PID=`./xenstored_test --output-pid --trace-file=/tmp/trace`; ./xs_stress 5000; ret=$$?; kill $$PID; exit $$ret
117 xs_dom0_test: xs_dom0_test.o utils.o
118 $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -lxenctrl -o $@
120 TAGS:
121 etags `find . -name '*.[ch]'`
123 tarball: clean
124 cd .. && tar -c -j -v -h -f xenstore.tar.bz2 xenstore/
126 install: libxenstore.so xenstored $(CLIENTS)
127 $(INSTALL_DIR) -p $(DESTDIR)/var/run/xenstored
128 $(INSTALL_DIR) -p $(DESTDIR)/var/lib/xenstored
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: