debuggers.hg

view tools/blktap2/drivers/Makefile @ 20939:845d04d505d0

tools: Do not append trailing slash to XEN_ROOT in Makefiles

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Feb 04 09:03:42 2010 +0000 (2010-02-04)
parents 5b45d08b7abf
children b882c558d4e4
line source
1 XEN_ROOT=../../..
2 BLKTAP_ROOT= ..
3 include $(XEN_ROOT)/tools/Rules.mk
5 LIBVHDDIR = $(BLKTAP_ROOT)/vhd/lib
7 IBIN = tapdisk2 td-util tapdisk-client tapdisk-stream tapdisk-diff
8 QCOW_UTIL = img2qcow qcow-create qcow2raw
9 LOCK_UTIL = lock-util
10 INST_DIR = $(SBINDIR)
12 CFLAGS += -Werror -g -O0
13 CFLAGS += -Wno-unused
14 CFLAGS += -fno-strict-aliasing
15 CFLAGS += -I../lib -I../../libxc
16 CFLAGS += -I../include -I../../include
17 CFLAGS += $(CFLAGS_libxenctrl)
18 CFLAGS += -I $(LIBAIO_DIR)
19 CFLAGS += -I $(MEMSHR_DIR)
20 CFLAGS += -D_GNU_SOURCE
21 CFLAGS += -DUSE_NFS_LOCKS
23 ifeq ($(CONFIG_X86_64),y)
24 CFLAGS += -fPIC
25 endif
27 LIBS += -lrt -lz
29 ifeq ($(CONFIG_Linux),y)
30 ifeq ($(shell . ./check_gcrypt $(CC)),yes)
31 CFLAGS += -DUSE_GCRYPT
32 CRYPT_LIB += -lgcrypt
33 else
34 CRYPT_LIB += -lcrypto
35 $(warning === libgcrypt not installed: falling back to libcrypto ===)
36 endif
37 else
38 CRYPT_LIB += -lcrypto
39 endif
41 LDFLAGS_img := $(LDFLAGS_libxenctrl) $(CRYPT_LIB) -lpthread -lz -lm
43 LIBS += -L$(LIBVHDDIR) -lvhd
45 ifeq ($(CONFIG_Linux),y)
46 LIBS += -luuid
47 endif
49 REMUS-OBJS := block-remus.o
50 REMUS-OBJS += hashtable.o
51 REMUS-OBJS += hashtable_itr.o
52 REMUS-OBJS += hashtable_utility.o
54 $(REMUS-OBJS): CFLAGS += -I$(XEN_XENSTORE)
56 LIBAIO_DIR = $(XEN_ROOT)/tools/libaio/src
57 MEMSHR_DIR = $(XEN_ROOT)/tools/memshr
59 MEMSHRLIBS :=
60 ifeq ($(CONFIG_Linux), y)
61 CFLAGS += -DMEMSHR
62 MEMSHRLIBS += $(MEMSHR_DIR)/libmemshr.a
63 endif
65 tapdisk2 tapdisk-stream tapdisk-diff $(QCOW_UTIL): AIOLIBS := $(LIBAIO_DIR)/libaio.a
66 tapdisk-client tapdisk-stream tapdisk-diff $(QCOW_UTIL): CFLAGS += -I$(LIBAIO_DIR) -I$(XEN_LIBXC)
68 ifeq ($(VHD_STATIC),y)
69 td-util: CFLAGS += -static
70 endif
72 PORTABLE-OBJS-y :=
73 PORTABLE-OBJS-$(CONFIG_Linux) += blk_linux.o
74 PORTABLE-OBJS-$(CONFIG_NetBSD) += blk_netbsd.o
76 TAP-OBJS-y := scheduler.o
77 TAP-OBJS-y += tapdisk-ipc.o
78 TAP-OBJS-y += tapdisk-vbd.o
79 TAP-OBJS-y += tapdisk-image.o
80 TAP-OBJS-y += tapdisk-driver.o
81 TAP-OBJS-y += tapdisk-interface.o
82 TAP-OBJS-y += tapdisk-server.o
83 TAP-OBJS-y += tapdisk-queue.o
84 TAP-OBJS-y += tapdisk-filter.o
85 TAP-OBJS-y += tapdisk-log.o
86 TAP-OBJS-y += tapdisk-utils.o
87 TAP-OBJS-y += io-optimize.o
88 TAP-OBJS-y += lock.o
89 TAP-OBJS-y += $(PORTABLE-OBJS-y)
91 MISC-OBJS-y := atomicio.o
93 BLK-OBJS-y := block-aio.o
94 BLK-OBJS-y += block-ram.o
95 BLK-OBJS-y += block-cache.o
96 BLK-OBJS-y += block-vhd.o
97 BLK-OBJS-y += block-log.o
98 BLK-OBJS-y += block-qcow.o
99 BLK-OBJS-y += aes.o
100 BLK-OBJS-y += $(PORTABLE-OBJS-y)
101 BLK-OBJS-y += $(REMUS-OBJS)
103 all: $(IBIN) lock-util qcow-util
106 tapdisk2: $(TAP-OBJS-y) $(BLK-OBJS-y) $(MISC-OBJS-y) tapdisk2.c
107 $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LIBS) $(AIOLIBS) $(MEMSHRLIBS) $(LDFLAGS_img)
109 tapdisk-client: tapdisk-client.o
110 $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LIBS) $(LDFLAGS_img)
112 tapdisk-stream tapdisk-diff: %: %.o $(TAP-OBJS-y) $(BLK-OBJS-y)
113 $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LIBS) $(AIOLIBS) $(MEMSHRLIBS) $(LDFLAGS_img)
115 td-util: td.o tapdisk-utils.o tapdisk-log.o $(PORTABLE-OBJS-y)
116 $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LIBS) $(LDFLAGS_img)
118 lock-util: lock.c
119 $(CC) $(CFLAGS) -DUTIL -o lock-util lock.c $(LDFLAGS) $(LIBS)
121 .PHONY: qcow-util
122 qcow-util: img2qcow qcow2raw qcow-create
124 img2qcow qcow2raw qcow-create: %: %.o $(TAP-OBJS-y) $(BLK-OBJS-y)
125 $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LIBS) $(AIOLIBS) $(MEMSHRLIBS) $(LDFLAGS_img)
127 install: all
128 $(INSTALL_DIR) -p $(DESTDIR)$(INST_DIR)
129 $(INSTALL_PROG) $(IBIN) $(LOCK_UTIL) $(QCOW_UTIL) $(DESTDIR)$(INST_DIR)
131 clean:
132 rm -rf *.o *~ xen TAGS $(IBIN) $(LIB) $(LOCK_UTIL) $(QCOW_UTIL)
134 .PHONY: clean install