ia64/xen-unstable

view tools/blktap/lib/Makefile @ 16741:2773cdbecda5

tools: LDFLAGS in link lines

LDFLAGS is not honoured by a couple of link lines in tools/*, but
should be.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Jan 17 15:17:22 2008 +0000 (2008-01-17)
parents 47efaa78e3ac
children 6ed9b42d1ec4
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 INCLUDES += -I. -I.. -I $(XEN_LIBXC) -I $(XEN_XENSTORE)
12 LIBS := -lz
14 SRCS :=
15 SRCS += xenbus.c blkif.c xs_api.c
17 CFLAGS += -Werror
18 CFLAGS += -Wno-unused
19 CFLAGS += -fPIC
20 # get asprintf():
21 CFLAGS += -D _GNU_SOURCE
23 # Get gcc to generate the dependencies for us.
24 CFLAGS += -Wp,-MD,.$(@F).d
25 CFLAGS += $(INCLUDES)
26 DEPS = .*.d
28 OBJS = $(patsubst %.c,%.o,$(SRCS))
29 IBINS :=
31 LIB = libblktap.a libblktap.so.$(MAJOR).$(MINOR)
33 .PHONY: all
34 all: build
36 .PHONY: build
37 build: libblktap.a
39 .PHONY: libblktap
40 libblktap: libblktap.a
42 install: all
43 $(INSTALL_DIR) $(DESTDIR)/usr/$(LIBDIR)
44 $(INSTALL_DIR) $(DESTDIR)/usr/include
45 $(INSTALL_DATA) $(LIB) $(DESTDIR)/usr/$(LIBDIR)
46 ln -sf libblktap.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)/libblktap.so.$(MAJOR)
47 ln -sf libblktap.so.$(MAJOR) $(DESTDIR)/usr/$(LIBDIR)/libblktap.so
48 $(INSTALL_DATA) blktaplib.h $(DESTDIR)/usr/include
50 clean:
51 rm -rf *.a *.so* *.o *.rpm $(LIB) *~ $(DEPS) xen TAGS
53 libblktap.a: $(OBJS)
54 $(CC) $(CFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,$(SONAME) $(SHLIB_CFLAGS) \
55 -L$(XEN_XENSTORE) $(LDFLAGS) -l xenstore \
56 -o libblktap.so.$(MAJOR).$(MINOR) $^ $(LIBS)
57 ln -sf libblktap.so.$(MAJOR).$(MINOR) libblktap.so.$(MAJOR)
58 ln -sf libblktap.so.$(MAJOR) libblktap.so
59 $(AR) rc $@ libblktap.so
61 .PHONY: TAGS all build clean install libblktap
63 TAGS:
64 etags -t $(SRCS) *.h
66 -include $(DEPS)