direct-io.hg

view tools/blktap/lib/Makefile @ 11136:7ed73735fd30

This is a small patch that makes a cross compiler successfully compile
the sources under the tools directory. This patch became necessary
after qemu-dm is updated to a newer version.

Signed-off-by: Hiroya INAKOSHI <inakoshi.hiroya@jp.fujitsu.com>
author kfraser@localhost.localdomain
date Wed Aug 16 11:53:37 2006 +0100 (2006-08-16)
parents ea04335d238b
children edf0e488ea2a
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.$(MAJOR).$(MINOR)
38 .PHONY: all
39 all: build
41 .PHONY: build
42 build: libblktap.a
44 .PHONY: libblktap
45 libblktap: libblktap.a
47 install: all
48 $(INSTALL_DIR) -p $(DESTDIR)/usr/$(LIBDIR)
49 $(INSTALL_DIR) -p $(DESTDIR)/usr/include
50 $(INSTALL_PROG) $(LIB) $(DESTDIR)/usr/$(LIBDIR)
51 ln -sf libblktap.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)/libblktap.so.$(MAJOR)
52 ln -sf libblktap.so.$(MAJOR) $(DESTDIR)/usr/$(LIBDIR)/libblktap.so
53 $(INSTALL_PROG) blktaplib.h $(DESTDIR)/usr/include
55 clean:
56 rm -rf *.a *.so* *.o *.rpm $(LIB) *~ $(DEPS) xen TAGS
58 libblktap.a: $(OBJS)
59 $(CC) $(CFLAGS) -Wl,-soname -Wl,$(SONAME) -shared \
60 -L$(XEN_XENSTORE) -l xenstore \
61 -o libblktap.so.$(MAJOR).$(MINOR) $^ $(LIBS)
62 ln -sf libblktap.so.$(MAJOR).$(MINOR) libblktap.so.$(MAJOR)
63 ln -sf libblktap.so.$(MAJOR) libblktap.so
64 $(AR) rc $@ libblktap.so
66 .PHONY: TAGS all build clean install libblktap
68 TAGS:
69 etags -t $(SRCS) *.h
71 -include $(DEPS)