ia64/xen-unstable

view tools/blktap/Makefile @ 6946:e703abaf6e3d

Add behaviour to the remove methods to remove the transaction's path itself. This allows us to write Remove(path) to remove the specified path rather than having to slice the path ourselves.
author emellor@ewan
date Sun Sep 18 14:42:13 2005 +0100 (2005-09-18)
parents 3233e7ecfa9f
children 06d84bf87159
line source
1 MAJOR = 2.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 LINUX_ROOT := $(wildcard $(XEN_ROOT)/linux-2.6.*-xen-sparse)
51 mk-symlinks:
52 [ -e xen/linux ] || mkdir -p xen/linux
53 [ -e xen/io ] || mkdir -p xen/io
54 ( cd xen >/dev/null ; \
55 ln -sf ../$(XEN_ROOT)/xen/include/public/*.h . )
56 ( cd xen/io >/dev/null ; \
57 ln -sf ../../$(XEN_ROOT)/xen/include/public/io/*.h . )
58 ( cd xen/linux >/dev/null ; \
59 ln -sf ../../$(LINUX_ROOT)/include/asm-xen/linux-public/*.h . )
61 install: all
62 $(INSTALL_DIR) -p $(DESTDIR)/usr/$(LIBDIR)
63 $(INSTALL_DIR) -p $(DESTDIR)/usr/include
64 $(INSTALL_PROG) $(LIB) $(DESTDIR)/usr/$(LIBDIR)
65 $(INSTALL_PROG) blktaplib.h $(DESTDIR)/usr/include
66 #$(INSTALL_PROG) $(IBINS) $(DESTDIR)$(BLKTAP_INSTALL_DIR)
67 @set -e; for subdir in $(SUBDIRS); do \
68 $(MAKE) -C $$subdir $@; \
69 done
71 clean:
72 rm -rf *.a *.so *.o *.rpm $(LIB) *~ $(DEPS) xen TAGS blkdump
73 @set -e; for subdir in $(SUBDIRS); do \
74 $(MAKE) -C $$subdir $@; \
75 done
77 rpm: all
78 rm -rf staging
79 mkdir staging
80 mkdir staging/i386
81 rpmbuild --define "staging$$PWD/staging" --define '_builddir.' \
82 --define "_rpmdir$$PWD/staging" -bb rpm.spec
83 mv staging/i386/*.rpm .
84 rm -rf staging
86 libblktap.so: $(OBJS)
87 $(CC) $(CFLAGS) -Wl,-soname -Wl,$(SONAME) -shared \
88 -L$(XEN_XENSTORE) -l xenstore \
89 -o libblktap.so.$(MAJOR).$(MINOR) $^ $(LIBS)
90 ln -sf libblktap.so.$(MAJOR).$(MINOR) libblktap.so.$(MAJOR)
91 ln -sf libblktap.so.$(MAJOR) $@
93 blkdump: libblktap.so
94 $(CC) $(CFLAGS) -o blkdump -L$(XEN_LIBXC) -L. \
95 -l blktap blkdump.c
97 .PHONY: TAGS clean install mk-symlinks rpm
99 TAGS:
100 etags -t $(SRCS) *.h
102 -include $(DEPS)