source: trunk/packages/xen-common/xen-common/tools/blktap/lib/Makefile @ 34

Last change on this file since 34 was 34, checked in by hartmans, 17 years ago

Add xen and xen-common

File size: 1.5 KB
Line 
1XEN_ROOT = ../../..
2include $(XEN_ROOT)/tools/Rules.mk
3
4MAJOR    = 3.0
5MINOR    = 0
6SONAME   = libblktap.so.$(MAJOR)
7
8BLKTAP_INSTALL_DIR = /usr/sbin
9
10INCLUDES += -I. -I.. -I $(XEN_LIBXC) -I $(XEN_XENSTORE)
11
12LIBS     := -lz
13
14SRCS     :=
15SRCS     += xenbus.c blkif.c xs_api.c
16
17CFLAGS   += -Werror
18CFLAGS   += -Wno-unused
19CFLAGS   += -fno-strict-aliasing -fPIC
20# get asprintf():
21CFLAGS   += -D _GNU_SOURCE
22
23# Get gcc to generate the dependencies for us.
24CFLAGS   += -Wp,-MD,.$(@F).d
25CFLAGS   += $(INCLUDES) 
26DEPS     = .*.d
27
28OBJS     = $(patsubst %.c,%.o,$(SRCS))
29IBINS   :=
30
31LIB      = libblktap.a libblktap.so.$(MAJOR).$(MINOR)
32
33.PHONY: all
34all: build
35
36.PHONY: build
37build: libblktap.a
38
39.PHONY: libblktap
40libblktap: libblktap.a
41
42install: all
43        $(INSTALL_DIR) $(DESTDIR)/usr/$(LIBDIR)
44        $(INSTALL_DIR) $(DESTDIR)/usr/include
45        $(INSTALL_PROG) $(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_PROG) blktaplib.h $(DESTDIR)/usr/include
49
50clean:
51        rm -rf *.a *.so* *.o *.rpm $(LIB) *~ $(DEPS) xen TAGS
52
53libblktap.a: $(OBJS)
54        $(CC) $(CFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,$(SONAME) $(SHLIB_CFLAGS) \
55              -L$(XEN_XENSTORE) -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
60
61.PHONY: TAGS all build clean install libblktap
62
63TAGS:
64        etags -t $(SRCS) *.h
65
66-include $(DEPS)
67
Note: See TracBrowser for help on using the repository browser.