Files
xen/tools/libs/devicemodel/Makefile
T
Paul Durrant e7745d8ef5 tools/libxendevicemodel: introduce a Linux-specific implementation
My recent patch [1] to the Linux privcmd module introduced a dedicated
mechanism for making dm_op hypercalls.

This patch adds the necessary code to libxendevicemodel to take
advantage of that mechanism if it is implemented in the tools domain
kernel.

[1] https://git.kernel.org/cgit/linux/kernel/git/ostr/linux.git/commit/?id=ab520be8

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2017-02-23 11:57:47 +00:00

73 lines
2.0 KiB
Makefile

XEN_ROOT = $(CURDIR)/../../..
include $(XEN_ROOT)/tools/Rules.mk
MAJOR = 1
MINOR = 0
SHLIB_LDFLAGS += -Wl,--version-script=libxendevicemodel.map
CFLAGS += -Werror -Wmissing-prototypes
CFLAGS += -I./include $(CFLAGS_xeninclude)
CFLAGS += $(CFLAGS_libxentoollog)
CFLAGS += $(CFLAGS_libxencall)
SRCS-y += core.c
SRCS-$(CONFIG_Linux) += linux.c
SRCS-$(CONFIG_FreeBSD) += compat.c
SRCS-$(CONFIG_SunOS) += compat.c
SRCS-$(CONFIG_NetBSD) += compat.c
SRCS-$(CONFIG_MiniOS) += compat.c
LIB_OBJS := $(patsubst %.c,%.o,$(SRCS-y))
PIC_OBJS := $(patsubst %.c,%.opic,$(SRCS-y))
LIB := libxendevicemodel.a
ifneq ($(nosharedlibs),y)
LIB += libxendevicemodel.so
endif
.PHONY: all
all: build
.PHONY: build
build:
$(MAKE) libs
.PHONY: libs
libs: headers.chk $(LIB)
headers.chk: $(wildcard include/*.h)
libxendevicemodel.a: $(LIB_OBJS)
$(AR) rc $@ $^
libxendevicemodel.so: libxendevicemodel.so.$(MAJOR)
$(SYMLINK_SHLIB) $< $@
libxendevicemodel.so.$(MAJOR): libxendevicemodel.so.$(MAJOR).$(MINOR)
$(SYMLINK_SHLIB) $< $@
libxendevicemodel.so.$(MAJOR).$(MINOR): $(PIC_OBJS) libxendevicemodel.map
$(CC) $(LDFLAGS) $(PTHREAD_LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxendevicemodel.so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $(PIC_OBJS) $(LDLIBS_libxentoollog) $(APPEND_LDFLAGS)
.PHONY: install
install: build
$(INSTALL_DIR) $(DESTDIR)$(libdir)
$(INSTALL_DIR) $(DESTDIR)$(includedir)
$(INSTALL_SHLIB) libxendevicemodel.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)
$(INSTALL_DATA) libxendevicemodel.a $(DESTDIR)$(libdir)
$(SYMLINK_SHLIB) libxendevicemodel.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)/libxendevicemodel.so.$(MAJOR)
$(SYMLINK_SHLIB) libxendevicemodel.so.$(MAJOR) $(DESTDIR)$(libdir)/libxendevicemodel.so
$(INSTALL_DATA) include/xendevicemodel.h $(DESTDIR)$(includedir)
.PHONY: TAGS
TAGS:
etags -t *.c *.h
.PHONY: clean
clean:
rm -rf *.rpm $(LIB) *~ $(DEPS) $(LIB_OBJS) $(PIC_OBJS)
rm -f libxendevicemodel.so.$(MAJOR).$(MINOR) libxendevicemodel.so.$(MAJOR)
rm -f headers.chk
.PHONY: distclean
distclean: clean