diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2008-04-09 13:30:37 +0100 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2008-04-09 13:30:37 +0100 |
commit | 58b534c5d793826b1b3511dffc29e37853b5a08b (patch) | |
tree | f35b7fdcab8798e5205854fa0029530aa394737f /tools/xenstore/Makefile | |
parent | dde3e02b70682bcf0eb724be0015e6605b3ac308 (diff) | |
download | xen-58b534c5d793826b1b3511dffc29e37853b5a08b.tar.gz xen-58b534c5d793826b1b3511dffc29e37853b5a08b.tar.bz2 xen-58b534c5d793826b1b3511dffc29e37853b5a08b.zip |
xenstore: make the xenstore clients a single multicall binary
rather than multiply compiled source.
This saves a bunch of space when statically compiling.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Diffstat (limited to 'tools/xenstore/Makefile')
-rw-r--r-- | tools/xenstore/Makefile | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/tools/xenstore/Makefile b/tools/xenstore/Makefile index b42e583118..6bfb1b6b6b 100644 --- a/tools/xenstore/Makefile +++ b/tools/xenstore/Makefile @@ -14,7 +14,6 @@ DEP = .*.d CLIENTS := xenstore-exists xenstore-list xenstore-read xenstore-rm xenstore-chmod CLIENTS += xenstore-write -CLIENTS_OBJS := $(patsubst xenstore-%,xenstore_%.o,$(CLIENTS)) 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 @@ -28,14 +27,14 @@ ifneq ($(XENSTORE_STATIC_CLIENTS),y) LIBXENSTORE := libxenstore.so else LIBXENSTORE := libxenstore.a -$(CLIENTS) xenstore-control xenstore-ls: CFLAGS += -static +xenstore xenstore-control xenstore-ls: CFLAGS += -static endif .PHONY: all all: libxenstore.so libxenstore.a xenstored clients xs_tdb_dump .PHONY: clients -clients: $(CLIENTS) xenstore-control xenstore-ls +clients: xenstore $(CLIENTS) xenstore-control xenstore-ls ifeq ($(CONFIG_SunOS),y) xenstored_probes.h: xenstored_probes.d @@ -52,11 +51,11 @@ endif xenstored: $(XENSTORED_OBJS) $(CC) $(CFLAGS) $(LDFLAGS) $^ $(LDFLAGS_libxenctrl) $(SOCKET_LIBS) -o $@ -$(CLIENTS): xenstore-%: xenstore_%.o $(LIBXENSTORE) - $(CC) $(CFLAGS) $(LDFLAGS) $< -L. -lxenstore $(SOCKET_LIBS) -o $@ +$(CLIENTS): xenstore + ln -f xenstore $@ -$(CLIENTS_OBJS): xenstore_%.o: xenstore_client.c - $(COMPILE.c) -DCLIENT_$(*F) -o $@ $< +xenstore: xenstore_client.o $(LIBXENSTORE) + $(CC) $(CFLAGS) $(LDFLAGS) $< -L. -lxenstore $(SOCKET_LIBS) -o $@ xenstore-control: xenstore_control.o $(LIBXENSTORE) $(CC) $(CFLAGS) $(LDFLAGS) $< -L. -lxenstore $(SOCKET_LIBS) -o $@ @@ -85,7 +84,7 @@ clean: rm -f *.a *.o *.opic *.so* xenstored_probes.h rm -f xenstored xs_random xs_stress xs_crashme rm -f xs_tdb_dump xenstore-control xenstore-ls - rm -f $(CLIENTS) + rm -f xenstore $(CLIENTS) $(RM) $(DEP) .PHONY: TAGS @@ -104,8 +103,11 @@ install: all $(INSTALL_DIR) $(DESTDIR)$(SBINDIR) $(INSTALL_DIR) $(DESTDIR)$(INCLUDEDIR) $(INSTALL_PROG) xenstored $(DESTDIR)$(SBINDIR) - $(INSTALL_PROG) $(CLIENTS) $(DESTDIR)$(BINDIR) $(INSTALL_PROG) xenstore-control $(DESTDIR)$(BINDIR) + $(INSTALL_PROG) xenstore $(DESTDIR)/usr/bin + set -e ; for c in $(CLIENTS) ; do \ + ln -f $(DESTDIR)/usr/bin/xenstore $(DESTDIR)/usr/bin/$${c} ; \ + done $(INSTALL_PROG) xenstore-ls $(DESTDIR)$(BINDIR) $(INSTALL_DIR) $(DESTDIR)$(LIBDIR) $(INSTALL_PROG) libxenstore.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR) |