ia64/xen-unstable

annotate tools/xenstore/Makefile @ 10911:8f452e26224a

[TOOLS] Modify xenstore_client.c to include a new utility, xenstore-chmod.
This utility permits developers and administrators to
manually change the permissions on arbitrary locations in XenStore
from the command line. This is often helpful if you're trying to debug an
application that relies on XenStore and is encountering difficulties
with permissions.

Signed-off-by: Michael LeMay <mdlemay@epoch.ncsc.mil>
author kfraser@localhost.localdomain
date Wed Aug 02 14:58:37 2006 +0100 (2006-08-02)
parents d323acca28a2
children 7ed73735fd30
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
kfraser@10782 5 MAJOR = 3.0
kfraser@10782 6 MINOR = 0
kfraser@10782 7
cl349@5357 8 INSTALL = install
cl349@5357 9 INSTALL_DATA = $(INSTALL) -m0644
cl349@5357 10 INSTALL_PROG = $(INSTALL) -m0755
cl349@5357 11 INSTALL_DIR = $(INSTALL) -d -m0755
cl349@5357 12
cl349@5357 13 PROFILE=#-pg
kaf24@7295 14 BASECFLAGS=-Wall -g -Werror
cl349@5357 15 # Make gcc generate dependencies.
cl349@5357 16 BASECFLAGS += -Wp,-MD,.$(@F).d
cl349@5357 17 PROG_DEP = .*.d
kaf24@9213 18 BASECFLAGS+= $(PROFILE)
cl349@5357 19 #BASECFLAGS+= -I$(XEN_ROOT)/tools
cl349@5357 20 BASECFLAGS+= -I$(XEN_ROOT)/tools/libxc
cl349@6630 21 BASECFLAGS+= -I.
cl349@5357 22
kaf24@5694 23 CFLAGS += $(BASECFLAGS)
kaf24@5694 24 LDFLAGS += $(PROFILE) -L$(XEN_LIBXC)
cl349@6772 25 TESTDIR = testsuite/tmp
kaf24@5694 26 TESTFLAGS= -DTESTING
kaf24@5694 27 TESTENV = XENSTORED_ROOTDIR=$(TESTDIR) XENSTORED_RUNDIR=$(TESTDIR)
cl349@5357 28
kfraser@10911 29 CLIENTS := xenstore-exists xenstore-list xenstore-read xenstore-rm xenstore-chmod
cl349@6768 30 CLIENTS += xenstore-write
cl349@6619 31 CLIENTS_OBJS := $(patsubst xenstore-%,xenstore_%.o,$(CLIENTS))
cl349@6619 32
kaf24@10169 33 XENSTORED_OBJS = xenstored_core.o xenstored_watch.o xenstored_domain.o xenstored_transaction.o xs_lib.o talloc.o utils.o tdb.o hashtable.o
kaf24@10169 34
kaf24@10169 35 XENSTORED_Linux = xenstored_linux.o
kaf24@10169 36
kaf24@10169 37 XENSTORED_OBJS += $(XENSTORED_$(OS))
kaf24@10169 38
kaf24@9660 39 .PHONY: all
jchesterfield@10736 40 all: libxenstore.so libxenstore.a xenstored $(CLIENTS) xs_tdb_dump xenstore-control xenstore-ls
emellor@9093 41
emellor@9093 42 test_interleaved_transactions: test_interleaved_transactions.o
emellor@9093 43 $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -L. -lxenstore -o $@
cl349@5357 44
kaf24@9660 45 .PHONY: testcode
kaf24@7246 46 testcode: xs_test xenstored_test xs_random
cl349@6619 47
kaf24@10169 48 xenstored: $(XENSTORED_OBJS)
cl349@6403 49 $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -lxenctrl -o $@
cl349@5357 50
kaf24@7376 51 $(CLIENTS): xenstore-%: xenstore_%.o libxenstore.so
emellor@9093 52 $(LINK.o) $< $(LOADLIBES) $(LDLIBS) -L. -lxenstore -o $@
cl349@6619 53
cl349@6619 54 $(CLIENTS_OBJS): xenstore_%.o: xenstore_client.c
cl349@6619 55 $(COMPILE.c) -DCLIENT_$(*F) -o $@ $<
cl349@6619 56
emellor@9093 57 xenstore-control: xenstore_control.o libxenstore.so
emellor@9093 58 $(LINK.o) $< $(LOADLIBES) $(LDLIBS) -L. -lxenstore -o $@
emellor@9093 59
kaf24@8630 60 xenstore-ls: xsls.o libxenstore.so
emellor@9093 61 $(LINK.o) $< $(LOADLIBES) $(LDLIBS) -L. -lxenstore -o $@
emellor@7315 62
rusty@7039 63 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
rusty@7039 64 $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@
rusty@7039 65
rusty@7039 66 xs_tdb_dump: xs_tdb_dump.o utils.o tdb.o talloc.o
cl349@5357 67 $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@
cl349@5357 68
kaf24@7277 69 xs_test xs_random xs_stress xs_crashme: LDFLAGS+=-lpthread
cl349@5357 70 xs_test: xs_test.o xs_lib.o utils.o
cl349@5357 71 xs_random: xs_random.o xs_test_lib.o xs_lib.o talloc.o utils.o
cl349@5357 72 xs_stress: xs_stress.o xs_test_lib.o xs_lib.o talloc.o utils.o
kaf24@6058 73 xs_crashme: xs_crashme.o xs_lib.o talloc.o utils.o
cl349@5357 74
rusty@7038 75 speedtest: speedtest.o xs.o xs_lib.o utils.o talloc.o
rusty@7038 76
kaf24@9660 77 .PHONY: check-speed
rusty@7038 78 check-speed: speedtest xenstored_test $(TESTDIR)
rusty@7038 79 $(TESTENV) time ./speedtest 100
rusty@7038 80
kaf24@6058 81 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 82
cl349@5357 83 xenstored_%_test.o: xenstored_%.c
cl349@5357 84 $(COMPILE.c) -o $@ $<
cl349@5357 85
cl349@5357 86 xs_test_lib.o: xs.c
cl349@5357 87 $(COMPILE.c) -o $@ $<
cl349@5357 88
cl349@5357 89 talloc_test.o: talloc.c
cl349@5357 90 $(COMPILE.c) -o $@ $<
cl349@5357 91
kfraser@10782 92 libxenstore.so: libxenstore.so.$(MAJOR)
kfraser@10782 93 ln -sf $< $@
kfraser@10782 94 libxenstore.so.$(MAJOR): libxenstore.so.$(MAJOR).$(MINOR)
kfraser@10782 95 ln -sf $< $@
cl349@5357 96
kfraser@10782 97 libxenstore.so.$(MAJOR).$(MINOR): xs.opic xs_lib.opic
kfraser@10782 98 $(CC) $(CFLAGS) $(LDFLAGS) -Wl,-soname -Wl,libxenstore.so.$(MAJOR) -shared -o $@ $^ -lpthread
kfraser@10782 99
kfraser@10782 100 libxenstore.a: xs.o xs_lib.o
jchesterfield@10736 101 ar rcs libxenstore.a $^
jchesterfield@10736 102
kaf24@9660 103 .PHONY: clean
cl349@5357 104 clean: testsuite-clean
kfraser@10895 105 rm -f *.a *.o *.opic *.so*
cl349@6628 106 rm -f xenstored xs_random xs_stress xs_crashme
emellor@9093 107 rm -f xs_test xenstored_test xs_tdb_dump xenstore-control xenstore-ls
emellor@9093 108 rm -f $(CLIENTS)
kaf24@6142 109 $(RM) $(PROG_DEP)
cl349@5357 110
kaf24@9660 111 .PHONY: print-dir
kaf24@6039 112 print-dir:
kaf24@6039 113 @echo -n tools/xenstore:
kaf24@6039 114
kaf24@9660 115 .PHONY: print-end
kaf24@6039 116 print-end:
kaf24@6039 117 @echo
kaf24@6039 118
kaf24@9660 119 .PHONY: check
kaf24@6039 120 check: print-dir testsuite-fast randomcheck-fast print-end
kaf24@6039 121
kaf24@9660 122 .PHONY: fullcheck
kaf24@6039 123 fullcheck: testsuite-run randomcheck stresstest
cl349@5357 124
cl349@6772 125 $(TESTDIR):
cl349@6772 126 mkdir $@
cl349@6772 127
kaf24@9660 128 .PHONY: testsuite-run
cl349@6772 129 testsuite-run: xenstored_test xs_test $(TESTDIR)
kaf24@6039 130 $(TESTENV) testsuite/test.sh && echo
kaf24@6039 131
kaf24@9660 132 .PHONY: testsuite-fast
cl349@6772 133 testsuite-fast: xenstored_test xs_test $(TESTDIR)
kaf24@6039 134 @$(TESTENV) testsuite/test.sh --fast
cl349@5357 135
kaf24@9660 136 .PHONY: testsuite-clean
cl349@5357 137 testsuite-clean:
cl349@5357 138 rm -rf $(TESTDIR)
cl349@5357 139
cl349@5357 140 # Make this visible so they can see repeat tests without --fast if they
cl349@5357 141 # fail.
cl349@5357 142 RANDSEED=$(shell date +%s)
kaf24@9660 143 .PHONY: randomcheck
cl349@6772 144 randomcheck: xs_random xenstored_test $(TESTDIR)
kaf24@6039 145 $(TESTENV) ./xs_random --simple --fast /tmp/xs_random 200000 $(RANDSEED) && echo
kaf24@6039 146 $(TESTENV) ./xs_random --fast /tmp/xs_random 100000 $(RANDSEED) && echo
rusty@7039 147 # $(TESTENV) ./xs_random --fail /tmp/xs_random 10000 $(RANDSEED)
cl349@5357 148
kaf24@9660 149 .PHONY: crashme
cl349@6772 150 crashme: xs_crashme xenstored_test $(TESTDIR)
kaf24@6058 151 rm -rf $(TESTDIR)/store $(TESTDIR)/transactions /tmp/xs_crashme.vglog* /tmp/trace
kaf24@6058 152 export $(TESTENV); ./xs_crashme 5000 $(RANDSEED) 2>/dev/null
kaf24@6058 153 if [ -n "`cat /tmp/xs_crashme.vglog*`" ]; then echo Valgrind complained; cat /tmp/xs_crashme.vglog*; exit 1; fi
kaf24@6058 154 rm -rf $(TESTDIR)/store $(TESTDIR)/transactions /tmp/xs_crashme.vglog* /tmp/trace
kaf24@6058 155
kaf24@9660 156 .PHONY: randomcheck-fast
cl349@6772 157 randomcheck-fast: xs_random xenstored_test $(TESTDIR)
kaf24@6058 158 @$(TESTENV) ./xs_random --fast /tmp/xs_random 2000 $(RANDSEED)
kaf24@6039 159
kaf24@9660 160 .PHONY: stresstest
cl349@6772 161 stresstest: xs_stress xenstored_test $(TESTDIR)
cl349@5869 162 rm -rf $(TESTDIR)/store $(TESTDIR)/transactions
cl349@5751 163 export $(TESTENV); PID=`./xenstored_test --output-pid --trace-file=/tmp/trace`; ./xs_stress 5000; ret=$$?; kill $$PID; exit $$ret
cl349@5357 164
kaf24@9660 165 .PHONY: TAGS
cl349@5357 166 TAGS:
cl349@5357 167 etags `find . -name '*.[ch]'`
cl349@5357 168
kaf24@9660 169 .PHONY: tarball
cl349@5357 170 tarball: clean
cl349@5357 171 cd .. && tar -c -j -v -h -f xenstore.tar.bz2 xenstore/
cl349@5357 172
kaf24@9660 173 .PHONY: install
emellor@9093 174 install: all
cl349@5357 175 $(INSTALL_DIR) -p $(DESTDIR)/var/run/xenstored
cl349@5357 176 $(INSTALL_DIR) -p $(DESTDIR)/var/lib/xenstored
shand@6631 177 $(INSTALL_DIR) -p $(DESTDIR)/usr/bin
cl349@5357 178 $(INSTALL_DIR) -p $(DESTDIR)/usr/sbin
kaf24@5418 179 $(INSTALL_DIR) -p $(DESTDIR)/usr/include
cl349@5357 180 $(INSTALL_PROG) xenstored $(DESTDIR)/usr/sbin
cl349@6619 181 $(INSTALL_PROG) $(CLIENTS) $(DESTDIR)/usr/bin
emellor@9093 182 $(INSTALL_PROG) xenstore-control $(DESTDIR)/usr/bin
kaf24@8630 183 $(INSTALL_PROG) xenstore-ls $(DESTDIR)/usr/bin
cl349@5357 184 $(INSTALL_DIR) -p $(DESTDIR)/usr/$(LIBDIR)
kfraser@10782 185 $(INSTALL_PROG) libxenstore.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)
kfraser@10782 186 ln -sf libxenstore.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)/libxenstore.so.$(MAJOR)
kfraser@10782 187 ln -sf libxenstore.so.$(MAJOR) $(DESTDIR)/usr/$(LIBDIR)/libxenstore.so
kfraser@10775 188 $(INSTALL_DATA) libxenstore.a $(DESTDIR)/usr/$(LIBDIR)
kaf24@5418 189 $(INSTALL_DATA) xs.h $(DESTDIR)/usr/include
kaf24@5418 190 $(INSTALL_DATA) xs_lib.h $(DESTDIR)/usr/include
cl349@5357 191
cl349@5357 192 -include $(PROG_DEP)
cl349@5475 193
cl349@5475 194 # never delete any intermediate files.
cl349@5475 195 .SECONDARY: