ia64/xen-unstable

annotate tools/xenstore/Makefile @ 6435:b4b3f6be5226

merge?
author cl349@firebug.cl.cam.ac.uk
date Thu Aug 25 17:27:49 2005 +0000 (2005-08-25)
parents 0610add7c3fe 6e899a3840b2
children 8799d14bef77 9312a3e8a6f8 112d44270733
rev   line source
cl349@5357 1 XEN_ROOT=../..
kaf24@5403 2 include $(XEN_ROOT)/tools/Rules.mk
cl349@5357 3 XEN_LIBXC = $(XEN_ROOT)/tools/libxc
cl349@5357 4
cl349@5357 5 INSTALL = install
cl349@5357 6 INSTALL_DATA = $(INSTALL) -m0644
cl349@5357 7 INSTALL_PROG = $(INSTALL) -m0755
cl349@5357 8 INSTALL_DIR = $(INSTALL) -d -m0755
cl349@5357 9
cl349@5357 10 PROFILE=#-pg
cl349@5357 11 BASECFLAGS=-Wall -W -g
cl349@5357 12 # Make gcc generate dependencies.
cl349@5357 13 BASECFLAGS += -Wp,-MD,.$(@F).d
cl349@5357 14 PROG_DEP = .*.d
cl349@5357 15 #BASECFLAGS+= -O3 $(PROFILE)
cl349@5357 16 #BASECFLAGS+= -I$(XEN_ROOT)/tools
cl349@5357 17 BASECFLAGS+= -I$(XEN_ROOT)/tools/libxc
cl349@5357 18 BASECFLAGS+= -I$(XEN_ROOT)/xen/include/public
cl349@5357 19 BASECFLAGS+= -I.
cl349@5357 20
kaf24@5694 21 CFLAGS += $(BASECFLAGS)
kaf24@5694 22 LDFLAGS += $(PROFILE) -L$(XEN_LIBXC)
kaf24@5694 23 TESTDIR = `pwd`/testsuite/tmp
kaf24@5694 24 TESTFLAGS= -DTESTING
kaf24@5694 25 TESTENV = XENSTORED_ROOTDIR=$(TESTDIR) XENSTORED_RUNDIR=$(TESTDIR)
cl349@5357 26
kaf24@6142 27 all: xen xenstored libxenstore.so
cl349@5357 28
cl349@5476 29 testcode: xen xs_test xenstored_test xs_random xs_dom0_test
cl349@5357 30
cl349@5357 31 xen:
cl349@5357 32 ln -sf $(XEN_ROOT)/xen/include/public $@
cl349@5357 33
cl349@5357 34 xenstored: xenstored_core.o xenstored_watch.o xenstored_domain.o xenstored_transaction.o xs_lib.o talloc.o utils.o
cl349@6403 35 $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -lxenctrl -o $@
cl349@5357 36
cl349@5357 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
cl349@5357 38 $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@
cl349@5357 39
cl349@5357 40 xs_test: xs_test.o xs_lib.o utils.o
cl349@5357 41 xs_random: xs_random.o xs_test_lib.o xs_lib.o talloc.o utils.o
cl349@5357 42 xs_stress: xs_stress.o xs_test_lib.o xs_lib.o talloc.o utils.o
kaf24@6058 43 xs_crashme: xs_crashme.o xs_lib.o talloc.o utils.o
cl349@5357 44
kaf24@6058 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)
cl349@5357 46
cl349@5357 47 xenstored_%_test.o: xenstored_%.c
cl349@5357 48 $(COMPILE.c) -o $@ $<
cl349@5357 49
cl349@5357 50 xs_test_lib.o: xs.c
cl349@5357 51 $(COMPILE.c) -o $@ $<
cl349@5357 52
cl349@5357 53 talloc_test.o: talloc.c
cl349@5357 54 $(COMPILE.c) -o $@ $<
cl349@5357 55
kaf24@6142 56 libxenstore.so: xs.opic xs_lib.opic
kaf24@6142 57 $(CC) $(CFLAGS) $(LDFLAGS) -Wl,-soname -Wl,libxenstore.so -shared -o $@ $^
cl349@5357 58
cl349@5357 59 clean: testsuite-clean
kaf24@6142 60 rm -f *.o *.opic *.so
kaf24@6058 61 rm -f xen xenstored xs_random xs_stress xs_crashme
cl349@5478 62 rm -f xs_test xenstored_test xs_dom0_test
kaf24@6142 63 $(RM) $(PROG_DEP)
cl349@5357 64
kaf24@6039 65 print-dir:
kaf24@6039 66 @echo -n tools/xenstore:
kaf24@6039 67
kaf24@6039 68 print-end:
kaf24@6039 69 @echo
kaf24@6039 70
kaf24@6039 71 check: print-dir testsuite-fast randomcheck-fast print-end
kaf24@6039 72
kaf24@6039 73 fullcheck: testsuite-run randomcheck stresstest
cl349@5357 74
cl349@5357 75 testsuite-run: xen xenstored_test xs_test
kaf24@6039 76 $(TESTENV) testsuite/test.sh && echo
kaf24@6039 77
kaf24@6039 78 testsuite-fast: xen xenstored_test xs_test
kaf24@6039 79 @$(TESTENV) testsuite/test.sh --fast
cl349@5357 80
cl349@5357 81 testsuite-clean:
cl349@5357 82 rm -rf $(TESTDIR)
cl349@5357 83
cl349@5357 84 # Make this visible so they can see repeat tests without --fast if they
cl349@5357 85 # fail.
cl349@5357 86 RANDSEED=$(shell date +%s)
cl349@5357 87 randomcheck: xs_random xenstored_test
kaf24@6039 88 $(TESTENV) ./xs_random --simple --fast /tmp/xs_random 200000 $(RANDSEED) && echo
kaf24@6039 89 $(TESTENV) ./xs_random --fast /tmp/xs_random 100000 $(RANDSEED) && echo
cl349@5357 90 $(TESTENV) ./xs_random --fail /tmp/xs_random 10000 $(RANDSEED)
cl349@5357 91
kaf24@6058 92 crashme: xs_crashme xenstored_test
kaf24@6058 93 rm -rf $(TESTDIR)/store $(TESTDIR)/transactions /tmp/xs_crashme.vglog* /tmp/trace
kaf24@6058 94 export $(TESTENV); ./xs_crashme 5000 $(RANDSEED) 2>/dev/null
kaf24@6058 95 if [ -n "`cat /tmp/xs_crashme.vglog*`" ]; then echo Valgrind complained; cat /tmp/xs_crashme.vglog*; exit 1; fi
kaf24@6058 96 rm -rf $(TESTDIR)/store $(TESTDIR)/transactions /tmp/xs_crashme.vglog* /tmp/trace
kaf24@6058 97
kaf24@6039 98 randomcheck-fast: xs_random xenstored_test
kaf24@6058 99 @$(TESTENV) ./xs_random --fast /tmp/xs_random 2000 $(RANDSEED)
kaf24@6039 100
kaf24@6058 101 stresstest: xs_stress xenstored_test
cl349@5869 102 rm -rf $(TESTDIR)/store $(TESTDIR)/transactions
cl349@5751 103 export $(TESTENV); PID=`./xenstored_test --output-pid --trace-file=/tmp/trace`; ./xs_stress 5000; ret=$$?; kill $$PID; exit $$ret
cl349@5357 104
cl349@5476 105 xs_dom0_test: xs_dom0_test.o utils.o
cl349@6403 106 $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -lxenctrl -o $@
cl349@5476 107
cl349@5357 108 TAGS:
cl349@5357 109 etags `find . -name '*.[ch]'`
cl349@5357 110
cl349@5357 111 tarball: clean
cl349@5357 112 cd .. && tar -c -j -v -h -f xenstore.tar.bz2 xenstore/
cl349@5357 113
kaf24@6142 114 install: xenstored libxenstore.so
cl349@5357 115 $(INSTALL_DIR) -p $(DESTDIR)/var/run/xenstored
cl349@5357 116 $(INSTALL_DIR) -p $(DESTDIR)/var/lib/xenstored
cl349@5357 117 $(INSTALL_DIR) -p $(DESTDIR)/usr/sbin
kaf24@5418 118 $(INSTALL_DIR) -p $(DESTDIR)/usr/include
cl349@5357 119 $(INSTALL_PROG) xenstored $(DESTDIR)/usr/sbin
cl349@5357 120 $(INSTALL_DIR) -p $(DESTDIR)/usr/$(LIBDIR)
kaf24@6142 121 $(INSTALL_DATA) libxenstore.so $(DESTDIR)/usr/$(LIBDIR)
kaf24@5418 122 $(INSTALL_DATA) xs.h $(DESTDIR)/usr/include
kaf24@5418 123 $(INSTALL_DATA) xs_lib.h $(DESTDIR)/usr/include
cl349@5357 124
cl349@5357 125 -include $(PROG_DEP)
cl349@5475 126
cl349@5475 127 # never delete any intermediate files.
cl349@5475 128 .SECONDARY: