debuggers.hg

view tools/xenstore/Makefile @ 22848:6341fe0f4e5a

Added tag 4.1.0-rc2 for changeset 9dca60d88c63
author Keir Fraser <keir@xen.org>
date Tue Jan 25 14:06:55 2011 +0000 (2011-01-25)
parents bfb3c97ef507
children
line source
1 XEN_ROOT=../..
2 include $(XEN_ROOT)/tools/Rules.mk
4 MAJOR = 3.0
5 MINOR = 0
7 CFLAGS += -Werror
8 CFLAGS += -I.
9 CFLAGS += $(CFLAGS_libxenctrl)
11 CLIENTS := xenstore-exists xenstore-list xenstore-read xenstore-rm xenstore-chmod
12 CLIENTS += xenstore-write xenstore-ls xenstore-watch
14 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
16 XENSTORED_OBJS_$(CONFIG_Linux) = xenstored_linux.o
17 XENSTORED_OBJS_$(CONFIG_SunOS) = xenstored_solaris.o xenstored_probes.o
18 XENSTORED_OBJS_$(CONFIG_NetBSD) = xenstored_netbsd.o
20 XENSTORED_OBJS += $(XENSTORED_OBJS_y)
22 ifneq ($(XENSTORE_STATIC_CLIENTS),y)
23 LIBXENSTORE := libxenstore.so
24 else
25 LIBXENSTORE := libxenstore.a
26 xenstore xenstore-control: CFLAGS += -static
27 endif
29 ALL_TARGETS = libxenstore.so libxenstore.a clients xs_tdb_dump xenstored
31 .PHONY: all
32 all: $(ALL_TARGETS)
34 .PHONY: clients
35 clients: xenstore $(CLIENTS) xenstore-control
37 ifeq ($(CONFIG_SunOS),y)
38 xenstored_probes.h: xenstored_probes.d
39 dtrace -C -h -s xenstored_probes.d
41 xenstored_solaris.o: xenstored_probes.h
43 xenstored_probes.o: xenstored_solaris.o
44 dtrace -C -G -s xenstored_probes.d xenstored_solaris.o
46 CFLAGS += -DHAVE_DTRACE=1
47 endif
49 xenstored: $(XENSTORED_OBJS)
50 $(CC) $(CFLAGS) $(LDFLAGS) $^ $(LDLIBS_libxenctrl) $(SOCKET_LIBS) -o $@
52 $(CLIENTS): xenstore
53 ln -f xenstore $@
55 xenstore: xenstore_client.o $(LIBXENSTORE)
56 $(CC) $(CFLAGS) $(LDFLAGS) $< -L. -lxenstore $(SOCKET_LIBS) -o $@
58 xenstore-control: xenstore_control.o $(LIBXENSTORE)
59 $(CC) $(CFLAGS) $(LDFLAGS) $< -L. -lxenstore $(SOCKET_LIBS) -o $@
61 xs_tdb_dump: xs_tdb_dump.o utils.o tdb.o talloc.o
62 $(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@
64 libxenstore.so: libxenstore.so.$(MAJOR)
65 ln -sf $< $@
66 libxenstore.so.$(MAJOR): libxenstore.so.$(MAJOR).$(MINOR)
67 ln -sf $< $@
69 xs.opic: CFLAGS += -DUSE_PTHREAD
71 libxenstore.so.$(MAJOR).$(MINOR): xs.opic xs_lib.opic
72 $(CC) $(CFLAGS) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenstore.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $^ $(SOCKET_LIBS) -lpthread
74 libxenstore.a: xs.o xs_lib.o
75 $(AR) rcs $@ $^
77 .PHONY: clean
78 clean:
79 rm -f *.a *.o *.opic *.so* xenstored_probes.h
80 rm -f xenstored xs_random xs_stress xs_crashme
81 rm -f xs_tdb_dump xenstore-control
82 rm -f xenstore $(CLIENTS)
83 $(RM) $(DEPS)
85 .PHONY: TAGS
86 TAGS:
87 etags `find . -name '*.[ch]'`
89 .PHONY: tarball
90 tarball: clean
91 cd .. && tar -c -j -v -h -f xenstore.tar.bz2 xenstore/
93 .PHONY: install
94 install: all
95 $(INSTALL_DIR) $(DESTDIR)$(BINDIR)
96 $(INSTALL_DIR) $(DESTDIR)$(SBINDIR)
97 $(INSTALL_DIR) $(DESTDIR)$(INCLUDEDIR)
98 $(INSTALL_DIR) $(DESTDIR)/var/run/xenstored
99 $(INSTALL_DIR) $(DESTDIR)/var/lib/xenstored
100 $(INSTALL_PROG) xenstored $(DESTDIR)$(SBINDIR)
101 $(INSTALL_PROG) xenstore-control $(DESTDIR)$(BINDIR)
102 $(INSTALL_PROG) xenstore $(DESTDIR)$(BINDIR)
103 set -e ; for c in $(CLIENTS) ; do \
104 ln -f $(DESTDIR)$(BINDIR)/xenstore $(DESTDIR)$(BINDIR)/$${c} ; \
105 done
106 $(INSTALL_DIR) $(DESTDIR)$(LIBDIR)
107 $(INSTALL_PROG) libxenstore.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)
108 ln -sf libxenstore.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)/libxenstore.so.$(MAJOR)
109 ln -sf libxenstore.so.$(MAJOR) $(DESTDIR)$(LIBDIR)/libxenstore.so
110 $(INSTALL_DATA) libxenstore.a $(DESTDIR)$(LIBDIR)
111 $(INSTALL_DATA) xs.h $(DESTDIR)$(INCLUDEDIR)
112 $(INSTALL_DATA) xs_lib.h $(DESTDIR)$(INCLUDEDIR)
114 -include $(DEPS)
116 # never delete any intermediate files.
117 .SECONDARY: