ia64/xen-unstable

view tools/xenstore/Makefile @ 10775:f07effe5097b

The blktap commit reverted the change so that libxenstore gets
installed executable. :/ Updated patch to fix things again

Signed-off-by: Jeremy Katz <katzj@redhat.com>
author kfraser@localhost.localdomain
date Tue Jul 25 11:41:18 2006 +0100 (2006-07-25)
parents 2937703f0ed0
children d71e72d8532c
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+= $(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 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
32 XENSTORED_Linux = xenstored_linux.o
34 XENSTORED_OBJS += $(XENSTORED_$(OS))
36 .PHONY: all
37 all: libxenstore.so libxenstore.a xenstored $(CLIENTS) xs_tdb_dump xenstore-control xenstore-ls
39 test_interleaved_transactions: test_interleaved_transactions.o
40 $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -L. -lxenstore -o $@
42 .PHONY: testcode
43 testcode: xs_test xenstored_test xs_random
45 xenstored: $(XENSTORED_OBJS)
46 $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -lxenctrl -o $@
48 $(CLIENTS): xenstore-%: xenstore_%.o libxenstore.so
49 $(LINK.o) $< $(LOADLIBES) $(LDLIBS) -L. -lxenstore -o $@
51 $(CLIENTS_OBJS): xenstore_%.o: xenstore_client.c
52 $(COMPILE.c) -DCLIENT_$(*F) -o $@ $<
54 xenstore-control: xenstore_control.o libxenstore.so
55 $(LINK.o) $< $(LOADLIBES) $(LDLIBS) -L. -lxenstore -o $@
57 xenstore-ls: xsls.o libxenstore.so
58 $(LINK.o) $< $(LOADLIBES) $(LDLIBS) -L. -lxenstore -o $@
60 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
61 $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@
63 xs_tdb_dump: xs_tdb_dump.o utils.o tdb.o talloc.o
64 $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@
66 xs_test xs_random xs_stress xs_crashme: LDFLAGS+=-lpthread
67 xs_test: xs_test.o xs_lib.o utils.o
68 xs_random: xs_random.o xs_test_lib.o xs_lib.o talloc.o utils.o
69 xs_stress: xs_stress.o xs_test_lib.o xs_lib.o talloc.o utils.o
70 xs_crashme: xs_crashme.o xs_lib.o talloc.o utils.o
72 speedtest: speedtest.o xs.o xs_lib.o utils.o talloc.o
74 .PHONY: check-speed
75 check-speed: speedtest xenstored_test $(TESTDIR)
76 $(TESTENV) time ./speedtest 100
78 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)
80 xenstored_%_test.o: xenstored_%.c
81 $(COMPILE.c) -o $@ $<
83 xs_test_lib.o: xs.c
84 $(COMPILE.c) -o $@ $<
86 talloc_test.o: talloc.c
87 $(COMPILE.c) -o $@ $<
89 libxenstore.so: xs.opic xs_lib.opic
90 $(CC) $(CFLAGS) $(LDFLAGS) -Wl,-soname -Wl,libxenstore.so -shared -o $@ $^ -lpthread
92 libxenstore.a: libxenstore.so
93 ar rcs libxenstore.a $^
95 .PHONY: clean
96 clean: testsuite-clean
97 rm -f *.o *.opic *.so
98 rm -f xenstored xs_random xs_stress xs_crashme
99 rm -f xs_test xenstored_test xs_tdb_dump xenstore-control xenstore-ls
100 rm -f $(CLIENTS)
101 $(RM) $(PROG_DEP)
103 .PHONY: print-dir
104 print-dir:
105 @echo -n tools/xenstore:
107 .PHONY: print-end
108 print-end:
109 @echo
111 .PHONY: check
112 check: print-dir testsuite-fast randomcheck-fast print-end
114 .PHONY: fullcheck
115 fullcheck: testsuite-run randomcheck stresstest
117 $(TESTDIR):
118 mkdir $@
120 .PHONY: testsuite-run
121 testsuite-run: xenstored_test xs_test $(TESTDIR)
122 $(TESTENV) testsuite/test.sh && echo
124 .PHONY: testsuite-fast
125 testsuite-fast: xenstored_test xs_test $(TESTDIR)
126 @$(TESTENV) testsuite/test.sh --fast
128 .PHONY: testsuite-clean
129 testsuite-clean:
130 rm -rf $(TESTDIR)
132 # Make this visible so they can see repeat tests without --fast if they
133 # fail.
134 RANDSEED=$(shell date +%s)
135 .PHONY: randomcheck
136 randomcheck: xs_random xenstored_test $(TESTDIR)
137 $(TESTENV) ./xs_random --simple --fast /tmp/xs_random 200000 $(RANDSEED) && echo
138 $(TESTENV) ./xs_random --fast /tmp/xs_random 100000 $(RANDSEED) && echo
139 # $(TESTENV) ./xs_random --fail /tmp/xs_random 10000 $(RANDSEED)
141 .PHONY: crashme
142 crashme: xs_crashme xenstored_test $(TESTDIR)
143 rm -rf $(TESTDIR)/store $(TESTDIR)/transactions /tmp/xs_crashme.vglog* /tmp/trace
144 export $(TESTENV); ./xs_crashme 5000 $(RANDSEED) 2>/dev/null
145 if [ -n "`cat /tmp/xs_crashme.vglog*`" ]; then echo Valgrind complained; cat /tmp/xs_crashme.vglog*; exit 1; fi
146 rm -rf $(TESTDIR)/store $(TESTDIR)/transactions /tmp/xs_crashme.vglog* /tmp/trace
148 .PHONY: randomcheck-fast
149 randomcheck-fast: xs_random xenstored_test $(TESTDIR)
150 @$(TESTENV) ./xs_random --fast /tmp/xs_random 2000 $(RANDSEED)
152 .PHONY: stresstest
153 stresstest: xs_stress xenstored_test $(TESTDIR)
154 rm -rf $(TESTDIR)/store $(TESTDIR)/transactions
155 export $(TESTENV); PID=`./xenstored_test --output-pid --trace-file=/tmp/trace`; ./xs_stress 5000; ret=$$?; kill $$PID; exit $$ret
157 .PHONY: TAGS
158 TAGS:
159 etags `find . -name '*.[ch]'`
161 .PHONY: tarball
162 tarball: clean
163 cd .. && tar -c -j -v -h -f xenstore.tar.bz2 xenstore/
165 .PHONY: install
166 install: all
167 $(INSTALL_DIR) -p $(DESTDIR)/var/run/xenstored
168 $(INSTALL_DIR) -p $(DESTDIR)/var/lib/xenstored
169 $(INSTALL_DIR) -p $(DESTDIR)/usr/bin
170 $(INSTALL_DIR) -p $(DESTDIR)/usr/sbin
171 $(INSTALL_DIR) -p $(DESTDIR)/usr/include
172 $(INSTALL_PROG) xenstored $(DESTDIR)/usr/sbin
173 $(INSTALL_PROG) $(CLIENTS) $(DESTDIR)/usr/bin
174 $(INSTALL_PROG) xenstore-control $(DESTDIR)/usr/bin
175 $(INSTALL_PROG) xenstore-ls $(DESTDIR)/usr/bin
176 $(INSTALL_DIR) -p $(DESTDIR)/usr/$(LIBDIR)
177 $(INSTALL_PROG) libxenstore.so* $(DESTDIR)/usr/$(LIBDIR)
178 $(INSTALL_DATA) libxenstore.a $(DESTDIR)/usr/$(LIBDIR)
179 $(INSTALL_DATA) xs.h $(DESTDIR)/usr/include
180 $(INSTALL_DATA) xs_lib.h $(DESTDIR)/usr/include
182 -include $(PROG_DEP)
184 # never delete any intermediate files.
185 .SECONDARY: