xen-vtx-unstable

annotate tools/xenstore/Makefile @ 6774:4d899a738d59

merge?
author cl349@firebug.cl.cam.ac.uk
date Tue Sep 13 15:05:49 2005 +0000 (2005-09-13)
parents f804b28871ba 7d0fb56b4a91
children e7c7196fa329 8ca0f98ba8e2
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@6628 11 BASECFLAGS=-Wall -W -g -Werror
cl349@5357 12 # Make gcc generate dependencies.
cl349@5357 13 BASECFLAGS += -Wp,-MD,.$(@F).d
cl349@5357 14 PROG_DEP = .*.d
kaf24@6635 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@6612 19 BASECFLAGS+= -I.
cl349@5357 20
kaf24@5694 21 CFLAGS += $(BASECFLAGS)
kaf24@5694 22 LDFLAGS += $(PROFILE) -L$(XEN_LIBXC)
cl349@6752 23 TESTDIR = testsuite/tmp
kaf24@5694 24 TESTFLAGS= -DTESTING
kaf24@5694 25 TESTENV = XENSTORED_ROOTDIR=$(TESTDIR) XENSTORED_RUNDIR=$(TESTDIR)
cl349@5357 26
cl349@6748 27 CLIENTS := xenstore-exists xenstore-list xenstore-read xenstore-rm
cl349@6748 28 CLIENTS += xenstore-write
cl349@6601 29 CLIENTS_OBJS := $(patsubst xenstore-%,xenstore_%.o,$(CLIENTS))
cl349@6601 30
cl349@6610 31 all: libxenstore.so xenstored $(CLIENTS)
cl349@5357 32
cl349@6610 33 testcode: xs_test xenstored_test xs_random xs_dom0_test
cl349@6601 34
cl349@5357 35 xenstored: xenstored_core.o xenstored_watch.o xenstored_domain.o xenstored_transaction.o xs_lib.o talloc.o utils.o
cl349@6388 36 $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -lxenctrl -o $@
cl349@5357 37
cl349@6626 38 $(CLIENTS): libxenstore.so
cl349@6601 39 $(CLIENTS): xenstore-%: xenstore_%.o
cl349@6601 40 $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -lxenctrl -L. -lxenstore -o $@
cl349@6601 41
cl349@6601 42 $(CLIENTS_OBJS): xenstore_%.o: xenstore_client.c
cl349@6601 43 $(COMPILE.c) -DCLIENT_$(*F) -o $@ $<
cl349@6601 44
cl349@5357 45 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 46 $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@
cl349@5357 47
cl349@5357 48 xs_test: xs_test.o xs_lib.o utils.o
cl349@5357 49 xs_random: xs_random.o xs_test_lib.o xs_lib.o talloc.o utils.o
cl349@5357 50 xs_stress: xs_stress.o xs_test_lib.o xs_lib.o talloc.o utils.o
kaf24@6043 51 xs_crashme: xs_crashme.o xs_lib.o talloc.o utils.o
cl349@5357 52
kaf24@6043 53 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 54
cl349@5357 55 xenstored_%_test.o: xenstored_%.c
cl349@5357 56 $(COMPILE.c) -o $@ $<
cl349@5357 57
cl349@5357 58 xs_test_lib.o: xs.c
cl349@5357 59 $(COMPILE.c) -o $@ $<
cl349@5357 60
cl349@5357 61 talloc_test.o: talloc.c
cl349@5357 62 $(COMPILE.c) -o $@ $<
cl349@5357 63
kaf24@6127 64 libxenstore.so: xs.opic xs_lib.opic
kaf24@6127 65 $(CC) $(CFLAGS) $(LDFLAGS) -Wl,-soname -Wl,libxenstore.so -shared -o $@ $^
cl349@5357 66
cl349@5357 67 clean: testsuite-clean
kaf24@6127 68 rm -f *.o *.opic *.so
cl349@6610 69 rm -f xenstored xs_random xs_stress xs_crashme
cl349@5478 70 rm -f xs_test xenstored_test xs_dom0_test
kaf24@6127 71 $(RM) $(PROG_DEP)
cl349@5357 72
kaf24@6024 73 print-dir:
kaf24@6024 74 @echo -n tools/xenstore:
kaf24@6024 75
kaf24@6024 76 print-end:
kaf24@6024 77 @echo
kaf24@6024 78
kaf24@6024 79 check: print-dir testsuite-fast randomcheck-fast print-end
kaf24@6024 80
kaf24@6024 81 fullcheck: testsuite-run randomcheck stresstest
cl349@5357 82
cl349@6752 83 $(TESTDIR):
cl349@6752 84 mkdir $@
cl349@6752 85
cl349@6752 86 testsuite-run: xenstored_test xs_test $(TESTDIR)
kaf24@6024 87 $(TESTENV) testsuite/test.sh && echo
kaf24@6024 88
cl349@6752 89 testsuite-fast: xenstored_test xs_test $(TESTDIR)
kaf24@6024 90 @$(TESTENV) testsuite/test.sh --fast
cl349@5357 91
cl349@5357 92 testsuite-clean:
cl349@5357 93 rm -rf $(TESTDIR)
cl349@5357 94
cl349@5357 95 # Make this visible so they can see repeat tests without --fast if they
cl349@5357 96 # fail.
cl349@5357 97 RANDSEED=$(shell date +%s)
cl349@6752 98 randomcheck: xs_random xenstored_test $(TESTDIR)
kaf24@6024 99 $(TESTENV) ./xs_random --simple --fast /tmp/xs_random 200000 $(RANDSEED) && echo
kaf24@6024 100 $(TESTENV) ./xs_random --fast /tmp/xs_random 100000 $(RANDSEED) && echo
cl349@5357 101 $(TESTENV) ./xs_random --fail /tmp/xs_random 10000 $(RANDSEED)
cl349@5357 102
cl349@6752 103 crashme: xs_crashme xenstored_test $(TESTDIR)
kaf24@6043 104 rm -rf $(TESTDIR)/store $(TESTDIR)/transactions /tmp/xs_crashme.vglog* /tmp/trace
kaf24@6043 105 export $(TESTENV); ./xs_crashme 5000 $(RANDSEED) 2>/dev/null
kaf24@6043 106 if [ -n "`cat /tmp/xs_crashme.vglog*`" ]; then echo Valgrind complained; cat /tmp/xs_crashme.vglog*; exit 1; fi
kaf24@6043 107 rm -rf $(TESTDIR)/store $(TESTDIR)/transactions /tmp/xs_crashme.vglog* /tmp/trace
kaf24@6043 108
cl349@6752 109 randomcheck-fast: xs_random xenstored_test $(TESTDIR)
kaf24@6043 110 @$(TESTENV) ./xs_random --fast /tmp/xs_random 2000 $(RANDSEED)
kaf24@6024 111
cl349@6752 112 stresstest: xs_stress xenstored_test $(TESTDIR)
cl349@5853 113 rm -rf $(TESTDIR)/store $(TESTDIR)/transactions
cl349@5751 114 export $(TESTENV); PID=`./xenstored_test --output-pid --trace-file=/tmp/trace`; ./xs_stress 5000; ret=$$?; kill $$PID; exit $$ret
cl349@5357 115
cl349@5476 116 xs_dom0_test: xs_dom0_test.o utils.o
cl349@6388 117 $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -lxenctrl -o $@
cl349@5476 118
cl349@5357 119 TAGS:
cl349@5357 120 etags `find . -name '*.[ch]'`
cl349@5357 121
cl349@5357 122 tarball: clean
cl349@5357 123 cd .. && tar -c -j -v -h -f xenstore.tar.bz2 xenstore/
cl349@5357 124
cl349@6601 125 install: libxenstore.so xenstored $(CLIENTS)
cl349@5357 126 $(INSTALL_DIR) -p $(DESTDIR)/var/run/xenstored
cl349@5357 127 $(INSTALL_DIR) -p $(DESTDIR)/var/lib/xenstored
shand@6613 128 $(INSTALL_DIR) -p $(DESTDIR)/usr/bin
cl349@5357 129 $(INSTALL_DIR) -p $(DESTDIR)/usr/sbin
kaf24@5418 130 $(INSTALL_DIR) -p $(DESTDIR)/usr/include
cl349@5357 131 $(INSTALL_PROG) xenstored $(DESTDIR)/usr/sbin
cl349@6601 132 $(INSTALL_PROG) $(CLIENTS) $(DESTDIR)/usr/bin
cl349@5357 133 $(INSTALL_DIR) -p $(DESTDIR)/usr/$(LIBDIR)
kaf24@6127 134 $(INSTALL_DATA) libxenstore.so $(DESTDIR)/usr/$(LIBDIR)
kaf24@5418 135 $(INSTALL_DATA) xs.h $(DESTDIR)/usr/include
kaf24@5418 136 $(INSTALL_DATA) xs_lib.h $(DESTDIR)/usr/include
cl349@5357 137
cl349@5357 138 -include $(PROG_DEP)
cl349@5475 139
cl349@5475 140 # never delete any intermediate files.
cl349@5475 141 .SECONDARY: