Files
xen/tools/libs/gnttab/Makefile
T
Roger Pau Monne df58461e6b libs/gnttab: add FreeBSD handlers for the grant-table user-space device
This patch adds the headers and helpers for the FreeBSD gntdev, used in order
to map grants from remote domains and to allocate grants on behalf of the
current domain.

Current code has been tested with the QEMU/Qdisk backend.

Signed-off-by: Akshay Jaggi <akshay1994.leo@gmail.com>
[ added dummy stub for osdep_gnttab_grant_copy ]
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>

Move PAGE_* back to {linux,freebsd}.c due to breakage in stubdom build.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
2017-02-02 12:32:41 +00:00

74 lines
2.0 KiB
Makefile

XEN_ROOT = $(CURDIR)/../../..
include $(XEN_ROOT)/tools/Rules.mk
MAJOR = 1
MINOR = 1
SHLIB_LDFLAGS += -Wl,--version-script=libxengnttab.map
CFLAGS += -Werror -Wmissing-prototypes
CFLAGS += -I./include $(CFLAGS_xeninclude)
CFLAGS += $(CFLAGS_libxentoollog)
SRCS-GNTTAB += gnttab_core.c
SRCS-GNTSHR += gntshr_core.c
SRCS-$(CONFIG_Linux) += $(SRCS-GNTTAB) $(SRCS-GNTSHR) linux.c
SRCS-$(CONFIG_MiniOS) += $(SRCS-GNTTAB) gntshr_unimp.c minios.c
SRCS-$(CONFIG_FreeBSD) += $(SRCS-GNTTAB) $(SRCS-GNTSHR) freebsd.c
SRCS-$(CONFIG_SunOS) += gnttab_unimp.c gntshr_unimp.c
SRCS-$(CONFIG_NetBSD) += gnttab_unimp.c gntshr_unimp.c
LIB_OBJS := $(patsubst %.c,%.o,$(SRCS-y))
PIC_OBJS := $(patsubst %.c,%.opic,$(SRCS-y))
LIB := libxengnttab.a
ifneq ($(nosharedlibs),y)
LIB += libxengnttab.so
endif
.PHONY: all
all: build
.PHONY: build
build:
$(MAKE) libs
.PHONY: libs
libs: headers.chk $(LIB)
headers.chk: $(wildcard include/*.h)
libxengnttab.a: $(LIB_OBJS)
$(AR) rc $@ $^
libxengnttab.so: libxengnttab.so.$(MAJOR)
$(SYMLINK_SHLIB) $< $@
libxengnttab.so.$(MAJOR): libxengnttab.so.$(MAJOR).$(MINOR)
$(SYMLINK_SHLIB) $< $@
libxengnttab.so.$(MAJOR).$(MINOR): $(PIC_OBJS) libxengnttab.map
$(CC) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxengnttab.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) libxengnttab.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)
$(INSTALL_DATA) libxengnttab.a $(DESTDIR)$(libdir)
$(SYMLINK_SHLIB) libxengnttab.so.$(MAJOR).$(MINOR) $(DESTDIR)$(libdir)/libxengnttab.so.$(MAJOR)
$(SYMLINK_SHLIB) libxengnttab.so.$(MAJOR) $(DESTDIR)$(libdir)/libxengnttab.so
$(INSTALL_DATA) include/xengnttab.h $(DESTDIR)$(includedir)
.PHONY: TAGS
TAGS:
etags -t *.c *.h
.PHONY: clean
clean:
rm -rf *.rpm $(LIB) *~ $(DEPS) $(LIB_OBJS) $(PIC_OBJS)
rm -f libxengnttab.so.$(MAJOR).$(MINOR) libxengnttab.so.$(MAJOR)
rm -f headers.chk
.PHONY: distclean
distclean: clean