debuggers.hg

view tools/blktap/drivers/Makefile @ 10963:ea04335d238b

[blktap] Add dependencies to Makefiles and simplify to avoid needless rebuilds.

Signed-off-by: Christian Limpach <Christian.Limpach@xensource.com>
author chris@kneesaa.uk.xensource.com
date Thu Aug 03 19:45:14 2006 +0100 (2006-08-03)
parents 2937703f0ed0
children fd59667e5365
line source
1 XEN_ROOT = ../../..
2 include $(XEN_ROOT)/tools/Rules.mk
4 INCLUDES += -I.. -I../lib
6 INSTALL = install
7 INSTALL_PROG = $(INSTALL) -m0755
8 IBIN = blktapctrl tapdisk
9 QCOW_UTIL = img2qcow qcow2raw qcow-create
10 INSTALL_DIR = /usr/sbin
11 LIBAIO_DIR = ../../libaio/src
13 CFLAGS += -fPIC
14 CFLAGS += -Wall
15 CFLAGS += -Werror
16 CFLAGS += -Wno-unused
17 CFLAGS += -g3
18 CFLAGS += -fno-strict-aliasing
19 CFLAGS += -I $(XEN_LIBXC) -I $(LIBAIO_DIR)
20 CFLAGS += $(INCLUDES) -I. -I../../xenstore
21 CFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
22 CFLAGS += -D_GNU_SOURCE
24 # Get gcc to generate the dependencies for us.
25 CFLAGS += -Wp,-MD,.$(@F).d
26 DEPS = .*.d
28 THREADLIB := -lpthread -lz
29 LIBS := -L. -L.. -L../lib
30 LIBS += -L$(XEN_LIBXC)
31 LIBS += -lblktap
32 LIBS += -lcrypto
33 LIBS += -lz
34 LIBS += -L$(XEN_XENSTORE) -lxenstore
36 AIOLIBS := -L $(LIBAIO_DIR)
37 AIOLIBS += -laio
38 AIOLIBS += -static
40 BLK-OBJS := block-aio.o
41 BLK-OBJS += block-sync.o
42 BLK-OBJS += block-vmdk.o
43 BLK-OBJS += block-ram.o
44 BLK-OBJS += block-qcow.o
45 BLK-OBJS += aes.o
47 all: $(IBIN) qcow-util
49 LINUX_ROOT := $(wildcard $(XEN_ROOT)/linux-2.6.*-xen-sparse)
52 blktapctrl: blktapctrl.c
53 $(CC) $(CFLAGS) -o blktapctrl $(LIBS) blktapctrl.c
55 tapdisk: $(BLK-OBJS) tapdisk.c
56 $(CC) $(CFLAGS) -o tapdisk $(BLK-OBJS) tapdisk.c \
57 $(AIOLIBS) $(LIBS)
59 .PHONY: qcow-util
60 qcow-util: img2qcow qcow2raw qcow-create
62 img2qcow qcow2raw qcow-create: %: $(BLK-OBJS)
63 $(CC) $(CFLAGS) -o $* $(BLK-OBJS) $*.c $(AIOLIBS) $(LIBS)
65 install: all
66 $(INSTALL_PROG) $(IBIN) $(QCOW_UTIL) $(DESTDIR)$(INSTALL_DIR)
68 clean:
69 rm -rf *.o *~ $(DEPS) xen TAGS $(IBIN) $(LIB) $(QCOW_UTIL)
71 .PHONY: clean install
73 -include $(DEPS)