ia64/xen-unstable

view tools/xenstore/Makefile @ 6422:e24fd7012ffb

merge?
author cl349@firebug.cl.cam.ac.uk
date Thu Aug 25 10:09:39 2005 +0000 (2005-08-25)
parents 2f20c2fce2c5 6e899a3840b2
children 4abd299ef2f6
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 all: xen xenstored libxenstore.so
29 testcode: xen xs_test xenstored_test xs_random xs_dom0_test
31 xen:
32 ln -sf $(XEN_ROOT)/xen/include/public $@
34 xenstored: xenstored_core.o xenstored_watch.o xenstored_domain.o xenstored_transaction.o xs_lib.o talloc.o utils.o
35 $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -lxenctrl -o $@
37 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
38 $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@
40 xs_test: xs_test.o xs_lib.o utils.o
41 xs_random: xs_random.o xs_test_lib.o xs_lib.o talloc.o utils.o
42 xs_stress: xs_stress.o xs_test_lib.o xs_lib.o talloc.o utils.o
43 xs_crashme: xs_crashme.o xs_lib.o talloc.o utils.o
45 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)
47 xenstored_%_test.o: xenstored_%.c
48 $(COMPILE.c) -o $@ $<
50 xs_test_lib.o: xs.c
51 $(COMPILE.c) -o $@ $<
53 talloc_test.o: talloc.c
54 $(COMPILE.c) -o $@ $<
56 libxenstore.so: xs.opic xs_lib.opic
57 $(CC) $(CFLAGS) $(LDFLAGS) -Wl,-soname -Wl,libxenstore.so -shared -o $@ $^
59 clean: testsuite-clean
60 rm -f *.o *.opic *.so
61 rm -f xen xenstored xs_random xs_stress xs_crashme
62 rm -f xs_test xenstored_test xs_dom0_test
63 $(RM) $(PROG_DEP)
65 print-dir:
66 @echo -n tools/xenstore:
68 print-end:
69 @echo
71 check: print-dir testsuite-fast randomcheck-fast print-end
73 fullcheck: testsuite-run randomcheck stresstest
75 testsuite-run: xen xenstored_test xs_test
76 $(TESTENV) testsuite/test.sh && echo
78 testsuite-fast: xen xenstored_test xs_test
79 @$(TESTENV) testsuite/test.sh --fast
81 testsuite-clean:
82 rm -rf $(TESTDIR)
84 # Make this visible so they can see repeat tests without --fast if they
85 # fail.
86 RANDSEED=$(shell date +%s)
87 randomcheck: xs_random xenstored_test
88 $(TESTENV) ./xs_random --simple --fast /tmp/xs_random 200000 $(RANDSEED) && echo
89 $(TESTENV) ./xs_random --fast /tmp/xs_random 100000 $(RANDSEED) && echo
90 $(TESTENV) ./xs_random --fail /tmp/xs_random 10000 $(RANDSEED)
92 crashme: xs_crashme xenstored_test
93 rm -rf $(TESTDIR)/store $(TESTDIR)/transactions /tmp/xs_crashme.vglog* /tmp/trace
94 export $(TESTENV); ./xs_crashme 5000 $(RANDSEED) 2>/dev/null
95 if [ -n "`cat /tmp/xs_crashme.vglog*`" ]; then echo Valgrind complained; cat /tmp/xs_crashme.vglog*; exit 1; fi
96 rm -rf $(TESTDIR)/store $(TESTDIR)/transactions /tmp/xs_crashme.vglog* /tmp/trace
98 randomcheck-fast: xs_random xenstored_test
99 @$(TESTENV) ./xs_random --fast /tmp/xs_random 2000 $(RANDSEED)
101 stresstest: xs_stress xenstored_test
102 rm -rf $(TESTDIR)/store $(TESTDIR)/transactions
103 export $(TESTENV); PID=`./xenstored_test --output-pid --trace-file=/tmp/trace`; ./xs_stress 5000; ret=$$?; kill $$PID; exit $$ret
105 xs_dom0_test: xs_dom0_test.o utils.o
106 $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -lxenctrl -o $@
108 TAGS:
109 etags `find . -name '*.[ch]'`
111 tarball: clean
112 cd .. && tar -c -j -v -h -f xenstore.tar.bz2 xenstore/
114 install: xenstored libxenstore.so
115 $(INSTALL_DIR) -p $(DESTDIR)/var/run/xenstored
116 $(INSTALL_DIR) -p $(DESTDIR)/var/lib/xenstored
117 $(INSTALL_DIR) -p $(DESTDIR)/usr/sbin
118 $(INSTALL_DIR) -p $(DESTDIR)/usr/include
119 $(INSTALL_PROG) xenstored $(DESTDIR)/usr/sbin
120 $(INSTALL_DIR) -p $(DESTDIR)/usr/$(LIBDIR)
121 $(INSTALL_DATA) libxenstore.so $(DESTDIR)/usr/$(LIBDIR)
122 $(INSTALL_DATA) xs.h $(DESTDIR)/usr/include
123 $(INSTALL_DATA) xs_lib.h $(DESTDIR)/usr/include
125 -include $(PROG_DEP)
127 # never delete any intermediate files.
128 .SECONDARY: