ia64/xen-unstable

view tools/Rules.mk @ 18420:05c7efee10a1

cross-install: Only apply in tools directory, and automatically wrap $INSTALL.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Sat Aug 30 08:36:02 2008 +0100 (2008-08-30)
parents f292689f48ba
children bd78714b8594
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
17 CFLAGS_include = -I$(XEN_INCLUDE)
19 CFLAGS_libxenctrl = -I$(XEN_LIBXC) $(CFLAGS_include)
20 LDFLAGS_libxenctrl = -L$(XEN_LIBXC) -lxenctrl
22 CFLAGS_libxenguest = -I$(XEN_LIBXC) $(CFLAGS_include)
23 LDFLAGS_libxenguest = -L$(XEN_LIBXC) -lxenguest
25 CFLAGS_libxenstore = -I$(XEN_XENSTORE) $(CFLAGS_include)
26 LDFLAGS_libxenstore = -L$(XEN_XENSTORE) -lxenstore
28 X11_LDPATH = -L/usr/X11R6/$(LIBLEAFDIR)
30 CFLAGS += -D__XEN_TOOLS__
32 # Enable implicit LFS support *and* explicit LFS names.
33 CFLAGS += $(shell getconf LFS_CFLAGS)
34 CFLAGS += -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
35 LDFLAGS += $(shell getconf LFS_LDFLAGS)
37 # 32-bit x86 does not perform well with -ve segment accesses on Xen.
38 CFLAGS-$(CONFIG_X86_32) += $(call cc-option,$(CC),-mno-tls-direct-seg-refs)
39 CFLAGS += $(CFLAGS-y)
41 # Require GCC v3.4+ (to avoid issues with alignment constraints in Xen headers)
42 check-$(CONFIG_X86) = $(call cc-ver-check,CC,0x030400,\
43 "Xen requires at least gcc-3.4")
44 $(eval $(check-y))
46 %.opic: %.c
47 $(CC) $(CPPFLAGS) -DPIC $(CFLAGS) -fPIC -c -o $@ $<
49 %.o: %.c
50 $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
52 %.o: %.cc
53 $(CC) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $<
55 subdirs-all subdirs-clean subdirs-install: .phony
56 @set -e; for subdir in $(SUBDIRS) $(SUBDIRS-y); do \
57 $(MAKE) subdir-$(patsubst subdirs-%,%,$@)-$$subdir; \
58 done
60 subdir-all-% subdir-clean-% subdir-install-%: .phony
61 $(MAKE) -C $* $(patsubst subdir-%-$*,%,$@)