ia64/xen-unstable

view tools/xenstore/Makefile @ 9669:c783f340bef8

Remove some bogus .PHONY Makefile declarations.
Fixes xentop installation.

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Tue Apr 11 09:58:04 2006 +0100 (2006-04-11)
parents b454a09cddb1
children 041127f2c687
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 .PHONY: all
31 all: libxenstore.so xenstored $(CLIENTS) xs_tdb_dump xenstore-control xenstore-ls
33 test_interleaved_transactions: test_interleaved_transactions.o
34 $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -L. -lxenstore -o $@
36 .PHONY: testcode
37 testcode: xs_test xenstored_test xs_random
39 xenstored: xenstored_core.o xenstored_watch.o xenstored_domain.o xenstored_transaction.o xs_lib.o talloc.o utils.o tdb.o hashtable.o
40 $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -lxenctrl -o $@
42 $(CLIENTS): xenstore-%: xenstore_%.o libxenstore.so
43 $(LINK.o) $< $(LOADLIBES) $(LDLIBS) -L. -lxenstore -o $@
45 $(CLIENTS_OBJS): xenstore_%.o: xenstore_client.c
46 $(COMPILE.c) -DCLIENT_$(*F) -o $@ $<
48 xenstore-control: xenstore_control.o libxenstore.so
49 $(LINK.o) $< $(LOADLIBES) $(LDLIBS) -L. -lxenstore -o $@
51 xenstore-ls: xsls.o libxenstore.so
52 $(LINK.o) $< $(LOADLIBES) $(LDLIBS) -L. -lxenstore -o $@
54 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
55 $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@
57 xs_tdb_dump: xs_tdb_dump.o utils.o tdb.o talloc.o
58 $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@
60 xs_test xs_random xs_stress xs_crashme: LDFLAGS+=-lpthread
61 xs_test: xs_test.o xs_lib.o utils.o
62 xs_random: xs_random.o xs_test_lib.o xs_lib.o talloc.o utils.o
63 xs_stress: xs_stress.o xs_test_lib.o xs_lib.o talloc.o utils.o
64 xs_crashme: xs_crashme.o xs_lib.o talloc.o utils.o
66 speedtest: speedtest.o xs.o xs_lib.o utils.o talloc.o
68 .PHONY: check-speed
69 check-speed: speedtest xenstored_test $(TESTDIR)
70 $(TESTENV) time ./speedtest 100
72 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)
74 xenstored_%_test.o: xenstored_%.c
75 $(COMPILE.c) -o $@ $<
77 xs_test_lib.o: xs.c
78 $(COMPILE.c) -o $@ $<
80 talloc_test.o: talloc.c
81 $(COMPILE.c) -o $@ $<
83 libxenstore.so: xs.opic xs_lib.opic
84 $(CC) $(CFLAGS) $(LDFLAGS) -Wl,-soname -Wl,libxenstore.so -shared -o $@ $^ -lpthread
86 .PHONY: clean
87 clean: testsuite-clean
88 rm -f *.o *.opic *.so
89 rm -f xenstored xs_random xs_stress xs_crashme
90 rm -f xs_test xenstored_test xs_tdb_dump xenstore-control xenstore-ls
91 rm -f $(CLIENTS)
92 $(RM) $(PROG_DEP)
94 .PHONY: print-dir
95 print-dir:
96 @echo -n tools/xenstore:
98 .PHONY: print-end
99 print-end:
100 @echo
102 .PHONY: check
103 check: print-dir testsuite-fast randomcheck-fast print-end
105 .PHONY: fullcheck
106 fullcheck: testsuite-run randomcheck stresstest
108 $(TESTDIR):
109 mkdir $@
111 .PHONY: testsuite-run
112 testsuite-run: xenstored_test xs_test $(TESTDIR)
113 $(TESTENV) testsuite/test.sh && echo
115 .PHONY: testsuite-fast
116 testsuite-fast: xenstored_test xs_test $(TESTDIR)
117 @$(TESTENV) testsuite/test.sh --fast
119 .PHONY: testsuite-clean
120 testsuite-clean:
121 rm -rf $(TESTDIR)
123 # Make this visible so they can see repeat tests without --fast if they
124 # fail.
125 RANDSEED=$(shell date +%s)
126 .PHONY: randomcheck
127 randomcheck: xs_random xenstored_test $(TESTDIR)
128 $(TESTENV) ./xs_random --simple --fast /tmp/xs_random 200000 $(RANDSEED) && echo
129 $(TESTENV) ./xs_random --fast /tmp/xs_random 100000 $(RANDSEED) && echo
130 # $(TESTENV) ./xs_random --fail /tmp/xs_random 10000 $(RANDSEED)
132 .PHONY: crashme
133 crashme: xs_crashme xenstored_test $(TESTDIR)
134 rm -rf $(TESTDIR)/store $(TESTDIR)/transactions /tmp/xs_crashme.vglog* /tmp/trace
135 export $(TESTENV); ./xs_crashme 5000 $(RANDSEED) 2>/dev/null
136 if [ -n "`cat /tmp/xs_crashme.vglog*`" ]; then echo Valgrind complained; cat /tmp/xs_crashme.vglog*; exit 1; fi
137 rm -rf $(TESTDIR)/store $(TESTDIR)/transactions /tmp/xs_crashme.vglog* /tmp/trace
139 .PHONY: randomcheck-fast
140 randomcheck-fast: xs_random xenstored_test $(TESTDIR)
141 @$(TESTENV) ./xs_random --fast /tmp/xs_random 2000 $(RANDSEED)
143 .PHONY: stresstest
144 stresstest: xs_stress xenstored_test $(TESTDIR)
145 rm -rf $(TESTDIR)/store $(TESTDIR)/transactions
146 export $(TESTENV); PID=`./xenstored_test --output-pid --trace-file=/tmp/trace`; ./xs_stress 5000; ret=$$?; kill $$PID; exit $$ret
148 .PHONY: TAGS
149 TAGS:
150 etags `find . -name '*.[ch]'`
152 .PHONY: tarball
153 tarball: clean
154 cd .. && tar -c -j -v -h -f xenstore.tar.bz2 xenstore/
156 .PHONY: install
157 install: all
158 $(INSTALL_DIR) -p $(DESTDIR)/var/run/xenstored
159 $(INSTALL_DIR) -p $(DESTDIR)/var/lib/xenstored
160 $(INSTALL_DIR) -p $(DESTDIR)/usr/bin
161 $(INSTALL_DIR) -p $(DESTDIR)/usr/sbin
162 $(INSTALL_DIR) -p $(DESTDIR)/usr/include
163 $(INSTALL_PROG) xenstored $(DESTDIR)/usr/sbin
164 $(INSTALL_PROG) $(CLIENTS) $(DESTDIR)/usr/bin
165 $(INSTALL_PROG) xenstore-control $(DESTDIR)/usr/bin
166 $(INSTALL_PROG) xenstore-ls $(DESTDIR)/usr/bin
167 $(INSTALL_DIR) -p $(DESTDIR)/usr/$(LIBDIR)
168 $(INSTALL_DATA) libxenstore.so $(DESTDIR)/usr/$(LIBDIR)
169 $(INSTALL_DATA) xs.h $(DESTDIR)/usr/include
170 $(INSTALL_DATA) xs_lib.h $(DESTDIR)/usr/include
172 -include $(PROG_DEP)
174 # never delete any intermediate files.
175 .SECONDARY: