[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 13 of 13 v5] blktap3/libblktapctl: Introduce makefile that builds tapback-required libblktapctl functionality



This patch imports control/Makefile from the existing blktap2 implementation,
building only the libblktapctl functionality required by the tapback daemon.
The rest of the binaries/functionality will be introduced by a later patch.

Signed-off-by: Thanos Makatos <thanos.makatos@xxxxxxxxxx>

---
Changed since v2:
  * Ignore auto-generated file _paths.h.
  * Remove TAPDISK_EXEC and TAPDISK_EXECDIR from the configuration system as
    they don't have to be configurable.

Changed since v3:
  * Compile tap_ctl_open, tap_ctl_close, tap_ctl_create, tap_ctl_destroy,
    tap_ctl_attach, and tap_ctl_detach into libblktapctl as they're now
    needed by the tapback daemon.
  * No need to generate header files indicating where the tapdisk lives, since
    tap_ctl_spawn now relies on $PATH.

Changed since v4:
  * Install libblktapctl under a different name to avoid conflicts with the
    blktap2 one.
  * Remove tap-ctl-attach/detach from the compilation.

diff --git a/tools/blktap2/control/Makefile b/tools/blktap3/control/Makefile
copy from tools/blktap2/control/Makefile
copy to tools/blktap3/control/Makefile
--- a/tools/blktap2/control/Makefile
+++ b/tools/blktap3/control/Makefile
@@ -1,77 +1,64 @@
 XEN_ROOT := $(CURDIR)/../../../
 include $(XEN_ROOT)/tools/Rules.mk
 
-MAJOR              = 1.0
+MAJOR              = 3
 MINOR              = 0
 LIBNAME            = libblktapctl
-LIBSONAME          = $(LIBNAME).so.$(MAJOR)
 
-IBIN               = tap-ctl
+override CFLAGS += \
+       -I../include \
+       -DTAPDISK_BUILDDIR='"../drivers"' \
+       $(CFLAGS_xeninclude) \
+       $(CFLAGS_libxenctrl) \
+       -D_GNU_SOURCE \
+       -DTAPCTL \
+    -Wall \
+    -Wextra \
+    -Werror
 
-CFLAGS            += -Werror
-CFLAGS            += -Wno-unused
-CFLAGS            += -I../include -I../drivers
-CFLAGS            += $(CFLAGS_xeninclude)
-CFLAGS            += $(CFLAGS_libxenctrl)
-CFLAGS            += -D_GNU_SOURCE
-CFLAGS            += -DTAPCTL
+# FIXME cause trouble
+override CFLAGS += \
+    -Wno-type-limits \
+    -Wno-missing-field-initializers \
+    -Wno-sign-compare
 
-CTL_OBJS  := tap-ctl-ipc.o
 CTL_OBJS  += tap-ctl-list.o
-CTL_OBJS  += tap-ctl-allocate.o
-CTL_OBJS  += tap-ctl-free.o
+CTL_OBJS  += tap-ctl-info.o
+CTL_OBJS  += tap-ctl-xen.o
+CTL_OBJS  += tap-ctl-ipc.o
+CTL_OBJS  += tap-ctl-spawn.o
+CTL_OBJS  += tap-ctl-open.o
+CTL_OBJS  += tap-ctl-close.o
 CTL_OBJS  += tap-ctl-create.o
 CTL_OBJS  += tap-ctl-destroy.o
-CTL_OBJS  += tap-ctl-spawn.o
-CTL_OBJS  += tap-ctl-attach.o
-CTL_OBJS  += tap-ctl-detach.o
-CTL_OBJS  += tap-ctl-open.o
-CTL_OBJS  += tap-ctl-close.o
-CTL_OBJS  += tap-ctl-pause.o
-CTL_OBJS  += tap-ctl-unpause.o
-CTL_OBJS  += tap-ctl-major.o
-CTL_OBJS  += tap-ctl-check.o
 
 CTL_PICS  = $(patsubst %.o,%.opic,$(CTL_OBJS))
 
-OBJS = $(CTL_OBJS) tap-ctl.o
 PICS = $(CTL_PICS)
 
 LIB_STATIC = $(LIBNAME).a
-LIB_SHARED = $(LIBSONAME).$(MINOR)
-IBIN = tap-ctl
+LIB_SHARED = $(LIBNAME).so.$(MAJOR).$(MINOR)
 
 all: build
 
 build: $(IBIN) $(LIB_STATIC) $(LIB_SHARED)
 
-$(LIBNAME).so: $(LIBSONAME)
-       ln -sf $< $@
-
-$(LIBSONAME): $(LIB_SHARED)
-       ln -sf $< $@
-
-tap-ctl: tap-ctl.o $(LIBNAME).so
-       $(CC) $(LDFLAGS) -o $@ $^
-
 $(LIB_STATIC): $(CTL_OBJS)
        $(AR) r $@ $^
 
 $(LIB_SHARED): $(CTL_PICS)
-       $(CC) $(LDFLAGS) -fPIC  -Wl,$(SONAME_LDFLAG) -Wl,$(LIBSONAME) 
$(SHLIB_LDFLAGS) -rdynamic $^ -o $@
+       $(CC) $(LDFLAGS) -fPIC -Wl,$(SONAME_LDFLAG) -Wl,$(LIB_SHARED) \
+               $(SHLIB_LDFLAGS) -rdynamic $^ -o $@
 
-install: $(IBIN) $(LIB_STATIC) $(LIB_SHARED)
+install: $(LIB_STATIC) $(LIB_SHARED)
        $(INSTALL_DIR) -p $(DESTDIR)$(SBINDIR)
-       $(INSTALL_PROG) $(IBIN) $(DESTDIR)$(SBINDIR)
-       $(INSTALL_DATA) $(LIB_STATIC) $(DESTDIR)$(LIBDIR)
+       # TODO Why install the static version?
+       #$(INSTALL_DATA) $(LIB_STATIC) $(DESTDIR)$(LIBDIR)
        $(INSTALL_PROG) $(LIB_SHARED) $(DESTDIR)$(LIBDIR)
-       ln -sf $(LIBSONAME) $(DESTDIR)$(LIBDIR)/$(LIBNAME).so
-       ln -sf $(LIB_SHARED) $(DESTDIR)$(LIBDIR)/$(LIBSONAME)
+       ldconfig
 
 clean:
-       rm -f $(OBJS) $(PICS) $(DEPS) $(IBIN) $(LIB_STATIC) $(LIB_SHARED)
-       rm -f $(LIBNAME).so $(LIBSONAME)
-       rm -f *~
+       rm -f $(CTL_OBJS) $(PICS) $(DEPS) $(LIB_STATIC) $(LIB_SHARED)
 
 .PHONY: all build clean install
 

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.