source: trunk/packages/xen-common/xen-common/tools/Rules.mk @ 95

Last change on this file since 95 was 34, checked in by hartmans, 17 years ago

Add xen and xen-common

File size: 2.1 KB
Line 
1#  -*- mode: Makefile; -*-
2
3# `all' is the default target
4all:
5
6include $(XEN_ROOT)/Config.mk
7
8XEN_XC             = $(XEN_ROOT)/tools/python/xen/lowlevel/xc
9XEN_LIBXC          = $(XEN_ROOT)/tools/libxc
10XEN_XENSTORE       = $(XEN_ROOT)/tools/xenstore
11XEN_LIBXENSTAT     = $(XEN_ROOT)/tools/xenstat/libxenstat/src
12
13X11_LDPATH = -L/usr/X11R6/$(LIBDIR)
14
15CFLAGS += -D__XEN_TOOLS__
16
17# Enable implicit LFS support *and* explicit LFS names.
18CFLAGS  += $(shell getconf LFS_CFLAGS)
19CFLAGS  += -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
20LDFLAGS += $(shell getconf LFS_LDFLAGS)
21
22# 32-bit x86 does not perform well with -ve segment accesses on Xen.
23CFLAGS-$(CONFIG_X86_32) += $(call cc-option,$(CC),-mno-tls-direct-seg-refs)
24CFLAGS += $(CFLAGS-y)
25
26# Require GCC v3.4+ (to avoid issues with alignment constraints in Xen headers)
27check-$(CONFIG_X86) = $(call cc-ver-check,CC,0x030400,\
28                        "Xen requires at least gcc-3.4")
29$(eval $(check-y))
30
31%.opic: %.c
32        $(CC) $(CPPFLAGS) -DPIC $(CFLAGS) -fPIC -c -o $@ $<
33
34%.o: %.c
35        $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
36
37%.o: %.cc
38        $(CC) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $<
39
40.PHONY: mk-symlinks mk-symlinks-xen mk-symlinks-$(XEN_OS)
41
42mk-symlinks-SunOS:
43
44mk-symlinks-Linux: LINUX_ROOT=$(XEN_ROOT)/linux-2.6-xen-sparse
45mk-symlinks-Linux:
46        mkdir -p xen/linux
47        ( cd xen/linux && \
48          ln -sf ../../$(LINUX_ROOT)/include/xen/public/*.h . )
49        ( cd xen && rm -f sys && ln -sf linux sys )
50
51mk-symlinks-xen:
52        mkdir -p xen
53        ( cd xen && ln -sf ../$(XEN_ROOT)/xen/include/public/*.h . )
54        mkdir -p xen/hvm
55        ( cd xen/hvm && ln -sf ../../$(XEN_ROOT)/xen/include/public/hvm/*.h . )
56        mkdir -p xen/io
57        ( cd xen/io && ln -sf ../../$(XEN_ROOT)/xen/include/public/io/*.h . )
58        mkdir -p xen/arch-x86
59        ( cd xen/arch-x86 && ln -sf ../../$(XEN_ROOT)/xen/include/public/arch-x86/*.h . )
60        mkdir -p xen/foreign
61        ( cd xen/foreign && ln -sf ../../$(XEN_ROOT)/xen/include/public/foreign/Makefile . )
62        ( cd xen/foreign && ln -sf ../../$(XEN_ROOT)/xen/include/public/foreign/reference.size . )
63        ( cd xen/foreign && ln -sf ../../$(XEN_ROOT)/xen/include/public/foreign/*.py . )
64        $(MAKE) -C xen/foreign
65
66mk-symlinks: mk-symlinks-xen mk-symlinks-$(XEN_OS)
Note: See TracBrowser for help on using the repository browser.