ia64/xen-unstable

view tools/blktap2/vhd/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 = vhd-util vhd-update
9 INST_DIR = $(SBINDIR)
11 CFLAGS += -Werror
12 CFLAGS += -Wno-unused
13 CFLAGS += -I../include
14 CFLAGS += -D_GNU_SOURCE
16 ifeq ($(CONFIG_X86_64),y)
17 CFLAGS += -fPIC
18 endif
20 ifeq ($(VHD_STATIC),y)
21 CFLAGS += -static
22 endif
24 LIBS := -Llib -lvhd
25 LIBS += -luuid
27 # Get gcc to generate the dependencies for us.
28 CFLAGS += -Wp,-MD,.$(@F).d
29 DEPS = .*.d
31 all: build
33 build: $(IBIN)
35 vhd-util: vhd-util.o subdir-all-lib
36 $(CC) $(CFLAGS) -o vhd-util vhd-util.o $(LDFLAGS) $(LIBS)
38 vhd-update: vhd-update.o subdir-all-lib
39 $(CC) $(CFLAGS) -o vhd-update vhd-update.o $(LDFLAGS) $(LIBS)
41 install: all
42 $(INSTALL_DIR) -p $(DESTDIR)$(INST_DIR)
43 $(INSTALL_PROG) $(IBIN) $(DESTDIR)$(INST_DIR)
45 clean:
46 rm -rf *.o *~ $(DEPS) $(IBIN)
48 .PHONY: all build clean install vhd-util vhd-update
49 all clean install: %: subdirs-%
51 -include $(DEPS)