ia64/xen-unstable

view tools/blktap/lib/Makefile @ 10736:2937703f0ed0

Added blktap support. Includes kernel driver (enabled as CONFIG_XEN_BLKDEV_TAP=y) and userspace tools. The userspace deamon (blktapctrl) is enabled by default when xend is activated. For further information on using and configuring blktap see tools/blktap/README.
author jchesterfield@dhcp92.uk.xensource.com
date Thu Jul 13 10:13:26 2006 +0100 (2006-07-13)
parents
children 849b8ce387c3
line source
1 XEN_ROOT = ../../..
2 include $(XEN_ROOT)/tools/Rules.mk
4 MAJOR = 3.0
5 MINOR = 0
6 SONAME = libblktap.so.$(MAJOR)
8 BLKTAP_INSTALL_DIR = /usr/sbin
10 INSTALL = install
11 INSTALL_PROG = $(INSTALL) -m0755
12 INSTALL_DIR = $(INSTALL) -d -m0755
14 INCLUDES += -I. -I.. -I $(XEN_LIBXC) -I $(XEN_XENSTORE)
16 LIBS := -lz
18 SRCS :=
19 SRCS += xenbus.c blkif.c xs_api.c
21 CFLAGS += -Werror
22 CFLAGS += -Wno-unused
23 CFLAGS += -fno-strict-aliasing -fPIC
24 CFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
25 # get asprintf():
26 CFLAGS += -D _GNU_SOURCE
28 # Get gcc to generate the dependencies for us.
29 CFLAGS += -Wp,-MD,.$(@F).d
30 CFLAGS += $(INCLUDES)
31 DEPS = .*.d
33 OBJS = $(patsubst %.c,%.o,$(SRCS))
34 IBINS :=
36 LIB = libblktap.a libblktap.so libblktap.so.$(MAJOR) libblktap.so.$(MAJOR).$(MINOR)
38 all: build
40 build:
41 $(MAKE) libblktap
43 install: all
44 $(INSTALL_DIR) -p $(DESTDIR)/usr/$(LIBDIR)
45 $(INSTALL_DIR) -p $(DESTDIR)/usr/include
46 $(INSTALL_PROG) $(LIB) $(DESTDIR)/usr/$(LIBDIR)
47 $(INSTALL_PROG) blktaplib.h $(DESTDIR)/usr/include
49 clean:
50 rm -rf *.a *.so *.o *.rpm $(LIB) *~ $(DEPS) xen TAGS
52 libblktap: $(OBJS)
53 $(CC) $(CFLAGS) -Wl,-soname -Wl,$(SONAME) -shared \
54 -L$(XEN_XENSTORE) -l xenstore \
55 -o libblktap.so.$(MAJOR).$(MINOR) $^ $(LIBS)
56 ln -sf libblktap.so.$(MAJOR).$(MINOR) libblktap.so.$(MAJOR)
57 ln -sf libblktap.so.$(MAJOR) $@.so
58 ar rc libblktap.a $@.so
60 .PHONY: TAGS all build clean install libblktap
62 TAGS:
63 etags -t $(SRCS) *.h
65 -include $(DEPS)