Files
xen/tools/xenstore/Makefile
T
Juergen Gross b2126a992f tools/xenstore: replace xs_lib.c with a header
Instead of including the same small C source in multiple binaries from
2 source directories, use a header file with inline functions as a
replacement.

As some of the functions are exported by libxenstore, rename the inline
functions from xs_*() do xenstore_*() and add xs_*() wrappers to
libxenstore.

With that no sources required to build libxenstore are left in
tools/xenstore, so the file COPYING can be removed now.

Signed-off-by: Juergen Gross <jgross@suse.com>
Acked-by: Julien Grall <jgrall@amazon.com>
2023-06-29 22:38:22 +01:00

102 lines
2.6 KiB
Makefile

XEN_ROOT=$(CURDIR)/../..
include $(XEN_ROOT)/tools/Rules.mk
include Makefile.common
xenstored: LDLIBS += $(LDLIBS_libxenevtchn)
xenstored: LDLIBS += $(LDLIBS_libxengnttab)
xenstored: LDLIBS += $(LDLIBS_libxenctrl)
xenstored: LDLIBS += -lrt
xenstored: LDLIBS += $(SOCKET_LIBS)
ifeq ($(CONFIG_SYSTEMD),y)
$(XENSTORED_OBJS-y): CFLAGS += $(SYSTEMD_CFLAGS)
xenstored: LDLIBS += $(SYSTEMD_LIBS)
endif
xenstore: LDLIBS += $(LDLIBS_libxenstore)
xenstore: LDLIBS += $(LDLIBS_libxentoolcore)
xenstore: LDLIBS += $(SOCKET_LIBS)
xenstore-control: LDLIBS += $(LDLIBS_libxenstore)
xenstore-control: LDLIBS += $(LDLIBS_libxenctrl)
xenstore-control: LDLIBS += $(LDLIBS_libxenguest)
xenstore-control: LDLIBS += $(LDLIBS_libxentoolcore)
xenstore-control: LDLIBS += $(SOCKET_LIBS)
CLIENTS := xenstore-exists xenstore-list xenstore-read xenstore-rm xenstore-chmod
CLIENTS += xenstore-write xenstore-ls xenstore-watch
TARGETS := xenstore $(CLIENTS) xenstore-control
ifeq ($(XENSTORE_XENSTORED),y)
TARGETS += xenstored
endif
.PHONY: all
all: $(TARGETS)
.PHONY: clients
clients: xenstore $(CLIENTS) xenstore-control
xenstored: $(XENSTORED_OBJS-y)
$(CC) $(LDFLAGS) $^ $(LDLIBS) -o $@ $(APPEND_LDFLAGS)
$(CLIENTS): xenstore
ln -f xenstore $@
xenstore: xenstore_client.o
$(CC) $(LDFLAGS) $^ $(LDLIBS) -o $@ $(APPEND_LDFLAGS)
xenstore-control: xenstore_control.o
$(CC) $(LDFLAGS) $^ $(LDLIBS) -o $@ $(APPEND_LDFLAGS)
.PHONY: clean
clean::
$(RM) $(TARGETS) $(DEPS_RM)
.PHONY: distclean
distclean: clean
.PHONY: TAGS
TAGS:
etags `find . -name '*.[ch]'`
.PHONY: install
install: all
$(INSTALL_DIR) $(DESTDIR)$(bindir)
ifeq ($(XENSTORE_XENSTORED),y)
$(INSTALL_DIR) $(DESTDIR)$(sbindir)
$(INSTALL_PROG) xenstored $(DESTDIR)$(sbindir)
endif
$(INSTALL_PROG) xenstore-control $(DESTDIR)$(bindir)
$(INSTALL_PROG) xenstore $(DESTDIR)$(bindir)
set -e ; for c in $(CLIENTS) ; do \
ln -f $(DESTDIR)$(bindir)/xenstore $(DESTDIR)$(bindir)/$${c} ; \
done
.PHONY: uninstall
uninstall:
rm -f $(addprefix $(DESTDIR)$(bindir)/, $(CLIENTS))
rm -f $(DESTDIR)$(bindir)/xenstore
rm -f $(DESTDIR)$(bindir)/xenstore-control
ifeq ($(XENSTORE_XENSTORED),y)
rm -f $(DESTDIR)$(sbindir)/xenstored
endif
if [ -d $(DESTDIR)$(includedir)/xenstore-compat ]; then \
rmdir --ignore-fail-on-non-empty $(DESTDIR)$(includedir)/xenstore-compat; \
fi
.PHONY: clients-uninstall
clients-uninstall:
rm -f $(addprefix $(DESTDIR)$(bindir)/, $(CLIENTS))
.PHONY: clients-install
clients-install: clients
$(INSTALL_DIR) $(DESTDIR)$(bindir)
$(INSTALL_PROG) xenstore $(DESTDIR)$(bindir)
set -e ; for c in $(CLIENTS) ; do \
ln -f $(DESTDIR)$(bindir)/xenstore $(DESTDIR)$(bindir)/$${c} ; \
done
-include $(DEPS_INCLUDE)