ia64/xen-unstable

view tools/xenstore/Makefile @ 6552:a9873d384da4

Merge.
author adsharma@los-vmm.sc.intel.com
date Thu Aug 25 12:24:48 2005 -0700 (2005-08-25)
parents 112d44270733 fa0754a9f64f
children dfaf788ab18c
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.a libxenstore-pic.a
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 LIB_OBJS := xs.o xs_lib.o
58 LIB_OBJS_A := $(patsubst %.o,libxenstore.a(%.o),$(LIB_OBJS))
59 LIB_OBJS_PIC := $(patsubst %.o,libxenstore-pic.a(%.opic),$(LIB_OBJS))
61 libxenstore.a: $(LIB_OBJS_A)
63 libxenstore-pic.a: $(LIB_OBJS_PIC)
65 clean: testsuite-clean
66 rm -f *.o *.opic *.a
67 rm -f xen xenstored xs_random xs_stress xs_crashme
68 rm -f xs_test xenstored_test xs_dom0_test
69 -$(RM) $(PROG_DEP)
71 print-dir:
72 @echo -n tools/xenstore:
74 print-end:
75 @echo
77 check: print-dir testsuite-fast randomcheck-fast print-end
79 fullcheck: testsuite-run randomcheck stresstest
81 testsuite-run: xen xenstored_test xs_test
82 $(TESTENV) testsuite/test.sh && echo
84 testsuite-fast: xen xenstored_test xs_test
85 @$(TESTENV) testsuite/test.sh --fast
87 testsuite-clean:
88 rm -rf $(TESTDIR)
90 # Make this visible so they can see repeat tests without --fast if they
91 # fail.
92 RANDSEED=$(shell date +%s)
93 randomcheck: xs_random xenstored_test
94 $(TESTENV) ./xs_random --simple --fast /tmp/xs_random 200000 $(RANDSEED) && echo
95 $(TESTENV) ./xs_random --fast /tmp/xs_random 100000 $(RANDSEED) && echo
96 $(TESTENV) ./xs_random --fail /tmp/xs_random 10000 $(RANDSEED)
98 crashme: xs_crashme xenstored_test
99 rm -rf $(TESTDIR)/store $(TESTDIR)/transactions /tmp/xs_crashme.vglog* /tmp/trace
100 export $(TESTENV); ./xs_crashme 5000 $(RANDSEED) 2>/dev/null
101 if [ -n "`cat /tmp/xs_crashme.vglog*`" ]; then echo Valgrind complained; cat /tmp/xs_crashme.vglog*; exit 1; fi
102 rm -rf $(TESTDIR)/store $(TESTDIR)/transactions /tmp/xs_crashme.vglog* /tmp/trace
104 randomcheck-fast: xs_random xenstored_test
105 @$(TESTENV) ./xs_random --fast /tmp/xs_random 2000 $(RANDSEED)
107 stresstest: xs_stress xenstored_test
108 rm -rf $(TESTDIR)/store $(TESTDIR)/transactions
109 export $(TESTENV); PID=`./xenstored_test --output-pid --trace-file=/tmp/trace`; ./xs_stress 5000; ret=$$?; kill $$PID; exit $$ret
111 xs_dom0_test: xs_dom0_test.o utils.o
112 $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -lxenctrl -o $@
114 TAGS:
115 etags `find . -name '*.[ch]'`
117 tarball: clean
118 cd .. && tar -c -j -v -h -f xenstore.tar.bz2 xenstore/
120 install: xenstored libxenstore.a libxenstore-pic.a
121 $(INSTALL_DIR) -p $(DESTDIR)/var/run/xenstored
122 $(INSTALL_DIR) -p $(DESTDIR)/var/lib/xenstored
123 $(INSTALL_DIR) -p $(DESTDIR)/usr/sbin
124 $(INSTALL_DIR) -p $(DESTDIR)/usr/include
125 $(INSTALL_PROG) xenstored $(DESTDIR)/usr/sbin
126 $(INSTALL_DIR) -p $(DESTDIR)/usr/$(LIBDIR)
127 $(INSTALL_DATA) libxenstore.a $(DESTDIR)/usr/$(LIBDIR)
128 $(INSTALL_DATA) libxenstore-pic.a $(DESTDIR)/usr/$(LIBDIR)
129 $(INSTALL_DATA) xs.h $(DESTDIR)/usr/include
130 $(INSTALL_DATA) xs_lib.h $(DESTDIR)/usr/include
132 -include $(PROG_DEP)
134 # never delete any intermediate files.
135 .SECONDARY: