ia64/xen-unstable

view tools/blktap/Makefile @ 8740:3d7ea7972b39

Update patches for linux 2.6.15.

Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
author cl349@firebug.cl.cam.ac.uk
date Thu Feb 02 17:16:00 2006 +0000 (2006-02-02)
parents f94923f2dd14
children 7e68bc2745af
line source
1 MAJOR = 3.0
2 MINOR = 0
3 SONAME = libblktap.so.$(MAJOR)
5 XEN_ROOT = ../..
6 include $(XEN_ROOT)/tools/Rules.mk
8 SUBDIRS :=
9 SUBDIRS += ublkback
10 #SUBDIRS += parallax
12 BLKTAP_INSTALL_DIR = /usr/sbin
14 INSTALL = install
15 INSTALL_PROG = $(INSTALL) -m0755
16 INSTALL_DIR = $(INSTALL) -d -m0755
18 INCLUDES += -I. -I $(XEN_LIBXC) -I $(XEN_XENSTORE)
20 LIBS := -lpthread -lz
22 SRCS :=
23 SRCS += blktaplib.c xenbus.c blkif.c
25 CFLAGS += -Wall
26 CFLAGS += -Werror
27 CFLAGS += -Wno-unused
28 #CFLAGS += -O3
29 CFLAGS += -g3
30 CFLAGS += -fno-strict-aliasing
31 CFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
32 # get asprintf():
33 CFLAGS += -D _GNU_SOURCE
34 # Get gcc to generate the dependencies for us.
35 CFLAGS += -Wp,-MD,.$(@F).d
36 CFLAGS += $(INCLUDES)
37 DEPS = .*.d
39 OBJS = $(patsubst %.c,%.o,$(SRCS))
40 IBINS :=
41 #IBINS += blkdump
43 LIB = libblktap.so libblktap.so.$(MAJOR) libblktap.so.$(MAJOR).$(MINOR)
45 all: mk-symlinks libblktap.so #blkdump
46 @set -e; for subdir in $(SUBDIRS); do \
47 $(MAKE) -C $$subdir $@; \
48 done
50 install: all
51 $(INSTALL_DIR) -p $(DESTDIR)/usr/$(LIBDIR)
52 $(INSTALL_DIR) -p $(DESTDIR)/usr/include
53 $(INSTALL_PROG) $(LIB) $(DESTDIR)/usr/$(LIBDIR)
54 $(INSTALL_PROG) blktaplib.h $(DESTDIR)/usr/include
55 #$(INSTALL_PROG) $(IBINS) $(DESTDIR)$(BLKTAP_INSTALL_DIR)
56 @set -e; for subdir in $(SUBDIRS); do \
57 $(MAKE) -C $$subdir $@; \
58 done
60 clean:
61 rm -rf *.a *.so *.o *.rpm $(LIB) *~ $(DEPS) xen TAGS blkdump
62 @set -e; for subdir in $(SUBDIRS); do \
63 $(MAKE) -C $$subdir $@; \
64 done
66 rpm: all
67 rm -rf staging
68 mkdir staging
69 mkdir staging/i386
70 rpmbuild --define "staging$$PWD/staging" --define '_builddir.' \
71 --define "_rpmdir$$PWD/staging" -bb rpm.spec
72 mv staging/i386/*.rpm .
73 rm -rf staging
75 libblktap.so: $(OBJS)
76 $(CC) $(CFLAGS) -Wl,-soname -Wl,$(SONAME) -shared \
77 -L$(XEN_XENSTORE) -l xenstore \
78 -o libblktap.so.$(MAJOR).$(MINOR) $^ $(LIBS)
79 ln -sf libblktap.so.$(MAJOR).$(MINOR) libblktap.so.$(MAJOR)
80 ln -sf libblktap.so.$(MAJOR) $@
82 blkdump: libblktap.so
83 $(CC) $(CFLAGS) -o blkdump -L$(XEN_LIBXC) -L. \
84 -l blktap blkdump.c
86 .PHONY: TAGS clean install mk-symlinks rpm
88 TAGS:
89 etags -t $(SRCS) *.h
91 -include $(DEPS)