debuggers.hg

view tools/Rules.mk @ 21631:556ece996c0e

blktap2: Build libblktapctl.so

Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Jun 10 08:27:25 2010 +0100 (2010-06-10)
parents 58dbf27875c5
children e2ba7cc39236 e76befc7fe2d
line source
1 # -*- mode: Makefile; -*-
3 # `all' is the default target
4 all:
6 include $(XEN_ROOT)/Config.mk
8 export _INSTALL := $(INSTALL)
9 INSTALL = $(XEN_ROOT)/tools/cross-install
11 XEN_INCLUDE = $(XEN_ROOT)/tools/include
12 XEN_XC = $(XEN_ROOT)/tools/python/xen/lowlevel/xc
13 XEN_LIBXC = $(XEN_ROOT)/tools/libxc
14 XEN_XENSTORE = $(XEN_ROOT)/tools/xenstore
15 XEN_LIBXENSTAT = $(XEN_ROOT)/tools/xenstat/libxenstat/src
16 XEN_BLKTAP2 = $(XEN_ROOT)/tools/blktap2
18 CFLAGS_include = -I$(XEN_INCLUDE)
20 CFLAGS_libxenctrl = -I$(XEN_LIBXC) $(CFLAGS_include)
21 LDFLAGS_libxenctrl = -L$(XEN_LIBXC) -lxenctrl
23 CFLAGS_libxenguest = -I$(XEN_LIBXC) $(CFLAGS_include)
24 LDFLAGS_libxenguest = -L$(XEN_LIBXC) -lxenguest
26 CFLAGS_libxenstore = -I$(XEN_XENSTORE) $(CFLAGS_include)
27 LDFLAGS_libxenstore = -L$(XEN_XENSTORE) -lxenstore
29 CFLAGS_libblktapctl = -I$(XEN_BLKTAP2)/control -I$(XEN_BLKTAP2)/include $(CFLAGS_include)
30 LDFLAGS_libblktapctl = -L$(XEN_BLKTAP2)/control -lblktapctl
32 X11_LDPATH = -L/usr/X11R6/$(LIBLEAFDIR)
34 CFLAGS += -D__XEN_TOOLS__
36 # Get gcc to generate the dependencies for us.
37 CFLAGS += -MMD -MF .$(@F).d
38 DEPS = .*.d
40 ifneq ($(XEN_OS),NetBSD)
41 # Enable implicit LFS support *and* explicit LFS names.
42 CFLAGS += $(shell getconf LFS_CFLAGS)
43 CFLAGS += -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
44 LDFLAGS += $(shell getconf LFS_LDFLAGS)
45 endif
47 # 32-bit x86 does not perform well with -ve segment accesses on Xen.
48 CFLAGS-$(CONFIG_X86_32) += $(call cc-option,$(CC),-mno-tls-direct-seg-refs)
49 CFLAGS += $(CFLAGS-y)
51 # Require GCC v3.4+ (to avoid issues with alignment constraints in Xen headers)
52 check-$(CONFIG_X86) = $(call cc-ver-check,CC,0x030400,\
53 "Xen requires at least gcc-3.4")
54 $(eval $(check-y))
56 _PYTHON_PATH := $(shell which $(PYTHON))
57 PYTHON_PATH ?= $(_PYTHON_PATH)
58 INSTALL_PYTHON_PROG = \
59 $(XEN_ROOT)/tools/python/install-wrap "$(PYTHON_PATH)" $(INSTALL_PROG)
61 %.opic: %.c
62 $(CC) $(CPPFLAGS) -DPIC $(CFLAGS) -fPIC -c -o $@ $<
64 %.o: %.c
65 $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
67 %.o: %.cc
68 $(CC) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $<
70 subdirs-all subdirs-clean subdirs-install: .phony
71 @set -e; for subdir in $(SUBDIRS) $(SUBDIRS-y); do \
72 $(MAKE) subdir-$(patsubst subdirs-%,%,$@)-$$subdir; \
73 done
75 subdir-all-% subdir-clean-% subdir-install-%: .phony
76 $(MAKE) -C $* $(patsubst subdir-%-$*,%,$@)