Files
xen/tools/blktap/Makefile
T
akw27@arcadians.cl.cam.ac.uk 3e2b1c87ba Updates to blktap driver and user code.
Mostly this makes the tap code work again with all of the changes that
have happened to the block drivers recently.  We now use a shared page
per VBD (to the driver), and handle control information through the
store.  The taplib interfaces have changed to be based around per-vbd
data structures that you can attach arbitrary handlers for.

There is also initial code for a user-level blockback driver, which
aims to get around the use of loopbacks for file-based vbds.  Still
plenty of work to do here -- this is a working incremental checkin and
I'm away from this for the next four weeks.

Signed-off-by: Andrew Warfield <andrew.warfield@cl.cam.ac.uk>
2005-09-04 21:19:44 +00:00

104 lines
2.6 KiB
Makefile

MAJOR = 2.0
MINOR = 0
SONAME = libblktap.so.$(MAJOR)
XEN_ROOT = ../..
include $(XEN_ROOT)/tools/Rules.mk
SUBDIRS :=
SUBDIRS += ublkback
#SUBDIRS += parallax
BLKTAP_INSTALL_DIR = /usr/sbin
INSTALL = install
INSTALL_PROG = $(INSTALL) -m0755
INSTALL_DIR = $(INSTALL) -d -m0755
INCLUDES += -I. -I $(XEN_LIBXC) -I $(XEN_XENSTORE)
LIBS := -lpthread -lz
SRCS :=
SRCS += blktaplib.c xenbus.c blkif.c
CFLAGS += -Wall
CFLAGS += -Werror
CFLAGS += -Wno-unused
#CFLAGS += -O3
CFLAGS += -g3
CFLAGS += -fno-strict-aliasing
CFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
# get asprintf():
CFLAGS += -D _GNU_SOURCE
# Get gcc to generate the dependencies for us.
CFLAGS += -Wp,-MD,.$(@F).d
CFLAGS += $(INCLUDES)
DEPS = .*.d
OBJS = $(patsubst %.c,%.o,$(SRCS))
IBINS :=
#IBINS += blkdump
LIB = libblktap.so libblktap.so.$(MAJOR) libblktap.so.$(MAJOR).$(MINOR)
all: mk-symlinks libblktap.so #blkdump
@set -e; for subdir in $(SUBDIRS); do \
$(MAKE) -C $$subdir $@; \
done
LINUX_ROOT := $(wildcard $(XEN_ROOT)/linux-2.6.*-xen-sparse)
mk-symlinks:
[ -e xen/linux ] || mkdir -p xen/linux
[ -e xen/io ] || mkdir -p xen/io
( cd xen >/dev/null ; \
ln -sf ../$(XEN_ROOT)/xen/include/public/*.h . )
( cd xen/io >/dev/null ; \
ln -sf ../../$(XEN_ROOT)/xen/include/public/io/*.h . )
( cd xen/linux >/dev/null ; \
ln -sf ../../$(LINUX_ROOT)/include/asm-xen/linux-public/*.h . )
install: all
$(INSTALL_DIR) -p $(DESTDIR)/usr/$(LIBDIR)
$(INSTALL_DIR) -p $(DESTDIR)/usr/include
$(INSTALL_PROG) $(LIB) $(DESTDIR)/usr/$(LIBDIR)
$(INSTALL_PROG) blktaplib.h $(DESTDIR)/usr/include
#$(INSTALL_PROG) $(IBINS) $(DESTDIR)$(BLKTAP_INSTALL_DIR)
@set -e; for subdir in $(SUBDIRS); do \
$(MAKE) -C $$subdir $@; \
done
clean:
rm -rf *.a *.so *.o *.rpm $(LIB) *~ $(DEPS) xen TAGS blkdump
@set -e; for subdir in $(SUBDIRS); do \
$(MAKE) -C $$subdir $@; \
done
rpm: all
rm -rf staging
mkdir staging
mkdir staging/i386
rpmbuild --define "staging$$PWD/staging" --define '_builddir.' \
--define "_rpmdir$$PWD/staging" -bb rpm.spec
mv staging/i386/*.rpm .
rm -rf staging
libblktap.so: $(OBJS)
$(CC) $(CFLAGS) -Wl,-soname -Wl,$(SONAME) -shared \
-L$(XEN_XENSTORE) -l xenstore \
-o libblktap.so.$(MAJOR).$(MINOR) $^ $(LIBS)
ln -sf libblktap.so.$(MAJOR).$(MINOR) libblktap.so.$(MAJOR)
ln -sf libblktap.so.$(MAJOR) $@
blkdump: libblktap.so
$(CC) $(CFLAGS) -o blkdump -L$(XEN_LIBXC) -L. \
-l blktap blkdump.c
.PHONY: TAGS clean install mk-symlinks rpm
TAGS:
etags -t $(SRCS) *.h
-include $(DEPS)