ia64/xen-unstable

view tools/blktap2/daemon/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 2c1d94eb996f
line source
1 XEN_ROOT=../../../
2 BLKTAP_ROOT := ..
3 include $(XEN_ROOT)/tools/Rules.mk
5 SUBDIRS-y :=
6 SUBDIRS-y += lib
8 IBIN = blktapctrl
9 INST_DIR = $(SBINDIR)
11 LIBS := -lxenstore
12 LIBS += -Llib
13 LIBS += -lblktap
14 LIBS += -lxenctrl
16 ifneq ($(USE_SYSTEM_LIBRARIES),y)
17 INCLUDES += -I $(XEN_LIBXC) -I $(XEN_XENSTORE)
18 LIBS += -L $(XEN_LIBXC) -L $(XEN_XENSTORE)
19 endif
21 OBJS := tapdisk-dispatch-common.o
22 OBJS += tapdisk-channel.o
24 CFLAGS += -Werror
25 CFLAGS += -Wno-unused
26 CFLAGS += -fno-strict-aliasing -fPIC
27 CFLAGS += -Ilib -I../include -I../drivers -I../../include $(INCLUDES)
28 CFLAGS += -D_GNU_SOURCE
29 CFLAGS += -g
31 # Get gcc to generate the dependencies for us.
32 CFLAGS += -Wp,-MD,.$(@F).d
33 DEPS = .*.d
35 all: $(IBIN)
37 blktapctrl: tapdisk-daemon.c $(OBJS) subdir-all-lib
38 $(CC) $(CFLAGS) -o blktapctrl tapdisk-daemon.c $(LDFLAGS) $(LIBS) $(OBJS)
40 install: all
41 $(INSTALL_DIR) -p $(DESTDIR)$(INST_DIR)
42 $(INSTALL_PROG) $(IBIN) $(DESTDIR)$(INST_DIR)
44 clean:
45 rm -rf *.o *~ $(IBIN) $(DEPS) xen TAGS
47 .PHONY: all clean install blktapctrl
48 all clean install: %: subdirs-%
50 -include $(DEPS)