ia64/xen-unstable

view tools/xenstore/Makefile @ 6768:282d5698ea40

Add xenstore-list and xenstore-exists clients
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
author cl349@firebug.cl.cam.ac.uk
date Mon Sep 12 20:46:37 2005 +0000 (2005-09-12)
parents 7d0fb56b4a91
children 80afc502461b
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.
20 BASECFLAGS+= -I$(XEN_ROOT)/linux-2.6-xen-sparse/include/asm-xen/linux-public
22 CFLAGS += $(BASECFLAGS)
23 LDFLAGS += $(PROFILE) -L$(XEN_LIBXC)
24 TESTDIR = `pwd`/testsuite/tmp
25 TESTFLAGS= -DTESTING
26 TESTENV = XENSTORED_ROOTDIR=$(TESTDIR) XENSTORED_RUNDIR=$(TESTDIR)
28 CLIENTS := xenstore-exists xenstore-list xenstore-read xenstore-rm
29 CLIENTS += xenstore-write
30 CLIENTS_OBJS := $(patsubst xenstore-%,xenstore_%.o,$(CLIENTS))
32 all: libxenstore.so xenstored $(CLIENTS)
34 testcode: xs_test xenstored_test xs_random xs_dom0_test
36 xenstored: xenstored_core.o xenstored_watch.o xenstored_domain.o xenstored_transaction.o xs_lib.o talloc.o utils.o
37 $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -lxenctrl -o $@
39 $(CLIENTS): libxenstore.so
40 $(CLIENTS): xenstore-%: xenstore_%.o
41 $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -lxenctrl -L. -lxenstore -o $@
43 $(CLIENTS_OBJS): xenstore_%.o: xenstore_client.c
44 $(COMPILE.c) -DCLIENT_$(*F) -o $@ $<
46 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
47 $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@
49 xs_test: xs_test.o xs_lib.o utils.o
50 xs_random: xs_random.o xs_test_lib.o xs_lib.o talloc.o utils.o
51 xs_stress: xs_stress.o xs_test_lib.o xs_lib.o talloc.o utils.o
52 xs_crashme: xs_crashme.o xs_lib.o talloc.o utils.o
54 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)
56 xenstored_%_test.o: xenstored_%.c
57 $(COMPILE.c) -o $@ $<
59 xs_test_lib.o: xs.c
60 $(COMPILE.c) -o $@ $<
62 talloc_test.o: talloc.c
63 $(COMPILE.c) -o $@ $<
65 libxenstore.so: xs.opic xs_lib.opic
66 $(CC) $(CFLAGS) $(LDFLAGS) -Wl,-soname -Wl,libxenstore.so -shared -o $@ $^
68 clean: testsuite-clean
69 rm -f *.o *.opic *.so
70 rm -f xenstored xs_random xs_stress xs_crashme
71 rm -f xs_test xenstored_test xs_dom0_test
72 $(RM) $(PROG_DEP)
74 print-dir:
75 @echo -n tools/xenstore:
77 print-end:
78 @echo
80 check: print-dir testsuite-fast randomcheck-fast print-end
82 fullcheck: testsuite-run randomcheck stresstest
84 testsuite-run: xenstored_test xs_test
85 $(TESTENV) testsuite/test.sh && echo
87 testsuite-fast: xenstored_test xs_test
88 @$(TESTENV) testsuite/test.sh --fast
90 testsuite-clean:
91 rm -rf $(TESTDIR)
93 # Make this visible so they can see repeat tests without --fast if they
94 # fail.
95 RANDSEED=$(shell date +%s)
96 randomcheck: xs_random xenstored_test
97 $(TESTENV) ./xs_random --simple --fast /tmp/xs_random 200000 $(RANDSEED) && echo
98 $(TESTENV) ./xs_random --fast /tmp/xs_random 100000 $(RANDSEED) && echo
99 $(TESTENV) ./xs_random --fail /tmp/xs_random 10000 $(RANDSEED)
101 crashme: xs_crashme xenstored_test
102 rm -rf $(TESTDIR)/store $(TESTDIR)/transactions /tmp/xs_crashme.vglog* /tmp/trace
103 export $(TESTENV); ./xs_crashme 5000 $(RANDSEED) 2>/dev/null
104 if [ -n "`cat /tmp/xs_crashme.vglog*`" ]; then echo Valgrind complained; cat /tmp/xs_crashme.vglog*; exit 1; fi
105 rm -rf $(TESTDIR)/store $(TESTDIR)/transactions /tmp/xs_crashme.vglog* /tmp/trace
107 randomcheck-fast: xs_random xenstored_test
108 @$(TESTENV) ./xs_random --fast /tmp/xs_random 2000 $(RANDSEED)
110 stresstest: xs_stress xenstored_test
111 rm -rf $(TESTDIR)/store $(TESTDIR)/transactions
112 export $(TESTENV); PID=`./xenstored_test --output-pid --trace-file=/tmp/trace`; ./xs_stress 5000; ret=$$?; kill $$PID; exit $$ret
114 xs_dom0_test: xs_dom0_test.o utils.o
115 $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -lxenctrl -o $@
117 TAGS:
118 etags `find . -name '*.[ch]'`
120 tarball: clean
121 cd .. && tar -c -j -v -h -f xenstore.tar.bz2 xenstore/
123 install: libxenstore.so xenstored $(CLIENTS)
124 $(INSTALL_DIR) -p $(DESTDIR)/var/run/xenstored
125 $(INSTALL_DIR) -p $(DESTDIR)/var/lib/xenstored
126 $(INSTALL_DIR) -p $(DESTDIR)/usr/bin
127 $(INSTALL_DIR) -p $(DESTDIR)/usr/sbin
128 $(INSTALL_DIR) -p $(DESTDIR)/usr/include
129 $(INSTALL_PROG) xenstored $(DESTDIR)/usr/sbin
130 $(INSTALL_PROG) $(CLIENTS) $(DESTDIR)/usr/bin
131 $(INSTALL_DIR) -p $(DESTDIR)/usr/$(LIBDIR)
132 $(INSTALL_DATA) libxenstore.so $(DESTDIR)/usr/$(LIBDIR)
133 $(INSTALL_DATA) xs.h $(DESTDIR)/usr/include
134 $(INSTALL_DATA) xs_lib.h $(DESTDIR)/usr/include
136 -include $(PROG_DEP)
138 # never delete any intermediate files.
139 .SECONDARY: