ia64/xen-unstable

view tools/xenstore/Makefile @ 16894:b9004e222fde

Move generation of public header hierarchy into the tools.

This patch merges the two versions of public header generation
currently used in the build into one.

Signed-off-by: Bastian Blank <waldi@debian.org>
author Keir Fraser <keir.fraser@citrix.com>
date Sat Jan 26 10:38:44 2008 +0000 (2008-01-26)
parents 71012e36922c
children ddf454872de4
line source
1 XEN_ROOT=../..
2 include $(XEN_ROOT)/tools/Rules.mk
3 XEN_LIBXC = $(XEN_ROOT)/tools/libxc
5 MAJOR = 3.0
6 MINOR = 0
8 PROFILE=#-pg
9 BASECFLAGS=-Werror
10 # Make gcc generate dependencies.
11 BASECFLAGS += -Wp,-MD,.$(@F).d
12 PROG_DEP = .*.d
13 BASECFLAGS+= $(PROFILE)
14 BASECFLAGS+= -I$(XEN_ROOT)/tools/libxc
15 BASECFLAGS+= -I.
16 BASECFLAGS+= -I$(XEN_INCLUDE)
18 CFLAGS += $(BASECFLAGS)
19 LDFLAGS += $(PROFILE) -L$(XEN_LIBXC)
21 CLIENTS := xenstore-exists xenstore-list xenstore-read xenstore-rm xenstore-chmod
22 CLIENTS += xenstore-write
23 CLIENTS_OBJS := $(patsubst xenstore-%,xenstore_%.o,$(CLIENTS))
25 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
27 XENSTORED_OBJS_$(CONFIG_Linux) = xenstored_linux.o
28 XENSTORED_OBJS_$(CONFIG_SunOS) = xenstored_solaris.o
29 XENSTORED_OBJS_$(CONFIG_NetBSD) = xenstored_netbsd.o
31 XENSTORED_OBJS += $(XENSTORED_OBJS_y)
33 .PHONY: all
34 all: libxenstore.so libxenstore.a xenstored $(CLIENTS) xs_tdb_dump xenstore-control xenstore-ls
36 xenstored: $(XENSTORED_OBJS)
37 $(CC) $(CFLAGS) $(LDFLAGS) $^ $(LOADLIBES) $(LDLIBS) -lxenctrl $(SOCKET_LIBS) -o $@
39 $(CLIENTS): xenstore-%: xenstore_%.o libxenstore.so
40 $(CC) $(CFLAGS) $(LDFLAGS) $< $(LOADLIBES) $(LDLIBS) -L. -lxenstore $(SOCKET_LIBS) -o $@
42 $(CLIENTS_OBJS): xenstore_%.o: xenstore_client.c
43 $(COMPILE.c) -DCLIENT_$(*F) -o $@ $<
45 xenstore-control: xenstore_control.o libxenstore.so
46 $(CC) $(CFLAGS) $(LDFLAGS) $< $(LOADLIBES) $(LDLIBS) -L. -lxenstore $(SOCKET_LIBS) -o $@
48 xenstore-ls: xsls.o libxenstore.so
49 $(CC) $(CFLAGS) $(LDFLAGS) $< $(LOADLIBES) $(LDLIBS) -L. -lxenstore $(SOCKET_LIBS) -o $@
51 xs_tdb_dump: xs_tdb_dump.o utils.o tdb.o talloc.o
52 $(CC) $(CFLAGS) $(LDFLAGS) $^ $(LOADLIBES) $(LDLIBS) -o $@
54 libxenstore.so: libxenstore.so.$(MAJOR)
55 ln -sf $< $@
56 libxenstore.so.$(MAJOR): libxenstore.so.$(MAJOR).$(MINOR)
57 ln -sf $< $@
59 libxenstore.so.$(MAJOR).$(MINOR): xs.opic xs_lib.opic
60 $(CC) $(CFLAGS) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenstore.so.$(MAJOR) $(SHLIB_CFLAGS) -o $@ $^ $(SOCKET_LIBS) -lpthread
62 libxenstore.a: xs.o xs_lib.o
63 $(AR) rcs libxenstore.a $^
65 .PHONY: clean
66 clean:
67 rm -f *.a *.o *.opic *.so*
68 rm -f xenstored xs_random xs_stress xs_crashme
69 rm -f xs_tdb_dump xenstore-control xenstore-ls
70 rm -f $(CLIENTS)
71 $(RM) $(PROG_DEP)
73 .PHONY: TAGS
74 TAGS:
75 etags `find . -name '*.[ch]'`
77 .PHONY: tarball
78 tarball: clean
79 cd .. && tar -c -j -v -h -f xenstore.tar.bz2 xenstore/
81 .PHONY: install
82 install: all
83 $(INSTALL_DIR) $(DESTDIR)/var/run/xenstored
84 $(INSTALL_DIR) $(DESTDIR)/var/lib/xenstored
85 $(INSTALL_DIR) $(DESTDIR)$(BINDIR)
86 $(INSTALL_DIR) $(DESTDIR)$(SBINDIR)
87 $(INSTALL_DIR) $(DESTDIR)$(INCLUDEDIR)
88 $(INSTALL_PROG) xenstored $(DESTDIR)$(SBINDIR)
89 $(INSTALL_PROG) $(CLIENTS) $(DESTDIR)$(BINDIR)
90 $(INSTALL_PROG) xenstore-control $(DESTDIR)$(BINDIR)
91 $(INSTALL_PROG) xenstore-ls $(DESTDIR)$(BINDIR)
92 $(INSTALL_DIR) $(DESTDIR)$(LIBDIR)
93 $(INSTALL_PROG) libxenstore.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)
94 ln -sf libxenstore.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)/libxenstore.so.$(MAJOR)
95 ln -sf libxenstore.so.$(MAJOR) $(DESTDIR)$(LIBDIR)/libxenstore.so
96 $(INSTALL_DATA) libxenstore.a $(DESTDIR)$(LIBDIR)
97 $(INSTALL_DATA) xs.h $(DESTDIR)$(INCLUDEDIR)
98 $(INSTALL_DATA) xs_lib.h $(DESTDIR)$(INCLUDEDIR)
100 -include $(PROG_DEP)
102 # never delete any intermediate files.
103 .SECONDARY: