direct-io.hg

view tools/xenstore/Makefile @ 7308:959d33fbd660

Added xsls to xenstore Makefile install dependencies to fix "make dist".

Signed-off-by: James Bulpin <james@xensource.com>
author jrb44@freefall.cl.cam.ac.uk
date Tue Oct 11 14:26:23 2005 +0100 (2005-10-11)
parents dfadbb90d092
children 74d56b7ff46c
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 -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.
20 CFLAGS += $(BASECFLAGS)
21 LDFLAGS += $(PROFILE) -L$(XEN_LIBXC)
22 TESTDIR = testsuite/tmp
23 TESTFLAGS= -DTESTING
24 TESTENV = XENSTORED_ROOTDIR=$(TESTDIR) XENSTORED_RUNDIR=$(TESTDIR)
26 CLIENTS := xenstore-exists xenstore-list xenstore-read xenstore-rm
27 CLIENTS += xenstore-write
28 CLIENTS_OBJS := $(patsubst xenstore-%,xenstore_%.o,$(CLIENTS))
30 all: libxenstore.so xenstored $(CLIENTS) xs_tdb_dump xsls
32 testcode: xs_test xenstored_test xs_random
34 xenstored: xenstored_core.o xenstored_watch.o xenstored_domain.o xenstored_transaction.o xs_lib.o talloc.o utils.o tdb.o
35 $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -lxenctrl -o $@
37 $(CLIENTS): xenstore-%: xenstore_%.o
38 $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -lxenctrl -L. -lxenstore -o $@
40 $(CLIENTS_OBJS): xenstore_%.o: xenstore_client.c
41 $(COMPILE.c) -DCLIENT_$(*F) -o $@ $<
43 xsls: xsls.o
44 $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -lxenctrl -L. -lxenstore -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 tdb.o
47 $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@
49 xs_tdb_dump: xs_tdb_dump.o utils.o tdb.o talloc.o
50 $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@
52 xs_test xs_random xs_stress xs_crashme: LDFLAGS+=-lpthread
53 xs_test: xs_test.o xs_lib.o utils.o
54 xs_random: xs_random.o xs_test_lib.o xs_lib.o talloc.o utils.o
55 xs_stress: xs_stress.o xs_test_lib.o xs_lib.o talloc.o utils.o
56 xs_crashme: xs_crashme.o xs_lib.o talloc.o utils.o
58 speedtest: speedtest.o xs.o xs_lib.o utils.o talloc.o
60 check-speed: speedtest xenstored_test $(TESTDIR)
61 $(TESTENV) time ./speedtest 100
63 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)
65 xenstored_%_test.o: xenstored_%.c
66 $(COMPILE.c) -o $@ $<
68 xs_test_lib.o: xs.c
69 $(COMPILE.c) -o $@ $<
71 talloc_test.o: talloc.c
72 $(COMPILE.c) -o $@ $<
74 libxenstore.so: xs.opic xs_lib.opic
75 $(CC) $(CFLAGS) $(LDFLAGS) -Wl,-soname -Wl,libxenstore.so -shared -o $@ $^ -lpthread
77 clean: testsuite-clean
78 rm -f *.o *.opic *.so
79 rm -f xenstored xs_random xs_stress xs_crashme
80 rm -f xs_test xenstored_test
81 $(RM) $(PROG_DEP)
83 print-dir:
84 @echo -n tools/xenstore:
86 print-end:
87 @echo
89 check: print-dir testsuite-fast randomcheck-fast print-end
91 fullcheck: testsuite-run randomcheck stresstest
93 $(TESTDIR):
94 mkdir $@
96 testsuite-run: xenstored_test xs_test $(TESTDIR)
97 $(TESTENV) testsuite/test.sh && echo
99 testsuite-fast: xenstored_test xs_test $(TESTDIR)
100 @$(TESTENV) testsuite/test.sh --fast
102 testsuite-clean:
103 rm -rf $(TESTDIR)
105 # Make this visible so they can see repeat tests without --fast if they
106 # fail.
107 RANDSEED=$(shell date +%s)
108 randomcheck: xs_random xenstored_test $(TESTDIR)
109 $(TESTENV) ./xs_random --simple --fast /tmp/xs_random 200000 $(RANDSEED) && echo
110 $(TESTENV) ./xs_random --fast /tmp/xs_random 100000 $(RANDSEED) && echo
111 # $(TESTENV) ./xs_random --fail /tmp/xs_random 10000 $(RANDSEED)
113 crashme: xs_crashme xenstored_test $(TESTDIR)
114 rm -rf $(TESTDIR)/store $(TESTDIR)/transactions /tmp/xs_crashme.vglog* /tmp/trace
115 export $(TESTENV); ./xs_crashme 5000 $(RANDSEED) 2>/dev/null
116 if [ -n "`cat /tmp/xs_crashme.vglog*`" ]; then echo Valgrind complained; cat /tmp/xs_crashme.vglog*; exit 1; fi
117 rm -rf $(TESTDIR)/store $(TESTDIR)/transactions /tmp/xs_crashme.vglog* /tmp/trace
119 randomcheck-fast: xs_random xenstored_test $(TESTDIR)
120 @$(TESTENV) ./xs_random --fast /tmp/xs_random 2000 $(RANDSEED)
122 stresstest: xs_stress xenstored_test $(TESTDIR)
123 rm -rf $(TESTDIR)/store $(TESTDIR)/transactions
124 export $(TESTENV); PID=`./xenstored_test --output-pid --trace-file=/tmp/trace`; ./xs_stress 5000; ret=$$?; kill $$PID; exit $$ret
126 TAGS:
127 etags `find . -name '*.[ch]'`
129 tarball: clean
130 cd .. && tar -c -j -v -h -f xenstore.tar.bz2 xenstore/
132 install: libxenstore.so xenstored xsls $(CLIENTS)
133 $(INSTALL_DIR) -p $(DESTDIR)/var/run/xenstored
134 $(INSTALL_DIR) -p $(DESTDIR)/var/lib/xenstored
135 $(INSTALL_DIR) -p $(DESTDIR)/usr/bin
136 $(INSTALL_DIR) -p $(DESTDIR)/usr/sbin
137 $(INSTALL_DIR) -p $(DESTDIR)/usr/include
138 $(INSTALL_PROG) xenstored $(DESTDIR)/usr/sbin
139 $(INSTALL_PROG) $(CLIENTS) $(DESTDIR)/usr/bin
140 $(INSTALL_PROG) xsls $(DESTDIR)/usr/bin
141 $(INSTALL_DIR) -p $(DESTDIR)/usr/$(LIBDIR)
142 $(INSTALL_DATA) libxenstore.so $(DESTDIR)/usr/$(LIBDIR)
143 $(INSTALL_DATA) xs.h $(DESTDIR)/usr/include
144 $(INSTALL_DATA) xs_lib.h $(DESTDIR)/usr/include
146 -include $(PROG_DEP)
148 # never delete any intermediate files.
149 .SECONDARY: