ia64/xen-unstable

view tools/blktap2/daemon/lib/Makefile @ 19667:241607f414c8

blktap2: fix makefile of blktap2

- clean up to use SUBDIRS-y
- With parallel make, libvhd might not be created before
link. guarantee it.
- use LDFLAGS for link which is set by upper level makefiles.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author Keir Fraser <keir.fraser@citrix.com>
date Thu May 28 10:02:57 2009 +0100 (2009-05-28)
parents 1c627434605e
children
line source
1 XEN_ROOT=../../../../
2 BLKTAP_ROOT := ../../
3 include $(XEN_ROOT)/tools/Rules.mk
5 MAJOR = 3.1
6 MINOR = 0
7 SONAME = libblktap.so.$(MAJOR)
9 BLKTAP_INSTALL_DIR = /usr/sbin
11 LIBS := -lxenstore
13 ifneq ($(USE_SYSTEM_LIBRARIES),y)
14 INCLUDES += -I $(XEN_LIBXC) -I $(XEN_XENSTORE)
15 LIBS += -L$(XEN_XENSTORE)
16 endif
18 SRCS :=
19 SRCS += xs_api.c
20 CFLAGS += -Werror
21 CFLAGS += -Wno-unused
22 CFLAGS += -fno-strict-aliasing -fPIC
23 # get asprintf():
24 CFLAGS += -D _GNU_SOURCE
25 CFLAGS += -g
26 CFLAGS += -I../../include -I../../../include/ $(INCLUDES)
29 # Get gcc to generate the dependencies for us.
30 CFLAGS += -Wp,-MD,.$(@F).d
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)$(LIBDIR)
49 $(INSTALL_DATA) $(LIB) $(DESTDIR)$(LIBDIR)
50 ln -sf libblktap.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)/libblktap.so.$(MAJOR)
51 ln -sf libblktap.so.$(MAJOR) $(DESTDIR)$(LIBDIR)/libblktap.so
53 clean:
54 rm -rf *.a *.so* *.o *.rpm $(LIB) *~ $(DEPS) xen TAGS
56 libblktap.a: $(OBJS)
57 $(CC) $(CFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,$(SONAME) $(SHLIB_CFLAGS) \
58 $(LDFLAGS) -o libblktap.so.$(MAJOR).$(MINOR) $^ $(LIBS)
59 ln -sf libblktap.so.$(MAJOR).$(MINOR) libblktap.so.$(MAJOR)
60 ln -sf libblktap.so.$(MAJOR) libblktap.so
61 $(AR) rc $@ libblktap.so
63 .PHONY: TAGS all build clean install libblktap
65 TAGS:
66 etags -t $(SRCS) *.h
68 -include $(DEPS)