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

[Xen-devel] [PATCH 15 of 15 v4] 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.

diff --git a/.hgignore b/.hgignore
--- a/.hgignore
+++ b/.hgignore
@@ -371,3 +371,4 @@
 ^unmodified_drivers/linux-2.6/.*\.ko$
 ^unmodified_drivers/linux-2.6/.*\.mod\.c$
 ^LibVNCServer.*
+^tools/blktap3/control/_paths.h$
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
@@ -6,40 +6,41 @@ 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
 
 all: build
 
@@ -51,25 +52,21 @@ build: $(IBIN) $(LIB_STATIC) $(LIB_SHARE
 $(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 $@
 
-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)
        $(INSTALL_PROG) $(LIB_SHARED) $(DESTDIR)$(LIBDIR)
        ln -sf $(LIBSONAME) $(DESTDIR)$(LIBDIR)/$(LIBNAME).so
        ln -sf $(LIB_SHARED) $(DESTDIR)$(LIBDIR)/$(LIBSONAME)
 
 clean:
-       rm -f $(OBJS) $(PICS) $(DEPS) $(IBIN) $(LIB_STATIC) $(LIB_SHARED)
+       rm -f $(CTL_OBJS) $(PICS) $(DEPS) $(LIB_STATIC) $(LIB_SHARED)
        rm -f $(LIBNAME).so $(LIBSONAME)
        rm -f *~
 

_______________________________________________
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®.